Expand my Community achievements bar.

XML values from tables

Avatar

Level 2

Hi All,

I need help in extracting XML values from a table.

Condition:

I have a table, That values are polulating to the table from an XML file. Now, based on one dropdown selection I have to show and hide those values in table.

Can anyone please help here.

Thanks,
Tanmay

3 Replies

Avatar

Level 2

Do you want to hide the table or just the fields in the table?  If you want to just hide the table, you can do Tablename.presence = 'invisible' / 'visible' based on the change event of the drop down list object. 

something like this (in the change event of the drop down object):

if (xfa.event.newText == 'show') { Tablename.presence = 'visible';}

else if (xfa.event.newText == 'hide') { Tablename.presence = 'invisible';}

This is assuming that  your dropdown only has 'hide' and 'show' values.

If you want to just hide the fields in the table, you need to loop through all the fields and set their presence individually.  something like this:

var vRows = Tablename._Row.count;

for (var i = 0; i < vRows; i++) {

if (xfa.event.newText == 'show') {

     Tablename.resolveNode("Rowname[" + i + "]").field1name.presence = 'visible';         Tablename.resolveNode("Rowname[" + i + "]").field2name.presence = 'visible';

     // repeat above for all fields

}

else if (xfa.event.newText == 'hide) {

     Tablename.resolveNode("Rowname[" + i + "]").field1name.presence = 'invisible';         Tablename.resolveNode("Rowname[" + i + "]").field2name.presence = 'invisible';

     // repeat above for all fields

}

Avatar

Level 2

Hi Ancientgames,


Thanks for your reply. However, I am requirement is different. Refer to the screenshot below:

If I select Restaurant in the Drop-down, the table should only show the details of restaurant. If I select Travel, it should show all the travel catagories.

Please share your e-mail ID, I can share the file with you.

XMLvalues.png

Avatar

Level 2

You can tweak my original reply to get the desired result.  The concept is the same.