Expand my Community achievements bar.

What could be wrong with this resolveNodes / for script?

Avatar

Level 1

Hello, I am stumped and would greatly appreciate some help here.

I have a table that has the ability to add additional rows.

Each row includes a "delete" button to clear the row.

I'd like to hide the "delete" button when another button is clicked.

There are a variable amount of rows at any given time, so I can't target the button directly.

I have used the "for" method before, but it doesn't seem to be able to find the nodes in this case.

My hierarchy looks like this:

    

form1

- productSubform

- - productJobTable

- - - productJobRow

- - - - deleteBtn

my Javascript looks like this:

var nodes = form1.productSubform.productJobTable.resolveNodes("productJobRow[*]");

var len = nodes.length;

for(var i = 0; i < len; i++) {

        nodes.item(i).deleteBtn.presence = "invisible";

}

Can anyone see what could be wrong here?

Thank you in advance.

1 Reply

Avatar

Level 7

This code worked for me...

  var rows = form1.p1.Table1.resolveNodes("Row1[*]");

  var len = rows.length;

  for (var i=0; i<len; i++) rows.item(i).Button1.presence = "invisible";

When I used nodes as the variable name, I got this error: "Invalid property set operation."