Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Text object

Avatar

Level 6
Hi,



Is there anyway of setting the text of text objects at runtime?

Thank you
9 Replies

Avatar

Former Community Member
<Neptuno@adobeforums.com> ha scritto nel messaggio <br />news:3bbddac6.-1@webx.la2eafNXanI...<br />> Hi,<br />><br />> Is there anyway of setting the text of text objects at runtime?<br /><br />Do you mean the caption of the text field or the value in the text field?<br />In the second case, I'm quite sure that it is possible.<br /><br />Bye,<br />Alessio

Avatar

Level 6
I´m refering to the value of the text object (please, note that I´m not refering to text fields, but text objects).



I tried doing that with floating fields but it doesn´t work also. Is there any way of re-rendering the pdf?



Thank you

Avatar

Former Community Member
<Neptuno@adobeforums.com> ha scritto nel messaggio <br />news:3bbddac6.1@webx.la2eafNXanI...<br />> I´m refering to the value of the text object (please, note that I´m not <br />> refering to text fields, but text objects).<br />><br />> I tried doing that with floating fields but it doesn´t work also. Is there <br />> any way of re-rendering the pdf?<br />><br /><br />Floating fields are text fields objects that support the merging of text, <br />numeric values, run time properties and scripitng within a text object when <br />the form is rendered.<br />This means, I suppose, that you can use only the run time properties that <br />are in the "Insert menu".<br />I think that only these values can be changed at run time, other only after <br />other operations.<br /><br />Bye,<br />Alessio

Avatar

Former Community Member
Neptuno, the best way would be to use a text object that is set to read only and with no caption so that it appears to the user to be static text. You could then set the rawValue at run time.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
<Chris_Trubiani@adobeforums.com> ha scritto nel messaggio <br />news:3bbddac6.3@webx.la2eafNXanI...<br />> Neptuno, the best way would be to use a text object that is set to read <br />> only and with no caption so that it appears to the user to be static text. <br />> You could then set the rawValue at run time.<br />><br />> Chris<br />> Adobe Enterprise Developer Support<br /><br />Sorry Chris,<br />I'm probably missing something. How can I set to read only a text object? I <br />supposed It IS always a read only object for the users. And I can't set a <br />caption for the text object Neptuno is dealing with.<br />Also, I don't think it is possible to use script in a text object, isn't it?<br /><br />Thanks for answering,<br />Alessio

Avatar

Level 6
Hi,

I think chris was talking about a text field (not a text object). The problem is that I need the text at design time too, because someone will have to create/design the pdf. However, in that design, I should be able to insert some flag I could update at run time. For instance, think on a contract. Somewhere between the text you will have to insert at runtime specific data. At the same time you shouldn´t let empty spaces between the new data and the text... If you insert a text field between text object, than you will have a big problem replacing the fields (to enlarge or shrink). But... if you use a text object... if you could replace some previous create flag (with the same dimension as the input filed), the text should enlarge or shrink properly. In a previous version (accelio version), this was very easy to accomplish. Text was really text, and it was formatted with spaces and stuff like that.

But now, in a text object, text (when it as spaces, or differente fonts) is a set of xml objects.... so it is more difficult to find and replace something.

I realize that it is possible to change the text of text objects like this:

this.resolveNode("caption.value.#text").value (a caption or simple text is the same)

However, with complex text (text object with paragraphs, different fonts, etc...), we don´t have a value/text xml object but a exData/body/p/... object.. sight!

My question is: How can I get the text of each object ("p" object in xml)?
Everytime I make something like this:

alert(test.resolveNode("value.#exData").value)
or
teste.resolveNode("value.exData.body").value)
or
teste.resolveNode("value.exData.body.#p").value)
or
teste.resolveNode("value.exData.body.p").value)
or
teste.resolveNode("value.exData.body.p(3)").value)

I never get nothing...

I think the resolution of this functionality is important because I´m sure there is a lot of forms of this kind that pdf should contemplate.

Thank you.

My test object (just the "value" node):












Identification of ________,


Identification of ________,


Created the contrat with these general clauses:




Avatar

Former Community Member
Sorry, that was a type-o I was refering to text fields.



Ok, how about using floating fields and using script along these lines:



TextField.rawValue = "some value";

xfa.layout.relayout();



Where TextField is the floating field.



I wasn't clear on what your trouble with floating fields was. Was it just the need to "refresh" the form?



Chris

Adobe Enterprise Developer Support

Avatar

Level 6
Chris,



With the relayout method I can now see the new value in the floating field, thank you.



There is still one problem because the difference between the size of a floating field and of the field object I nedd over it, but I think I can solve this problem controlling the size of the name of the floating field. I think there isn´t any other way of doing this?



Thank you

Avatar

Former Community Member
Is it possible to make floating field as Editable?