Avatar

Level 7

This might be more easily accomplished by setting the minimum count of RowUserName to 1.

748603_pastedImage_0.png

The button would remain, but it wouldn't do anything.

As for adding the user row, your if statement has an assignment rather than a condition. You need to use == instead of =. Here are the scripts I used to make your example work for me.


form1.p1.Table1.HeaderRow.AddUser::click


Table1.RowUserName.instanceManager.addInstance();


xfa.resolveNode("Table1.RowUserName["+0+"].RemoveUser").presence = "visible";



form1.p1.Table1.RowUserName.RemoveUser::click


this.parent.instanceManager.removeInstance(this.parent.instanceIndex);



form1.p1::ready:layout


//the following is not strictly needed if you set the min count to 1 since you can't remove the last instance anyway.


if(p1.Table1.RowUserName.instanceManager.count == 1) xfa.resolveNode("Table1.RowUserName["+0+"].RemoveUser").presence = "hidden";


else xfa.resolveNode("Table1.RowUserName["+0+"].RemoveUser").presence = "visible";