Topic
  • 3 replies
  • Latest Post - ‏2013-10-07T15:05:05Z by jaav
jaav
jaav
3 Posts

Pinned topic Related dropdowns

‏2013-09-25T23:53:00Z |

Hi All,

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,

Any Ideas?

Please suggest how to implement the required relationship.

Thank you in advance.

  • VenkPras
    VenkPras
    6 Posts

    Re: Related dropdowns

    ‏2013-09-27T13:19:59Z  

    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.

     

    -VenkPras

    Disclaimer:: My postings on this site are my personal views and do not necessarily represent the positions, strategies, or opinions of IBM.

  • jaav
    jaav
    3 Posts

    Re: Related dropdowns

    ‏2013-09-27T14:19:13Z  
    • VenkPras
    • ‏2013-09-27T13:19:59Z

    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.

     

    -VenkPras

    Disclaimer:: My postings on this site are my personal views and do not necessarily represent the positions, strategies, or opinions of IBM.

    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. 

    Note: I forgot to mention that, when I run my form its works correctly the second drop down is populated correctly but when I use this portet along with others in the same page, it doesn't work right, I got a Javascript error.

    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.

     

     

     

  • jaav
    jaav
    3 Posts

    Re: Related dropdowns

    ‏2013-10-07T15:05:05Z  
    • VenkPras
    • ‏2013-09-27T13:19:59Z

    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.

     

    -VenkPras

    Disclaimer:: My postings on this site are my personal views and do not necessarily represent the positions, strategies, or opinions of IBM.

    Sakthi, 

    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? 

    Thank you.