Expand my Community achievements bar.

Dynamic binding issue with dropdown

Avatar

Level 1

Hi,

I am using text fields and a dropdown in a repeating subform.

When I am repeating the node in the data file, the text field values are getting populated for all the instances corredtly.

But for the dropdown, it is adding up the dropdown values from all the instances and displaying the collated values in each repeating dropdown ?

Can anyone help me to sort out the above issue ?

Code : form, schema and xml

https://docs.google.com/leaf?id=0B1fb4DzwoxFjY2YzN2Y5YmMtZWIyYS00MzhiLWEyNGEtZWJmMjRlMjk5YjU0&hl=en_...

5 Replies

Avatar

Level 10

You need to set the binding for the repeating subform "Email1".

Then remove the binding for the dropdown and place the code in the initialize event of dropdown.

var intIndex = this.parent.parent.index;
var oResponseListNodes = xfa.resolveNodes("$record.emailProps[" + intIndex + "].ResponseList.ResponseItem[*]");


for(i=0;i<oResponseListNodes.length;i++){
    var oResponseItemNode = xfa.resolveNode("$record.emailProps[" + intIndex + "].ResponseList.ResponseItem[" + i + "]");
    this.addItem(oResponseItemNode.ResponseText.value, oResponseItemNode.ResponseCode.value);
}

Thanks

Srini

Avatar

Level 1

Thanks Srini for your reply.

But that does not solve my problem. I have also used scripting to achieve the above.

But I am still wondering why binding is not working for dropdown in a repeating sf while it works fine if dropdown is not in a repeating sf.

Waiting for reply..

Avatar

Level 10

The issue is with the way XML is formatted.. You want to display the Drodpdown values from a repeating tag (<ResponseItem>) which is also part of another repeating tag(<emailProps>).

If you look at your binding property you will see two tags with [*] in it. That's why PDF is adding all the reponse items in all the EmailProps.

To avoid this you need to specify the index of the "<emailProps>" to the binding. You can write script or dynamically pass the "<emailProps>" index to your binding to work the way you expect.

Here is the document that I modified to make it work.

https://acrobat.com/#d=0-dXS-VpBRyEZMg9aR-fxA

Thanks

Srini

Avatar

Level 1

Thanks Srini for your reply..

Now as per my understanding...

If we have a repeating subform inside another repeating subform,, then we cant populate correct data in the second repeating form using binding..

Am I right ?

Also I am not able to open the link provided by you.. https://acrobat.com/#d=0-dXS-VpBRyEZMg9aR-fxA

Getting below error :

dynaBinding.JPG

Avatar

Level 10

Since the file is an XDP, you can open it in Acrobat. Try downloadingthe file to your filesystem and then open it with LC Designer.

Thanks

Srini