cancel
Showing results for 
Search instead for 
Did you mean: 

Breakline in TextField in Interactive Forms

Former Member
0 Kudos
100

Im using TextEdit in dynpro to write som text. Here is it possible to use linebreak in the text to the next text can come on the next line. I have binded this textedit with a context.. The problem is when im using interactive forms and TextField to view the text that is written in a textedit, the linebreaks gets replaced by 1 space " ".

Example

TextEdit

My name is:

Kristoffer

Will be presented like this in a TextView

My name is: Kristoffer

Someone got any suggestion? I have allowed multiple lines on the textfield..

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kris,

This should be possible in ur TextField element in the interactive forms and not in ur text element.

1)create a TextField.Drag and drop it in ur Body page.

2)GoTo the objects tab-->Allow Multiple lines.

3)Now switch on to ur PDFSource tab and give ur details in the order u want by pressing the Enter key.

This automatically scrolls down with ur text.

If u use a Text element then i m afraid that u cannot use multiple lines.

Hope this helps u,

Regards,

Nagarajan.

Former Member
0 Kudos

Hi again

You mean the XMLSource tab? I cant find any PDFSource tab. But I dont know in wich order I want the linebreaks. The linebreaks is defined in the TextEdit and there binded in the context. The TextField is binded to the same context.

Former Member
0 Kudos

kris,

In interactive forms u can just click on the context that u have created in the webdynpro view and drop it inside the body page.Then the properties of this couold be altered using the Objects tab in the right hand side of urs.In interactive forms U can give details only at the runtime.U cannot bind value to this in the int.forms.

If my understanding is correct and u want this to happen in the webdynpro view at the run time then u can give the Property wrapping to true for the textview and set the layout to row layout.

Regards,

Nagarajan.

Former Member
0 Kudos

Thanx, i know a little more about the problem now. The problem isnt TextEdit and TextField... It seems like the context cant store linebreaks from TextField in interactive forms. Cause when i'm using Enter and creates linebreaks in the textfield.. (that is binded to a context) and then open the textfield again, the linebreaks are goone and replaced with spaces

Former Member
0 Kudos

Kris,

Thats good.Only this carries the data at the runtime and the context stores the data without linebreaks.If suppose u want this to appear as a linebreak, one option is that u can save the interactive form to the local machine.

finally if u open the form from the machine u can just c the data to be in the line breaks as u gave at the run time.

This is just for a look.

Regards,

Nagarajan.

Former Member
0 Kudos

yes, but its something really wierd. If I set a linebreak in the textfield on the interactive form, and then open a TextEdit in webdynpro that is binded on the same context, the linebreaks appears. But if I then go back to the interactive form, the linebreak is replaced with a space. The same happend if i set a linebreak in the textfield on the interactive form, close form, and open it again, the linebreak is replaced with a space.. strange

Former Member
0 Kudos

Yes Kris,

Finally we have no other option on it.Looks vague butthis is what the context does.Unfortunately we don't have a wrapper in the text element in the forms.

Before closing the form just save the form.That should be the better optoin indeed for getting the results as we need.

Thx,

Nagarajan.

Former Member
0 Kudos

But one thing i forgot to mention that could have something to do with this is that i have to enable the obtion "Allow plain text only" on the textfield in the interactive form. If not i get the error message "Node cannot be inserted where requested" when im going back to the dynpro view

Answers (1)

Answers (1)

Former Member
0 Kudos

If you put "\n" or "\r\n" inside a string, the Web Dynpro TextView element will render a line break (<br> in HTML).

This works since NW04 SP13(?). Which SP are you using?

Armin

P.S: Or do you refer to some Adobe "TextField" element?

Former Member
0 Kudos

Im using NW13

so when a user write some text in a textedit, i should replace the linebreaks with \n ? cause i tried to just write some text with \n, but then it just typed \n in the text field in my interactive form

Former Member
0 Kudos

I have no clue about the Adobe elements, my remarks refer to the Web Dynpro Standard library element "TextView".

Armin

Former Member
0 Kudos

Okay, cause i use Web Dynpro Standard "TextView" and "TextField" from the standard of interactive forms, wich replace all the linebreaks with spaces.

if you got any tips, let me know.

but thanx for your help:)

Former Member
0 Kudos

--snip

If you put "\n" or "\r\n" inside a string, the Web Dynpro TextView element will render a line break (<br> in HTML).

--snip

Can anybody confirm this? I'm running SP14, but those escape characters are just causing a line break in the source code, which is useless. What do I have to do in order to force the TextView to do a visible line break?

Thanks for any answer.

Andreas

Former Member
0 Kudos

Hey Andreas

No, its no use putting \n <br> or any other code inside a string. And that goes for all the SP, as far as I know.

What you have to do is to set the textfield in your interactive form to accept several lines.. and then go in the XML for the form and set access="nonInteractive" on the textfield element.

Hope this will solve your problem

Former Member
0 Kudos

Hi Kristoffer

Thank you for your quick answer. My question was not about interactive forms but the basic GUI-elements of WebDynpro. Armin was referencing to those as well as far as I can consider. Sorry if this has been unclear.

Andreas