Cascade drop-down for ne-persistent data

Cascade drop-down for ne-persistent data



I want to implement a cascade drop-down but without having the data stored.

I use some web services to get data from an external application.

Did somebody try to make a detail screen with two combo-boxes (that second showing values depending on the value selected on the first one) when the data from the preparation is not persistent?

The implementation that I want to make is similar to the one described in the link below, the difference is that I want to use data from a structure.

You can use a list variable as source to the second combo box. Every time the first one changes (onchange), you can get the new list from the web service, clear the old list and add the new items, and than Ajax refresh the second combo box.

P.S. what do you mean by "structure" A combo box requires a list (the type can be a structure, of course)

Jauch wrote:

P.S. what do you mean by "structure" A combo box requires a list (the type can be a structure, of course)

That's exactly what I meant. The type of variable is the structure


Hum... In fact I don't know if the system will allow you to feed the combo with a list of a structure.

You can try.

If it does not allow, you can do a small workaround.

You can create an entity that have only two fields: caption (text) and the Id.

In the screen, you create 2 variables, um of type the Entity, one a list of the type entity. Than, in the action that executes the web service, you iterate on the list of structures, add the index to the I'd of the variable of type entity and the caption, and append it to the list. The list can be bound to the combo. When the user select one item, the variable that stores the item selected will store it's "id", that in fact is the index in the list of structures.


See that while you create an entity, you are not storing anything in the database.

No need, you can just use a structure list local variable as data source for your combobox.

Just use ListClear, and ListAppendAll to change the data in the onchange of your first combobox.