DropDown - InfoPath Dev
in

InfoPath Dev

DropDown

Last post 11-06-2006 08:28 PM by Abhishek. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-06-2006 03:34 AM

    DropDown

    I have a dropdown list which have the values hardcoded.

    When i submit to the webservice i can get the selected value of the dropdown:

    this.thisXDocument.DOM.selectSingleNode("//my:cmbRecommendation").text;

    However, when i bind the dropdown with the database values returned from the webservice the above becomes blank.

    Any ideas?
  • 11-06-2006 05:10 AM In reply to

    Hi TravisBickle,
    When u hardcode values in the dropdown manually,u have the option to select the default value in the listbox properties dialog.Thats why u can find the value selected by default in ur dropdown.

    So how do u set the default selected value for the dropdown when u bind the dropdown to a web service?

    Do as follows...
    Assume ur web service returns aaa,bbb,ccc,ddd.
    And u need to automatically set "ddd" as the selected value in the dropdown,

    Go to the data source taskpane and double click the field to which ur dropdown is bound..Lets say "cmbRecommendation"

    Set the default value of the field cmbRecommendation to "ddd" in the dialog box that opens.

    Now the web service bound dropdown shows "ddd" by default as the selected value.

    Regards,
    Abhishek
  • 11-06-2006 05:47 AM In reply to

    Sorry for the confusion what i mean is:

    When i get the data from the webservice using the combo box bound to webservice is will set the dropdown to the approriate value.

    However, if this value is changed and i want to capture it to post back to webservice i cannot get the combo box value.

    hope that makes sense.
  • 11-06-2006 08:28 PM In reply to

    Hi Travis,
    Double click on the dropdown to open the dropdown listbox dialog.

    Click Data Validation, select the OnafterChange event in the Events dropdown and click Edit.

    In the eventhandler,typing "e.Site.text" gives u the newly selected value in the dropdown.

    Send this value to the web service.

    U can also accomplish this using rules too.

    Instead of Datavalidation,click "Rules" in the dropdown properties dialog.

    Add a rule "Submit using Data Connection" to a web service. The rules that u specify will apply actions when the user changes a value in the control.

    hope that helps.

    Regards,
    Abhishek
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.