I have two drop-downs, the first dropdown contains the coding type list. When a particular coding type is selected, the second drop-down gets populated with the codes associated to the selected coding type. I have done this and is NOT working fine.
The first drop-down is based in a lookup Table Builder (datasource: database query) something like:
SELECT TYPE_ID, NAME FROM LIS.CODING_TYPE
The second drop-down is a lookup Table Builder (datasource: data service operation -named listCodingByTypeIdQuery)
SELECT TYPE_ID, CD_ID, DESCRIPTION FROM LIS.CODING WHERE TYPE_ID=?
I have a problem: When I choose a different coding type in the first dropdown I use an HTML Event action to launch an action, submiting the form to populate the second drop-down. I couldn't make the second drop-down is populated with information related to the first one and also the selected coding type is lost when the form is submited
In this moment I am not able to establish relation between the drop-downs, I don't know how to implement this functionality,
Please suggest how to implement the required relationship.
Thank you in advance.
Pinned topic Related dropdowns
VenkPras 2700062XRD6 Posts
Re: Related dropdowns2013-09-27T13:19:59ZThis is the accepted answer. This is the accepted answer.
First DropDown should have a HTML Event action builder, onchange. The action should be Call Action List , action list should pass the selected type value to fetch the results from SQL call, make a sysout after making the SQL call to confirm you are getting the results.
The results can be added to a variable in a defined format xml pass that xml to lookup table builder and display in the second dropdown , in HTML Event action.
Disclaimer:: My postings on this site are my personal views and do not necessarily represent the positions, strategies, or opinions of IBM.
Re: Related dropdowns2013-09-27T14:19:13ZThis is the accepted answer. This is the accepted answer.
- VenkPras 2700062XRD
Thank you for your response.
I have the html event builder, onchange, I use Submit form and invoke action as Action Type in this builder. If I don't use a "Submit" option int the Action type I am unable to get the var content of the first dropdown.
I have confirmed I got the results using SystemOut inside my Action List.
Could you please tell me me how do I pass the results to an xml var y then how to pass it to a look up builder? I am using a Post-Action behavior "Refresh specified page location after running action" in the HTML event action refreshing the tag of the second dropdown.
I want to test the xml solution that you raised to try if it works in conjunction with other portlets.
Thank you for help me.
Re: Related dropdowns2013-10-07T15:05:05ZThis is the accepted answer. This is the accepted answer.
- VenkPras 2700062XRD
Could you please tell me how Do I add the results to a XML variable and how to pass that XML to the lookup table?