Expand my Community achievements bar.

Change text of Text object (not TextField)

Avatar

Former Community Member
I'm trying to change the text of a Text object (not a TextField). I've tried
textObjectName.rawValue = "new text" and that seems to change it in the underlying model, but the changes don't get reflected on the screen. I've tried calling xfa.layout.relayout() to no effect as well.



Any help would be appreicated.
3 Replies

Avatar

Former Community Member
I don't believe you can change the text of a static object at runtime - you could either use a text field with no border, or if you want to change the text to one of a number of choices, create a flowed subform, add a subform for each text option, and put a text node in it, and then from script change the visibility of these subforms so the one you want to see is visible.



Does this work for you? If not can you say what it is you're trying to do?



--

SteveX

Adobe Systems

Avatar

Former Community Member
stevex@adobeforums.com wrote:

> I don't believe you can change the text of a static object at runtime - you could either use a text field with no border, or if you want to change the text to one of a number of choices, create a flowed subform, add a subform for each text option, and put a text node in it, and then from script change the visibility of these subforms so the one you want to see is visible.

>

> Does this work for you? If not can you say what it is you're trying to do?

>

> --

> SteveX

> Adobe Systems



The other option is to use a floating field. You can then change the

data that the field is bound to and remerge. Here's a code snippet:



this.parent.floatingfield1.dataNode.value = "New Static Text Value";

xfa.form.remerge();



Justin Klei

Cardinal Solutions Group

www.cardinalsolutions.com