Answered

Make a filter in cascading combo

I have a three levels in cascading combo. In the first level, I want to make an filter. Like, if a person starts a process but he is an user that can only see few data in level 1.

Example if Thiago, in the first combo will appear only miami and san francisco otherwise will appear only miami in the first level.

In this case I need the filter only in the first level.

obs: In the combobox when is cascading combo dont have the attribute filter in properties.

photo
0

Dear Thiago,

A member of our support team will contact you.

Regards

photo
0

This is not a simple cascading combo and like you mentioned, the standard cascading combo won't work.

The first level of cascading combo should be filtered by a rule (just use the normal combo).

You must also activate "Submit on change" in the Advanced tab.

You can filter with an expression that returns a string with all possible values.

Example:

var validValues = CHelper.GetValueAsCollection(<entity.ValueCollection>);

var filterString = " idValue IN (-1";

for (var i = 0; i < validValues .size(); i++) {

var temp = validValues .get(i);

filterString = filterString + "," + temp.getXPath("Id");

}

filterString = filterString + ") ";

filterString;

I always put a -1 since it makes it easy when there are no values in the collection and it also makes it easier to add new id's... always with a comma.

The second combo must also have a filter that depends on the firts combo's value.This can be a simple filter or a more complex filter.Hope this helps.