List-Record count

Description

Inserts a static text control that shows the number of records in a List control.

images/lrc.png

The HTML for the List-Record count control looks like this:

Records: <span id="{dialog.componentname}.list1.RECORDCOUNT"></span>

The example below shows how to implement this comtrol using a simple list derived from a static data source. In order to make this feature useful, however, it really requires a list in which rows of data can be easily added or deleted. To add these features see the 'List-Detail View-Buttons' control in the 'Defined Controls' menu.

Using List-Record Count with a List Based on a Custom Data Source

If the List Control is based on a custom data source, you Xbasic function that returns the data for the List must set the e.recordsInQuery property in order to use the List-Record count control with your List.

See Setting the Record Count for more information.

Add a List-Record Count to a List

  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.

    images/lrc2.png
  2. Highlight the list control. In the properties list on the right click on the button next to the 'List properties' property in the List Properties section. The List Builder will open.

    images/lrc3.png
  3. On the List Builder's Data Source pane set the 'Data Source Type' to 'Static'.

    images/lrc4.png
  4. Click on the button next to the 'Static text' property.

    images/lrc5.png
  5. In the 'Static Choices' dialog click the 'Sample data' button. From the 'Sample Data' options highlight the 'Name and addresses' option. Click OK to add the data set to the Static Choices dialog and OK again to get back to the List Builder.

    images/lrc6.png
  6. Open the 'List Layout' pane. Use the blue > arrow to move the four static data fields from the 'Available Fields' list to the 'Columns in List' section. Click OK to close the List Builder.

    images/lrc7.png
  7. Open the 'Defined Controls' dialog and click on the 'List-Record count' option.

    images/lrc8.png
  8. In the pop-up box that appears select the list you just defined, list1 in this case, and click OK.

    images/lrc9.png
  9. Run the component in Live Preview. You should see the control displaying the number of records in the list.

    images/lrc10.png