Expand my Community achievements bar.

Dynamically change text contents of Text object - best practices? Suggestions?

Avatar

Former Community Member

Hi,

I have a Text object that I need to change the text contents of based on the value of another field. The text is large - a paragraph. There could potentially be up to 5 different paragraphs of text that would need to be 'attached' to the Text object. I don't see a 'text' or similar property for the Text object that I can set programatically but I'm very new to this and could be missing something.

I'd like to create each separate paragraph once, name it and save it so it can be accessed easily. Is using Fragments the answer? If so, is there an example someplace that could make this a little more clear?

Also, there will probably be 'bound' values that will need to be inserted into each paragraph - these values will come from a dynamic xml file that will 'back' the page template. Is this also possible with Fragments or with other techniques that allow me to 'off-load' large pieces of text off of the page itself?

I imagine I will have to use JavaScript to do the text 'attachment' at run time on a given event with the page is 'loaded'. Any suggestions as to which event is most useful for this?

Any help if greatly appreciated!

0 Replies