A patch for a minor problem in PopulateHelper

13 views
Skip to first unread message

Thomas Hallgren

unread,
Mar 27, 2012, 12:00:19 PM3/27/12
to web4j-users
I tried to use w:populate on a select with values that contained
parenthesis. That didn't work as expected. I traced it down to a
missing quote where the value is treated as a regexp. Here's a patch
that fixes the problem:

web4j/src/hirondelle/web4j/ui/tag/PopulateHelper.java
@@ -448,7 +448,7 @@
fLogger.finest("Value attr: " + valueAttr);
if ( aPrepopValues.contains(valueAttr) ) {
String editedOption = ensureSelected(matchForSelected,
option);
- result = result.replaceAll(option, editedOption);
+ result = result.replaceAll(Pattern.quote(option),
editedOption);
}
else {
String editedOption = ensureUnselected(matchForSelected,
option);

John O'Hanley

unread,
Mar 29, 2012, 5:30:09 PM3/29/12
to web4j...@googlegroups.com
Thank you!  Will apply to next release.

- John
Reply all
Reply to author
Forward
0 new messages