cancel
Showing results for 
Search instead for 
Did you mean: 

Text/Caption in Web Dyn Pro? (Newline possible?)

Former Member
0 Kudos

Is it possible to add a new line for text in caption in web dyn pro?

In Java, I tried storing the string as "Result.\nPass" but it seems when being displayed, the new line is not shown but it is only shown in one whole line.

Any advise?

Accepted Solutions (1)

Accepted Solutions (1)

former_member185086
Active Contributor
0 Kudos

Hi Jack

Use TextView UI Element for text/Caption ,now things will work.

wdContext.currentContextElement().setLabel("\n"+"Kumar"+"\n"+"satish"+"\n"+"abc");

We can achieve the solution from LayoutData, but it will make things complicated.

Best Regards

Satish Kumar

Former Member
0 Kudos

Thanks!! That is what I am looking for

May I know your usage of setLabel? What label is being set when you refer to "currentContextElement()" ?

former_member185086
Active Contributor
0 Kudos

Hi

Good problem is solved.

Your question usage of setLabel? What label is being set when you refer to "currentContextElement()" ?

1Actually for your concern I did one test in my NWDS ,Its a wrong naming convention thats why u confused.

(instead of label i have to use say InputCaption because label is standard used by framework or its common )

2. I have created one context attribute named label and one UI of TextView ,associated its value property to

this context.

and accessed this through currentContextElement()

Best Regards

Satish Kumar

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi ,

Use String buffer to add it in a new line.

StringBuffer sb = new StringBuffer();

stringBuffer.append("Result");

stringBuffer.append("\n");

stringBuffer.append("Pass");

Regards,

Lavanya.G

Former Member
0 Kudos

hi

you can write the text spitting in to two line and concatenate operator as

text in online with ' + ' and continue in the next line . or you can even use ' /n '