cancel
Showing results for 
Search instead for 
Did you mean: 

How to Use & (Ampersand) in Text

BuckeyeScott
Explorer
0 Kudos

I have a TextView object in a Web Dynpro Java program that contains text which includes the ampersand (&) character.  However, the ampersand is converted to '&' when my text is displayed.

How do I get just the ampersand (&) to display in my text?

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

where you get the text?

have you tried to debug your code?

BuckeyeScott
Explorer
0 Kudos

Here is a screen picture illustrating my issue ...

junwu
Active Contributor
0 Kudos

how about the runtime?

Former Member
0 Kudos

Hi Scott,

I would suggest that you perform the following steps:

1. Create new String attribute in your Context.

2. Bind the text field in which you want to add the simbol to the newly created attribute.

3. Set the String attribute to the desired text in your wdDoInit method.

I hope that this helps.

Best regards,

Grigor Nikolov

Former Member
0 Kudos

Scott, the "&" you see only at design time, but at run time there is a plain ampersand character in text, isn't it? And is there a problem?

Answers (1)

Answers (1)

amolgupta
Active Contributor
0 Kudos

hi Scott,

I think it will be easier to replace your '&' with 'and' ! else you will have to link the text with a context attribute and populate the context attribute with the requisite string in wdDoInit() method and as Sergei rightly pointed above, this problem does not happen at run time.

Text & Text - at design time


Text & Text - looks perfectly as it is supposed to be at run time.

Thanks and Regards,

-Amol Gupta