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

}