Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Add rows to and remove rows from a table at runtime question

Avatar

Level 3

I've downloaded an example from Adobe for Adding or Removing a row at runtime.

The example works great, But it only allows you to generate maximum of 7 rows!!!!!

I've tried to change the code but I was unseccessful. Can you help?

Here's the code for the Add button

form1.#subform[0].Add::click - (JavaScript, client)
// nTableLength stores the number of XML elements contained in Table1.

var nTableLength = Table1.nodes.length;
var nNumRow = 0;
for (var nCount = 0; nCount < nTableLength; nCount ++) {
if ((Table1.nodes.item(nCount).className == "subform") & (Table1.nodes.item(nCount).name !== "HeaderRow")) {
  nNumRow = nNumRow + 1;
}
}

if (nNumRow == 7) {
xfa.host.messageBox("The maximum allowable number of rows is 7. You cannot add any more rows.", "Warning", 3);
}
else {
Table1.Row1.instanceManager.addInstance(1);
}

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Take a look at the field 'items' it may be defined with a max number rows as depicted by the subform 'detail', below.

p.png

Steve

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

Take a look at the field 'items' it may be defined with a max number rows as depicted by the subform 'detail', below.

p.png

Steve

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----