In PrimeFaces’ SelectOneMenu, I use options (often placeholders) like <please select>
, loaded from controller via f:selectItems and escaped automatically by the SelectOneMenu component. After updating PrimeFaces 11 to version 12, the component started to double-escape the characters <
, >
, &
in its label, while the option list is still rendered as expected. (When I click <please select>
, the label shows <please select>
.)
I tried all combinations of these settings:
"true"
/"false"
"true"
/"false"
The attribute itemLabelEscaped has no effect. Other combinations work as follows:
No. | SelectItem.escape | SelectItem.label | Option in dropdown | Shown label in PF 11 | Shown label in PF 12 |
---|---|---|---|---|---|
1 | false | < <i>italics</i> |
< italics | italics | italics |
2 | false | < <i>italics</i> |
< <i>italics</i> | < italics | < <i>italics</i> |
3 | true | < <i>italics</i> |
< <i>italics</i> | < <i>italics</i> | < <i>italics</i> |
4 | true | < <i>italics</i> |
< <i>italics</i> | < <i>italics</i> | (even more escaped) |
In PrimeFaces 11, I used the setting No. 3, and the label was the same as the option in dropdown. After the update, the label gets broken and the only working setting seems to be No. 2, but I don’t want to update all occurrences of selectItems unless necessary.
As I did not find any relevant info in PrimeFaces’ release notes, I would consider it a bug, but I wonder nobody has reported it yet, so I’m not sure: is it a bug, or a feature? This old question seems to be relevant, but how come it worked in PrimeFaces 11?
This is a known and fixed issue. Until PrimeFaces 13 is released, you can MonkeyPatch the workaround.