cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic binding of datasource in Adobe Forms

Former Member
0 Kudos

Hi folks,

I will dynamically bind a Include-Text element in Adobe Forms via JavaScript.

If I do it over this.rawValue the text is showig as follow: "Textline1Textline2Textline3" it should be

"Textline1

Textline2

Textline3"; respecting the formating rules.

If I directly bind this text element to the include-text, it works fine but via scripting not.

My coding at the moment (JavaScript):

var text = xfa.resolveNode("xfa.record.ITEM.TEXTS[*].TLINE_POS" + i ).value;

this.TLINE_POS.rawValue = text;

What's wrong ?

if you will have further questions ==> just ask.

Thanks for your help.

Best

Markus

Accepted Solutions (1)

Accepted Solutions (1)

pavan_prabhu
Active Participant
0 Kudos

Hello Markus,

You can try as below but it will be tedious. Your code might change for different formatting types.

     When you are saving the standard text in SO10 or Text module using formatting, the direct binding of Include Text in Adobe form will place the carriage return by the framework where ever required according to the way you had formatted before. But In Java script you have to do it manually because the commands which you enter while formatting the standard text are omitted since it is converted to plain text.

So you have to insert a carriage return explicitly on each row. The ASCII representation of carriage returns (CODE 13). JavaScript has a handy feature called String.fromCharCode() which generates the string version of an ASCII code, or multiple codes separate by a comma.

You can do as below.

var text = xfa.resolveNode("xfa.record.ITEM.TEXTS[*].TLINE_POS" + i ).value + String.fromCharCode(13);


this.TLINE_POS.rawValue = text;

Alternative Solution: If you want to dynamically bind the text element in Adobe Layout, then you can call the Function Module READ_TEXT in the Form Interface and retrieve the text table containing text lines by passing the text name. Then send this table to context node of the Adobe Layout. Then in the Context node of Adobe, you can create a Text of type dynamic text and give the name of this internal table in the field value. Then use this dynamic text in your layout wherever required. This way, the commands entered during formatting the text element are still retained.

Answers (0)