HI GUYS,
I am new to livecycle designer and am building a form that has 3 dropdown menus; 1st dropdown menu has a list of options e.g. E_COM, E_ENGS and by selecting this the second menu populates E_COM 1, E_COM 2 and when an item on the second menu is selected e.g E_COM 2, the third dropdown menus is populated with a list of options.
Please can anyone help? and show me how to write these in a Switch statement or how would you advice i do about doing this?.
thanks
Views
Replies
Total Likes
You can use the preOpen event of each dropdown list to populate them. So your switch statement would use this.clearItems and then this.setItems(" , , ") for each option.
Views
Replies
Total Likes
Hi Whyisthisme,
Please can you give me an example using the table below, how do i write this.
Dropdown 1 | Dropdown 2 | Dropdown 3 |
---|---|---|
E_COMM | E_COMM_1_Ananlytical & Process | 50184419 - Analytical & Process |
E_COMM_1_Asset Planning & Sourcing | 50139603 - Asset Planning & Sourcing | |
E_ENGC | E_ENGC_1_Chemical Engineer | 50195825 - Chemical Enginner |
E_ENGC_2_Chemical Engineer | 50195826 - Chemical Enginner |
Views
Replies
Total Likes
What I do with dropdownlist that needs autopopulating i usually create a script object.
The script object contains a multi-dimensional array that contains every value linked to each other
e.g.
var tabArray = new Array(["E_COMM",
new Array(["E_COMM_1_Analytical & Process", new Array("50184419 - Analytical & Process", "..."],
["E_COMM_1_Asset Planning & Sourcing", new Array("50139603 - Asset Planning & Sourcing", "..."])],
["E_ENGC",
new Array(["E_ENGC_1_Chemical Engineer", new Array("50195825 - Chemical Engineer", "...")],
["E_ENGC_2_Chemical Engineer", new Array("50195826 - Chemical Engineer", "...")])]);
tabArray[0][0] = "E_COMM"
tabArray[0][1] = Array()
tabArray[0][1][0][0] = "E_COMM_1_Analytical & Process"
tabArray[0][1][0][1] = Array()
tabArray[0][1][0][1][0] = "50184419 - Analytical & Process"
using a for loop with the array could look something like this
Views
Replies
Total Likes
An example of how to do it in formcalc would be (in the preOpen statement of the 2nd dropdown):
if (DropDownList1 == "E_COMM") then
$.clearItems()
$.setItems("E_COMM_1_Ananlytical & Process,E_COMM_1_Asset Planning & Sourcing")
elseif (DropDownList1 == "E_ENGC") then
$.clearItems()
$.setItems("E_ENGC_1_Chemical Engineer,E_ENGC_2_Chemical Engineer")
endif
You could then do something similar in the 3rd box. The logic is the same for a java switch statement just the syntax is different.
Views
Replies
Total Likes