Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 form field as inputdynSelect 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 choose window is to ChooseWindow will be used and double . Double click on the form to open the Form Builder and set find the corresponding dynSelect control. Set the AxLookupDialog attribute value of a dynSelect form field object as to the ChooseWindow object name previously created.

Image RemovedImage Added

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.

Image Added

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)".

Image Added

 

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).

Image Removed

 To do something similar, there is a helper function:

Code Block
$ 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