question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SelectOneMenu: itemEscaped doesn't work anymore for selected items

See original GitHub issue

1) 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. image

4) Steps to reproduce

Use attached testcase / webapp “pf11quot.zip” (or following xhtml page) and select Items with up / down arrows…

pf11quot.zip

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="&gt; greater fails" />
				<f:selectItem itemLabel="&gt; although escape = false"  escape="false"/>
				<f:selectItem itemLabel="&lt; less fails" />
				<f:selectItem itemLabel="&amp; Ampersand fails" />
				<f:selectItem itemLabel="&quot;Quoting works&quot;" />
			</p:selectOneMenu>
		</h:form>
	</h:body>
</html>

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

0reactions
mellowarecommented, Oct 4, 2022

ah yes that is definitely wrong. It is itemEscaped. I guess that is why it has caused confusion!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found