Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

resolveNodes to hide buttons in multiple rows

Avatar

Level 1

I have a calendar type form which has a table (wrapped in a subform) that contains a button on every row. I wish to hide these buttons with the click of another button.

The tables and rows repeat themselves many times and so I'm sure I need to use resolveNodes to target each row / button.

The hierarchy which the button is contained within is:

     form1

          monthForm

               monthTable

                    dayRow

                         deleteBtn


The hierarchy which the button that is executing the script is contained within is:

     form1

          grandTotalForm

               grandTotalsComplete

                    Button1

The following javascript doesn't seem to work. I have had this basic code work before in other applications, but I can't figure out where this is going wrong.

     form1.grandTotalForm.grandTotalsComplete.Button1::click - (JavaScript, client)

     var nodes = xfa.resolveNodes("form1.monthForm[*].monthTable.dayRow[*]");

     var len = nodes.length;

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

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

     }

Would anyone have an idea of what I'm doing wrong? Thank you in advance for any help.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi, I think the error is occuring because you are using the term "nodes" which is already a property in Livecycle javascript.

Try calling it theNodes

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi, I think the error is occuring because you are using the term "nodes" which is already a property in Livecycle javascript.

Try calling it theNodes

Avatar

Level 1

Brilliant. Thank you so much.