Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Adding/removing rows dynamically from a table with buttons

$
0
0

I have an expanding table which will be used to enter a list of user names.  Each row has a "Remove User" button in the last cell on the right.  At the top of the table I have an "Add More Users" button.  I would like to hide the "Remove User" button when when the form is first opened or if there is only one user. Then after you click "Add More Users" I would like the button to start showing on all rows, including the first.  I'd greatly appreciate any help.

 

Table crop.jpg

 

The Add More Users button has this script, but it isn't working right:

 

if (RowUserName.RemoveUser.presence = "visible") {  this.resolveNode('Table1._RowUserName').addInstance(1);  }  else  RowUserName.RemoveUser.presence = "visible";  this.resolveNode('Table1._RowUserName').addInstance(1);

 

 

I also tried using a small rectangle to block the label on the first button ("BlockLabelOnFirstButton"), but that doesn't work either (it completely disables the "Add New Users" button):

 

this.resolveNode("BlockLabelOnFirstButton").presence = "invisible";
this.resolveNode('Table1._RowUserName').addInstance(1);
if (xfa.host.version < 8) {  xfa.form.recalculate(1);  }
if (RowUserName.instanceManager.count = 1)  {  this.resolveNode("BlockLabelOnFirstButton").presence = "visible";  }

Viewing all articles
Browse latest Browse all 5571

Trending Articles