Expand my Community achievements bar.

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

Locking a text object

Avatar

Level 3

Is there a way to lock a text box say at the bottom of the page and still have the page flowable with the other objects.  I'm trying to have a dynamic txt box (its not static so I can't place it on the master page, or can I?) stay at the top and bottom of all pages.  This text is controlled by a drop down at the beginning of the form.  What can I do?  Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Yes, you can place the textfield on the Master Page and still access/set its rawValue from the design pages.

Because you have a flowed layout, I would recommend that you move the bottom content edge up on the Master Page, so that the textfield is below the content area.

When accessing an object on the Master Page you need to resolve the node, typically:

xfa.resolveNode("#pageSet.Page1.TextField1").rawValue = DropDown1.rawValue; 

There is a trick in LC Designer where you can press and hold Control when you click on an object, to insert a reference into the script:

  1. Select the object that you want to write a script in one of its events.
  2. Scroll to the object that you want to reference, but do not select it.
  3. Click in the script editor (object in step 1 should still be selected.
  4. Hover your mouse over the object that you want to reference and press Control. The mouse will change to a 'V'.
  5. While holding Control, click on the object that you want to reference.
  6. LC Designer will insert the reference for that object right into the script editor where you are writing your script.
  7. The reference will be as full as is needed.

Hope that helps,

Niall

View solution in original post

4 Replies

Avatar

Correct answer by
Level 10

Hi,

Yes, you can place the textfield on the Master Page and still access/set its rawValue from the design pages.

Because you have a flowed layout, I would recommend that you move the bottom content edge up on the Master Page, so that the textfield is below the content area.

When accessing an object on the Master Page you need to resolve the node, typically:

xfa.resolveNode("#pageSet.Page1.TextField1").rawValue = DropDown1.rawValue; 

There is a trick in LC Designer where you can press and hold Control when you click on an object, to insert a reference into the script:

  1. Select the object that you want to write a script in one of its events.
  2. Scroll to the object that you want to reference, but do not select it.
  3. Click in the script editor (object in step 1 should still be selected.
  4. Hover your mouse over the object that you want to reference and press Control. The mouse will change to a 'V'.
  5. While holding Control, click on the object that you want to reference.
  6. LC Designer will insert the reference for that object right into the script editor where you are writing your script.
  7. The reference will be as full as is needed.

Hope that helps,

Niall

Avatar

Level 3

Perfect, thanks so much!!  This will make things so much simpler now.

Avatar

Level 3

wait I just noticed that the drop down only works on the first page.  How would I make it so the drop down selection changes the header and footer on all pages??  And one more question...sorry, what about a radio button of yes and no.  If yes were to be clicked then the header and footer changes.  So basically if yes is clicked from the RB list then the drop down is not used but if the RB list is no then the drop down would be used.

Avatar

Level 10

Hi,

If the dropdown is on the Master Page, then select it and in the Object > Binding palette change the binding to global. This was whatever is selected, will automatically appear on all pages.

Not sure what you are after with the radio buttons. You can change the presence of an object depending on which radio button is clicked. The trick is to place the script in the click event of the radio button exclusion group. You would also need to check the specified values of the radio buttons, in the Object > Binding palette. Let's say Yes=1

if (this.rawValue == 1)

{

     dropdown1.presence = "invisible";

}

else

{

     dropdown1.presence = "visible";

}

You would need to change the object references to suit your form.

Niall