contingencies

1
0
-1

hi all,

created a simple pool with one lane and created several datasets in the pool. One of them is function level in which i added the level of EMP, Man, MANEX, MANCM, CEO. Besides that i created a data set with people per level (PeopleLVL). So for example the level MAN, i added person1, person2 and person3. In my form the first field which is shown is the function level and if i choose f.e. MAN than i want the next field MAN filled with the people who i defined as MAN in the PeopleLVL. After displaying the user has to make a choice which person is responsible. I know that i can do this with the function contingencies but could someone help me using this.... thnx emveha

Comments

Submitted by renaud.pichot on Fri, 08/22/2014 - 16:22

hi emveha, considering you are talking about process data, I understand that you have - process data "level", java.util.List, default values=script returning ["EMP","Man","Manex","MANCM","CEO"] - process data "PeopleEMP", java.util.List, default values=script returning ["person1","person2","person3"] - process data "PeopleMan", java.util.List, default values=script returning ["person4","person5","person6"] - process data "PeopleManex", java.util.List, default values=script returning ["person7","person8","person9"]

In your form you have - field_level, widget type=select, available values=level values, selected value="", output operation=level takes value of field_level - field_people, widget type=select, available values="", selected value="", output operation=people takes value of field_people

Click on the field_people widget, add a contingency on field_level eventually set "show immediately" value to false and "show when a trigger has changed" to an expression, groovy script, field_level!="" then in the "available value after update", use a groovy script such as:

switch (field_level) {
        case "EMP":
                return peopleEMP;
        case "Manex":
                return peopleManex;
        default:
                return peopleMan;
}

you may want to improve that groovy script using dynamic variables ...

No answers yet.
Notifications