We would like to simplify the process of building a tree of entities (hierarchy) for the users. A user defines an entity and one of its attributes is its father entity, which the user selects from a drop down list. How do can we limit this list to contain only "legal" entities?
For example, we would like to limit the presented entities in this list to be only ones which are related to a the same tree (which is also an attribute of an entity) or to entities which are not a child entity of the current one (so there won't be loops in the tree).
Thanks.
To register for the forums, please contact your Digital-Clay representative.
Limiting a drop down list content
-
ZevToledano
- Posts: 722
- Joined: Fri Apr 03, 2009 2:29 pm
Re: Limiting a drop down list content
The method for showing custom values in a drop-down is using a User-Generated Event and then adding a 'Fill drop-down' automation action.
In the event you select what triggers this action (field changes, or form load), and then in the action, you can build a query that filters out exactly which values you want to appear in the drop down.
Since I do not know your table structure and do not know what 'related to the same tree' means, I can't help with you with the filters, but you should be able to build custom links and filter out anything you want.
I am a bit confused though, since it sounds like the field that defines what tree they belong to is the one you are trying to filter. So how do you filter a drop-down based on its own value that is not yet entered?
Regarding loops, see my response to your other question.
In the event you select what triggers this action (field changes, or form load), and then in the action, you can build a query that filters out exactly which values you want to appear in the drop down.
Since I do not know your table structure and do not know what 'related to the same tree' means, I can't help with you with the filters, but you should be able to build custom links and filter out anything you want.
I am a bit confused though, since it sounds like the field that defines what tree they belong to is the one you are trying to filter. So how do you filter a drop-down based on its own value that is not yet entered?
Regarding loops, see my response to your other question.
Re: Limiting a drop down list content
I've almost succeeded doing what I've asked about.
The field I am trying to filter depends on another field's, and not its own. I'll briefly explain:
Each entity has an attribute which is the tree it belongs to - this he can choose from a drop down list.
Another attribute it has is whom is its father entity - this he also chooses from a drop down list.
The second attribute I've mentioned is the one I would like to filter, depending on the value of to which tree it belongs.
if the tree attribute is empty -> the father list should be empty.
if the tree attribute holds the value 'tree 1' -> the father list should contain entities from tree 1.
What I did so far is:
defined an automation action of the type auto fill.
Then I've selected the first option - field that must be changed in a form for this event to fire.
In the filtering screen - 'filters on new values' option and there I've selected to filter on the tree attribute according to the value 'tree 1'.
Exactly at this point I couldn't find how I do it a dynamic filter. I don't want it to fire a trigger only when the user selects the value 'tree 1' in the tree field.
From there on I've created the action to be made and built a query which gives back only the values of entities belonging to tree 1.
Summing that all up, I have a great automation action which works perfectly only if the user selects 'tree 1' in the tree field. (again, it is not dynamic)
Thanks for the help.
The field I am trying to filter depends on another field's, and not its own. I'll briefly explain:
Each entity has an attribute which is the tree it belongs to - this he can choose from a drop down list.
Another attribute it has is whom is its father entity - this he also chooses from a drop down list.
The second attribute I've mentioned is the one I would like to filter, depending on the value of to which tree it belongs.
if the tree attribute is empty -> the father list should be empty.
if the tree attribute holds the value 'tree 1' -> the father list should contain entities from tree 1.
What I did so far is:
defined an automation action of the type auto fill.
Then I've selected the first option - field that must be changed in a form for this event to fire.
In the filtering screen - 'filters on new values' option and there I've selected to filter on the tree attribute according to the value 'tree 1'.
Exactly at this point I couldn't find how I do it a dynamic filter. I don't want it to fire a trigger only when the user selects the value 'tree 1' in the tree field.
From there on I've created the action to be made and built a query which gives back only the values of entities belonging to tree 1.
Summing that all up, I have a great automation action which works perfectly only if the user selects 'tree 1' in the tree field. (again, it is not dynamic)
Thanks for the help.
-
ZevToledano
- Posts: 722
- Joined: Fri Apr 03, 2009 2:29 pm
Re: Limiting a drop down list content
OK, you're almost there.
First of all you don't want to add any filters at the level of the automation event handler. This filters when the handler will run and you want it to run in all cases.
You add a 'Fill drop-down' automation action. This pops up a window for configuring the query + filter mappings:
- You build a query that lists all entities filtered by 'tree'. You select any 'tree' filter value you want in the query window and close the query window.
- You then map the tree filter to the tree field in the filter mapping area and this will give you a dynamic filter.
First of all you don't want to add any filters at the level of the automation event handler. This filters when the handler will run and you want it to run in all cases.
You add a 'Fill drop-down' automation action. This pops up a window for configuring the query + filter mappings:
- You build a query that lists all entities filtered by 'tree'. You select any 'tree' filter value you want in the query window and close the query window.
- You then map the tree filter to the tree field in the filter mapping area and this will give you a dynamic filter.