cancel
Showing results for 
Search instead for 
Did you mean: 

Wrap long text fields in Personas

Former Member
0 Kudos

Hi - do we do we get text to wrap into text sites on Personas...

Thanks.

Patrick.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Patrick,

Here is my example - show a table results in a text box:

You can make a simple a long string among which insert "/n" to make wrapping. Or even, make a do_wrap function in JS can call it. Then put the value into a high text box. It will do.

Hope this helps.

Dong Zhu

Former Member
0 Kudos

Thanks Dong - very helpful.

Al the best.

Patrick

nmkarthikeya
Active Participant
0 Kudos

Hi Patrick,

I am not sure whether you will be able to do it using text box but it can be achieved using label.

In label you have WrapText check box, check it and set the width and height of your label(if you keep NaN it will keep on expanding).

Please try and let know if it works for you.

Regards,

Karthikeya

Former Member
0 Kudos

Thanks Karthikeya, I appreciate the feedback.


I have two similar but different requirements:


i) Display long text with no option to update it. For this the label idea works well in terms of text wrapping but it has a vertical alignment of centre which is not ideal as you end up seeing a section from the middle of the text rather than the first paragraph. I don't want to appoint a large area of the screen to this as the majority of the texts are relatively short - it will only be the exceptions that are long and push the boundaries of the box.


ii) I want to display a long text field AND offer he possibility of changing it. For this the label idea does not work as it is by nature a read only field.

Hmmm... are there any other ways to look at this?

Regards.

Patrick.




nmkarthikeya
Active Participant
0 Kudos

For the first point, you can have 2 labels say label1 and label2 put one on another.

Select WrapText only for one label say label1.

If the text is short then print on label2, if its long and needs to be wrapped then print on label1.

You can find length in script using java script.

Hope this makes sense to you.

Regards,

Karthikeya

P.S: For the second one I don't think you have any option to make it wrap-able and editable at the same time.

Former Member
0 Kudos

Once again many thanks for taking the time to respond Karthikeya but I don't think this is the answer for me.

On point one, the text will always have to wrap, but not all of them will be long enough to be come confused by appearing as vertically aligned on the centre.

On the second point it is important that I can wrap and edit.

Tricky - maybe this will require some lateral thinking but at the moment this doesn't work satisfactorily ... maybe someone else has some thoughts.

Thanks.

Patrick.

manukapur
Active Participant
0 Kudos

Use javascript to warp the 2nd text and editing and non editing can be controlled by the control properties. This needs to be set one time.

Regards,

Manu

Former Member
0 Kudos

Hi Manu - thanks for the reply ... sounds promising but I can't see how I would use JS in this context.

I've only just started using JS so forgive me if I appear dim but the examples I can see on the web are directly mixing JS code with HTML. In a Personas environment, I don't believe we deal with the HTML first hand so I can't quite see how to make this work.

Can you say a few more words and perhaps be a little more proscriptive.

Regards.

Patrick.

manukapur
Active Participant
0 Kudos

Hi Patrick,

Apologies!!!

I wrote a Javascript function to do this but unfortunately the TextBox is not allowing multiple lines in Personas.

If you screen has a TextEditor which comes from the basic view, wrapping can be done on it.

Unfortunately we cannot create a TextEditor control onto a flavor.

Probably we can discuss more on your scenario.

Regards,

Manu

Former Member
0 Kudos

Hi Manu, Thanks for your time. I eventually got around this by using your idea of a custom t-code using fields with standard SAP defitions (so a sales test box in this case) rather personas texts and labels - it seems a bit more robust now.

All the best.

Patrick.