Skip navigation
Currently Being Moderated

Prepopulate dropdown lists with xml file

Apr 28, 2011 2:33 AM

Hi everyone,

 

I'm trying to prepopulate a dropdown list using an xml file. There are many tutorials on the internet that allows me to do that from the preview tab of the designer. However, when I did that it worked well, but i'm not able to "embed" the xml file so that the values will appear in the workspace when the user start a process.

 

I tried to load the xml file with read resource content in the action profile of the first task, and put the result in the "xmlPrepareData" but the problem is that I can't set any values of the xmlPrepareData after because the xml template isn't exactly the one used by LiveCycle.

 

Any thought ? Is anyone already succeded in prepopulate a dropdown list with an xml file inside the process ?

 

Regards,

 

Thomas

 
Replies
  • Currently Being Moderated
    Apr 28, 2011 2:43 AM   in reply to BapediBoupi

    Hi,

     

    you make invoke a shortlived process[which populates your dropdown values, example: Query for Multiple Rows as XML service] when the user start a process from workspace and prepopulate a dropdown list using that xml file.

     

    Regards --

    Chalukya.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 28, 2011 2:50 AM   in reply to BapediBoupi

    is my understanding correct ..

     

    you want to prepopulate a dropdown list using xml file in XDP/PDF form, when a user initiates a process from workspace..

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 28, 2011 3:08 AM   in reply to BapediBoupi

    ok gr8 ..

     

    Assuming that u are able to get the xml file from LC process to your XDP/PDF form field.

    You can resolve the xml file to dropdown list as -

     

    //clear drop-down list box
    *DROPDOWN_Field.clearItems();


    choiceList = XMLData.parse(*XML_Field.rawValue, false);

     

    //split the choiceList into an array of values

    choices = choiceList.resolveNodes("root.element[*].*NODENAME");

    var numchoices = choices.length;

     

    //add an array of values to drop down list
    for (var i = 0; i < numchoices; i++)

    {
    *DROPDOWN_Field.addItem(choices.item(i).value);
    }

    *DROPDOWN_Field -- Is your drop-down field.

    *XML_Field -- Is your XML data that is stored in a TextField.

    *NODENAME -- Is node name in your XML to be resolved.

     

    Hope it Hepls..

     

    Regards--

    Chalukya.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points