Expand my Community achievements bar.

SOLVED

XDP Form - Referencing fields within dynamic rows of a Table

Avatar

Level 4

I need JavaScript help with field referencing within a dynamically generated table row.

I have the following code which only triggers within the first row, which is the only row in the table prior to the user generating additional rows.

 

form1.Page1.SubChecklist.Table.Detail.ParaNum::ready:layout - (JavaScript, client)

 

if (this.DDLAlignment.rawValue == "No" || this.DDLPrompts.rawValue == "No" || this.DDLPunctuation.rawValue == "No" || this.DDLSpelling.rawValue == "No" || this.DDLWidow.rawValue == "No" || this.DDLProgram.rawValue == "No" || this.DDLIVData.rawValue == "No" || this.DDLNoPub.rawValue == "No"){
if (xfa.host.version <8) {
this.fontColor = "249, 11, 8";

}
else {
var CaptionColorBackup = this.resolveNode("$").caption.font.fill.color.value;
this.font.fill.color.value = "249, 11, 8";
this.caption.font.fill.color.value = CaptionColorBackup;

}
}

 

The above code works to change the ParaNum field value to red when there is any of the DDLs that have a value of "No".

 

But ONLY on the initial row. Not for any dynamically generated rows.

I asked about this in another post, however, it may not have been clear as to what I was attempting to do.

 

Please assist with the coding above, I am aware that instanceManager and dynamic rows changes the underlying row names, I just cannot figure out how to address it within the code above.

Thank you in advance...

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 4

This worked:

 

var rowCount = Table._Detail.count;
for (var i=0;i<rowCount;i++)
 
if (Table.Detail.all.item(i).DDLAlignment.rawValue == "No" || Table.Detail.all.item(i).DDLPrompts.rawValue == "No" || Table.Detail.all.item(i).DDLPunctuation.rawValue == "No" || Table.Detail.all.item(i).DDLSpelling.rawValue == "No" || Table.Detail.all.item(i).DDLWidow.rawValue == "No" || Table.Detail.all.item(i).DDLProgram.rawValue == "No" || Table.Detail.all.item(i).DDLIVData.rawValue == "No" || Table.Detail.all.item(i).DDLNoPub.rawValue == "No"){
if (xfa.host.version <8) {
  Table.Detail.all.item(i).ParaNum.fontColor = "249, 11, 8";
 
  }
  else {
  var CaptionColorBackup = this.resolveNode("$").caption.font.fill.color.value;
  Table.Detail.all.item(i).ParaNum.font.fill.color.value = "249, 11, 8";
  Table.Detail.all.item(i).ParaNum.caption.font.fill.color.value = CaptionColorBackup;
 
  }
}

 

View solution in original post

1 Reply

Avatar

Correct answer by
Level 4

This worked:

 

var rowCount = Table._Detail.count;
for (var i=0;i<rowCount;i++)
 
if (Table.Detail.all.item(i).DDLAlignment.rawValue == "No" || Table.Detail.all.item(i).DDLPrompts.rawValue == "No" || Table.Detail.all.item(i).DDLPunctuation.rawValue == "No" || Table.Detail.all.item(i).DDLSpelling.rawValue == "No" || Table.Detail.all.item(i).DDLWidow.rawValue == "No" || Table.Detail.all.item(i).DDLProgram.rawValue == "No" || Table.Detail.all.item(i).DDLIVData.rawValue == "No" || Table.Detail.all.item(i).DDLNoPub.rawValue == "No"){
if (xfa.host.version <8) {
  Table.Detail.all.item(i).ParaNum.fontColor = "249, 11, 8";
 
  }
  else {
  var CaptionColorBackup = this.resolveNode("$").caption.font.fill.color.value;
  Table.Detail.all.item(i).ParaNum.font.fill.color.value = "249, 11, 8";
  Table.Detail.all.item(i).ParaNum.caption.font.fill.color.value = CaptionColorBackup;
 
  }
}