Page tree
Skip to end of metadata
Go to start of metadata

A Choose Window is a floating window containing a simple toolbar and a grid. It serves as a lookup screen allowing the user to select a specific value from the list of records in order to use it in a dynSelect control in Form.

Creating the chooseWindow

1.In Layout Designer start with creating a new object by using the "SwatChooseWindowStandard" template which only contains the toolbar and no grid or business entity objects. 

2. In Design View add the grid and business entity objects to the choose window object by drag-and-drop after searching for these objects. In Links view add the "Data" link between the business entity object and the grid object and also the "Primary Sdo" link between the container and the business entity object. Set the "enabled" attribute of the grid to FALSE.

Using the chooseWindow in a dynSelect

3. Open the window repository object where the ChooseWindow will be used. Double click on the form to open the Form Builder and find the corresponding dynSelect control. Set the AxLookupDialog attribute value to the ChooseWindow object name previously created.

4. Make sure the ChooseWindow and dynSelect objects share the same business entity object. The same mappings/attributes will be used for the choose window functionality. 

At run time the ChooseWindow object will be displayed by clicking the small arrow icon of the input field or ALT-L after having selected the dynSelect field  on the form.

By default selecting a row in the Choose Window grid is done by clicking on the Confirm button on the top-left. Selecting a row is also possible by double-clicking on the grid row by setting EventRowChosen attribute to "$ akioma.chooseWindowRecordSelected(self)".

 

Programatically applying filter criteria to the chooseWindow-BusinessEntity

Sometimes the chooseWindow must apply filter criteria to its BusinessEntity based on other Fields in the Form in which the dynSelect is used. E.g. the form might have a Customer-Field, and the dynSelect shall only display contacts of that customer. To achieve this, in the dynSelect the EventBeforeFetch can be used (see corresponding part of the dynSelect documentation here). To do something similar, there is a helper function:

$ akioma.filterDynamicallyGrid (self,'<FormField>','<BE-Field>','<operator>');
??
// sample
$ akioma.filterDynamicallyGrid (self,'CustNum','CustNumInBE','=');



 

That code must be placed in the EventBeforeFetch attribute of the chooseWindow-BusinessEntity

  • No labels