SelectOneMenu: itemEscaped doesn't work anymore for selected items
See original GitHub issue1) Environment
PrimeFaces version: 11.0.7. ELITE Application server + version: Tomcat 9.0.45 Affected browsers: Chrome, Firefox, …
2) Expected behavior
A selected selectItem with reseverd HTML chars should be displayed, formatted, not escaped.
3) Actual behavior
Some reseverd HTML characters of a selected selectItem are shown escaped. - Regardless of selectitems ‘escape’ property settigns.
4) Steps to reproduce
Use attached testcase / webapp “pf11quot.zip” (or following xhtml page) and select Items with up / down arrows…
5) Sample XHTML
<?xml version = "1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>PrimeFaces Test</title>
</h:head>
<h:body>
<h:form id="contentForm">
<p:selectOneMenu>
<f:selectItem itemLabel="> greater fails" />
<f:selectItem itemLabel="> although escape = false" escape="false"/>
<f:selectItem itemLabel="< less fails" />
<f:selectItem itemLabel="& Ampersand fails" />
<f:selectItem itemLabel=""Quoting works"" />
</p:selectOneMenu>
</h:form>
</h:body>
</html>
Issue Analytics
- State:
- Created a year ago
- Comments:15 (10 by maintainers)
Top Results From Across the Web
SelectOneMenu: Selection of not escaped SelectItem shows ...
When selecting an item inside a p:selectOneMenu component with a label containing html, the html is escaped, but it shouldn't. Environment: PF ...
Read more >Populate p:selectOneMenu based on another ... - Stack Overflow
Whilst your initial solution works, it's in fact inefficient. ... of updating the state menu, when an item (country) is selected in the...
Read more >p:selectOneMenu doesn't work with f:selectItems
It works! One more thing, I was getting a NPE if using the following tag to show the empty item: Code: Select all...
Read more >s:convertEntity in h:selectOneMenu produces ind... - JBoss.org
Hello, I have a rarer case of using a dropdown box for navigation. I want to switch seasons on certain pages, so this...
Read more >SelectOneMenu keeps on retrieving my previous value selected.
My problem is when I load again the JSF page and retrieve the values again from my database, the default value on my...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We have an integrationtest for something very similar:
https://github.com/primefaces/primefaces/blob/master/primefaces-integration-tests/src/main/java/org/primefaces/integrationtests/selectonemenu/SelectOneMenu002.java, https://github.com/primefaces/primefaces/blob/master/primefaces-integration-tests/src/test/java/org/primefaces/integrationtests/selectonemenu/SelectOneMenu002Test.java
At least it’s not totally broken.
ah yes that is definitely wrong. It is
itemEscaped
. I guess that is why it has caused confusion!