rasyahadlinugraha / wiquery

Automatically exported from code.google.com/p/wiquery
MIT License
0 stars 0 forks source link

Button - Javascript escape label #177

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If Button label contains single quote, button won't be rendered. Need to escape 
label:

new ButtonBehavior().setLabel(new 
ResourceModel("buttonLabel")).setIcons(UiIcon.MAIL_OPEN, null);

---
buttonLabel = Button's label

Original issue reported on code.google.com by cedric.t...@gmail.com on 17 Apr 2011 at 12:36

GoogleCodeExporter commented 9 years ago
Hi,

We use the choice to insert literal with quotes. Even with double quotes, we 
will have the problem (and we can't know when we have to escape them). So, you 
can escape the quotes into your properties files, or you can override the 
getObject method of the resourceModel and use the "escapeQuotes" from JsUtils 
(see 
http://code.google.com/p/wiquery/source/browse/trunk/src/main/java/org/odlabs/wi
query/core/javascript/JsUtils.java)

Regards

Julien Roche

Original comment by roche....@gmail.com on 17 Apr 2011 at 9:27

GoogleCodeExporter commented 9 years ago

Original comment by hielke.hoeve on 10 May 2011 at 2:48