Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

How to filter XML Datasource bound to Dropdown list?

Avatar

Former Community Member

Dear All,

I quiet new to LiveCycle designer ES from past couple of weeks I am working on this.

Right Now I have issue with filering XML Datasource bound with dropdown list.

I have XML file which has the data to the States and City. I have bound one of my dropdown list to State. My requirement is once I select the 'State' the corresponding City Names has to be listed in the second dropdown list.

I searched in the net and got couple of samples on that. But I failed to make my form work as requirement. Even though I have generated the XML file as given structure in the examples.

Please check the attached xml file which I have created.

I have struckup right now. So, help me this.

Very much thanks in advance.

Regards,

Sree Harshavardhana.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Your xml structure is virtually the same as one last week with a similar question, http://forums.adobe.com/thread/518731.

I have renamed the required fields in the attached example.

Hope it helps.

Bruce

View solution in original post

5 Replies

Avatar

Correct answer by
Level 10

Hi,

Your xml structure is virtually the same as one last week with a similar question, http://forums.adobe.com/thread/518731.

I have renamed the required fields in the attached example.

Hope it helps.

Bruce

Avatar

Former Community Member

Dear BR,

Thanks for the quick reply and most useful example. I'll try to apply the same in to my form and look in to it.

But, I would like to know is what was the corrections you have made in the javascript. I am not wrong the code which you have written in the example pdf the same I had written, but it did not work for me! Please check the code below which I had written.

---------------------

StatesAndCities.#subform[0].StateName::change - (JavaScript, client)

var stateDataNode = xfa.resolveNode("StatesAndCities.States.(StateID.value == " + this.boundItem(xfa.event.change) + ")");

 
CityName.clearItems();

for (var i=0; i<stateDataNode.City.all.length; i++)
{
    xfa.host.messageBox(stateDataNode.Cities.all.item(i).Code.value);
   
    CityName.addItem(staffDataNode.City.all.item(i).Code.value);
}

---------------------

I'll look forward by highlighting my mistakes, so that I can go by my own.

Regards,

Sree Harshavardhana.

Avatar

Former Community Member

Dear BR,

As I have mentioned in the above reply, I tried your example with my form it's really working great!

But, the problem is, in the State dropdown list it's not showing the selected State name. How do I do that?

Regards,

Sree Harshavardhana.

Avatar

Level 10

Sree,

You need to setup the item binding for the States, in the State dropdownlist object pallet;

objectpallet.JPG

Click the list items hyperlink and entry the bindings in the Dynamic Properties dialog

dynamicproperties.JPG

Bruce

Avatar

Former Community Member

Dear Bruce,

Actually I did the same, even then it did not show up the State. But I'll try the same once again.

Regards,

Sree Harshavardhana.