A patch for a minor problem in PopulateHelper

已查看 13 次
跳至第一个未读帖子

Thomas Hallgren

未读,
2012年3月27日 12:00:192012/3/27
收件人 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

未读,
2012年3月29日 17:30:092012/3/29
收件人 web4j...@googlegroups.com
Thank you!  Will apply to next release.

- John
回复全部
回复作者
转发
0 个新帖子