Creating Dynamic Select Boxes in Genie
Posted: Wed Jun 25, 2008 11:57 am
Q:
How can I dynamically change select box data based on specific criteria?
A:
If you have played with select boxes in Genie, you should already know that you can attach any of them to an i database file. But if you only want to retrieve the data that belongs to the current user, selected customer, etc.
Genie provides a convenient way to subset the data with its “choices selection criteria” property. This property maps to a WHERE clause in an SQL statement. Sometimes, a simple expression like “COMPANY = 1” is all you need, but often times you want this expression based on some information on the screen. Here is what you can put into the “choices selection criteria” property to implement this:
Script: “COMPANY = “ + get(“D_6_3”)
Here, D_6_3 is the id of the element that contains the company number.
Pretty simple.
How can I dynamically change select box data based on specific criteria?
A:
If you have played with select boxes in Genie, you should already know that you can attach any of them to an i database file. But if you only want to retrieve the data that belongs to the current user, selected customer, etc.
Genie provides a convenient way to subset the data with its “choices selection criteria” property. This property maps to a WHERE clause in an SQL statement. Sometimes, a simple expression like “COMPANY = 1” is all you need, but often times you want this expression based on some information on the screen. Here is what you can put into the “choices selection criteria” property to implement this:
Script: “COMPANY = “ + get(“D_6_3”)
Here, D_6_3 is the id of the element that contains the company number.
Pretty simple.