Wrap a List Control in a Window Container.


You can use a window container to display a list control filled with data generated from an SQL database. The list control can also be easily formated using pre-defined templates.

A list in a window displaying a SQL table from a server-side database.
  1. In the UX Builder on the UX Controls page open the 'Data Controls' menu. Click on the [List] option to add a list control to the component.

  2. Highlight the list control in the controls tree. In the property list on the right scroll down to the List Properties section and click the [...] button next to the 'List properties' property to open the list builder.

  3. On the List Builder's 'Data Source' pane, select 'SQL' in the 'Data Source Type' menu.

  4. Click the [...] button next to the 'Connection string' property in the 'SQL Data Source' section of the properties shown on the 'Data Source' pane.

  5. Select or create a connection string to the 'Northwind' database. Click OK to return to the Data Source pane.

  6. Click the [...] button next to the 'Table name' property and select the 'Customers' table.

  7. Click the [...] button next to the 'Field list' property. Check the 'ContactName', 'City', 'Country, 'CompanyName', and 'CustomerID' field checkboxes.

  8. Open the 'List Properties' pane. Scroll down the list to the 'Layout Properties' section. Click the dropdown next to the 'Layout type' property and select the 'Freeform' option.

  9. Open the 'List Layout' pane. The pane should appear in free-form mode. Click the 'Pre-defined Templates' hyperlink at the bottom of the pane.

  10. A list of possible templates will appear. Select the first option from the list and click OK.

  11. A 'Map Template Placeholders' dialog will appear. Click the dropdown next to the [[Context]] placeholder and set it to be {CustomerID}.

  12. Assign the remaining placeholders. Set [[Level1]] to the {ContactName} placeholder, [[Level2]] to the {CompanyName} placeholder, [[Summary]] to the {Country} placeholder, and [[Detail]] to the {City} placeholder. Click OK and OK again to close the List Builder.

  13. With the list control still highlighted in the controls tree open the 'Containers' menu and click on the [Container] option.

  14. From the 'Container Type' list select the 'Window' option and click the 'Insert Around' button.

  15. Highlight the opening window tag in the controls tree, '[Window:WINDOW_1]'. In the properties list click the [...] button next to the 'Window proeprties' property in the Window Properties section.

  16. In the Window Container dialog set the 'Window type' to be 'Dropdown'.

  17. Click the [...] button next to the 'Dropdown Window position' property and set it to 'Relative'

  18. Uncheck the 'Window title show' checkbox.

  19. Set the 'Window height' and 'Window width' properties to 3in and uncheck the 'Window is resizable' checkbox.

  20. Check the 'Has pointer icon' checkbox and click OK to close the Window Container dialog.

  21. Highlight the list control again and again scroll down to the 'List Properties' section. Check the 'Fill container' checkbox.

  22. Highlight the [Window End: WINDOW_1] tag in the controls tree. Open the 'Defined Controls' menu and click the [Button] option to add a button control to the component.

  23. Highlight the button control. In the button's properties list on the right set the 'Button text' to read 'Customers'.

  24. Scroll down the properties list to the 'Javascript' section and click the [...] button next to the 'onClick' property.

  25. In the 'Edit onClick Event' dialog set the editing mode to 'Action Javascript'. Click the 'Add New Action' button.

  26. The 'Select and Action' dialog will open. Type 'Show' into the filter list and then select the 'Show Container Window' action. Click OK

  27. Click the dropdown next to the 'Container ID' property and select the window container you previously defined, 'WINDOW_1'. Click OK, OK, and 'Save'

  28. Run the component in live preview and click the 'Customers' button. The list control should be displayed.


See Also