Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Removing Rows

Avatar

Level 3

I have a question about deleting rows. I created a table that allow a user to add or delete rows. I added a delete button on the row that I would like to duplicate. This button cannot delete the row that it is contained in. Is there a way that the delete row button can delete the row that contains it as well?

3 Replies

Avatar

Level 3

Hello Radzmar,

Thank you for the sample pdf, it was a big help! I have another question. Is there a way to setFocus on the first field in the newly created row when the add button is clicked?

Thanks,

Ricky

Avatar

Level 10

Hi Ricky,

yes this is possible, !

Assuming your table "MyTable" has repeated rows "Row" with a textfield "Name" the script in you add row button would look this way:


// Add 1 row
MyTable._Row.addInstance(1);


// Set focus on textfield in newly added row


xfa.host.setFocus(xfa.resolveNode("MyTable.Row[" + _Row.count - 1 + "].Name").somExpression);