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
BedrockMission!

Learn More

View all

Sign in to view all badges

How to hide dynamic table row based on cell2 data

Avatar

Avatar
Validate 1
Level 1
Manqoba
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
Manqoba
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
Manqoba
Level 1

02-04-2020

Hi,

I'm trying to hide a row inside a dynamic table if data in cell2 has "Old Statement".

 

If cell2 has the name "Old Statement". Hide that whole row.

 

My code only hides the 1st row.

if (statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry.Cell2.rawValue == "Old Statement")
{
statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry.presence = "hidden";
}
else
{
statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry.presence = "visible";
}

 

Manqoba_0-1585853144696.png

 

I'm new to Livecycle designer and would really appreciate the help. 

 

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,682 posts

Correct Reply

489 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,682 posts

Correct Reply

489 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

03-04-2020

If you put the following code into the calculate event of rwStatementEntry, it should work.

 

 

this.presence = Cell2.rawValue === "Old Statement" ? "hidden" : "visible";

 

Manqoba
Hi @radzmar. The code is giving me syntax errors. "Error: syntax error near token '=' on line 2, column 34."
radzmar
Make sure you've selected JavaScript not FormCalc as language.
Manqoba
It's working. Thank you very much
Manqoba

Hi @radzmar, after doing the hidding. I'm now struggling with sorting the same table by date descending.

var Cell1Array = new Array();
var Cell2Array = new Array();
var Cell3Array = new Array();
var Cell4Array = new Array();
var Cell5Array = new Array();
var Cell6Array = new Array();

 

var rowIM = xfa.resolveNode("statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry").instanceManager;

 

for (var i=0; i < rowIM.count; i++) 

{

var Cell1 = xfa.resolveNode("statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry[" + i + "].Cell1").rawValue; Cell1Array.push(Cell1);

var Cell2 = xfa.resolveNode("statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry[" + i + "].Cell2").rawValue; Cell2Array.push(Cell2);

var Cell3 = xfa.resolveNode("statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry[" + i + "].Cell3").rawValue; Cell3Array.push(Cell3);

var Cell4 = xfa.resolveNode("statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry[" + i + "].Cell4").rawValue; Cell4Array.push(Cell4);

var Cell5 = xfa.resolveNode("statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry[" + i + "].Cell5").rawValue; Cell5Array.push(Cell5);

var Cell6 = xfa.resolveNode("statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry[" + i + "].Cell6").rawValue; Cell6Array.push(Cell6);

}

Cell1Array.sort();

Cell2Array.sort();

Cell3Array.sort();

Cell4Array.sort();

Cell5Array.sort();

Cell6Array.sort();

 

for (var i=0; i < rowIM.count; i++)

{

xfa.resolveNode("statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry[" + i + "].Cell1").rawValue = Cell1Array[i]; xfa.resolveNode("statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry[" + i + "].Cell2").rawValue = Cell2Array[i]; xfa.resolveNode("statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry[" + i + "].Cell3").rawValue = Cell3Array[i]; xfa.resolveNode("statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry[" + i + "].Cell4").rawValue = Cell4Array[i]; xfa.resolveNode("statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry[" + i + "].Cell5").rawValue = Cell5Array[i]; xfa.resolveNode("statementForm.sfStatementForm.sfStatementSummary.sfStatementEntries.tblstatementEntry.rwStatementEntry[" + i + "].Cell6").rawValue = Cell6Array[i];

}

Answers (0)