Dynamic change of static text widget value.

Avatar

Avatar

abhilash1289-TP

Avatar

abhilash1289-TP

abhilash1289-TP

16-10-2018

I am working on a requirement where I need to change the static text value depends on other form field inputs. I wrote below script in value commit event of a text field to modify static text widget value.

mySampleText.value= "Updated Text";

or

guideBridge.resolveNode("mySampleText").value = "Updated Text";

both scripts or working when both text box and static text are present under the same panel. However the static text is not getting updated if it is present in different panel. I Have noticed that the static text field widget value is changing only on 2nd value commit event of  TextBox ( Both widgets are in different panels ) ! This behavior is not consistent.

My scenario is to display multiple panel fields data as formatted paragraph text in last panel (i.e Signature) as attestation information. Please suggest an approach to update the static text field value to address requirement.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Mayank_Gandhi

Employee

Avatar

Mayank_Gandhi

Employee

Mayank_Gandhi
Employee

16-10-2018

Scott,

Cannot say at the moment as I have tested this on different machines and it works. I would like to have a look at Abhilash's form here.

Answers (6)

Answers (6)

Avatar

Avatar

Mayank_Gandhi

Employee

Avatar

Mayank_Gandhi

Employee

Mayank_Gandhi
Employee

17-10-2018

Sharing it across the wider audience, Adaptive form does not support setting value for static Text by scripting.

In such a case, the developer can  take two routes:

1.  Use a textbox instead, and using the style layer and change its appearance to be borderless.

2. First, focus the static Field that is in another Panel and then call the set value.

     guideBridge.setFocus(staticText2.somExpression); // Static text in different panel

     guideBridge.resolveNode("staticText2").value =this.value;

     staticText1.value=this.value;

     guideBridge.setFocus(this);

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

16-10-2018

Perfect - we closed this thread as the community member was asked to work directly with mayank.

Avatar

Avatar

Mayank_Gandhi

Employee

Avatar

Mayank_Gandhi

Employee

Mayank_Gandhi
Employee

16-10-2018

Can you download the form and share it over. You can inbox me directly.

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

16-10-2018

Avatar

Avatar

abhilash1289-TP

Avatar

abhilash1289-TP

abhilash1289-TP

16-10-2018

I am using Adobe Experience Manager (6.3.2.1) and its not working. Static text Value is not getting changed for the first value commit event

Avatar

Avatar

Mayank_Gandhi

Employee

Avatar

Mayank_Gandhi

Employee

Mayank_Gandhi
Employee

16-10-2018

Abhilash,

Just tested this on 6.3.3 and it seems to be working.

Please use guideBridge.resolveNode("field").value = "sample Text";