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: label attribute not working

See original GitHub issue

1) Environment

  • PrimeFaces version: 7.0.0
  • Application server + version: JBoss EAP 7.1.1
  • Affected browsers: IE11, Chrome 75

2) Expected behavior

The label of the selectonemenu is “Hello World”

3) Actual behavior

The label is the itemLabel of the selected entry.

4) Steps to reproduce

Just run the xhtml.

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:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title></title>
        
    </h:head>
    <h:body>
		<p:selectOneMenu label="Hello World">
			<f:selectItem itemValue="YELLOW" itemLabel="Yellow" />
			<f:selectItem itemValue="BLUE" itemLabel="Blue" />
			<f:selectItem itemValue="RED" itemLabel="Red" />
		</p:selectOneMenu>
    </h:body>
</html>

6) Sample bean

None

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
tandraschkocommented, Sep 5, 2019

If thats ok for you, i would be a happy to apply a PR again, which considers this option and also a docu update of course

1reaction
Eeholcommented, Jun 21, 2019

Yes why not, I’ll give it a try

Read more comments on GitHub >

github_iconTop Results From Across the Web

SelectOneMenu label is "covered" - jsf - Stack Overflow
Actually it's not working when the url is not matching the page. Solution : concat view id with "?faces-redirect=true" in action attribute of...
Read more >
SelectOneMenu - PrimeFaces Showcase
SelectOneMenu is used to choose a single item from a list. ... class="field col-12 md:col-4"> <p:outputLabel value="Label"/> <p:selectOneMenu id="labeled" ...
Read more >
SelectOneMenu output display problem - JBoss.org
Hi all, I'm facing a problem with selectOneMenu when populating it with a list. in my xhtml page i have the following code....
Read more >
primefaces - issue #7845 - Google Code
CSV selectonemenu not updating label with error style ... Because the ID added to the FOR attribute in the HTML code corresponds to...
Read more >
Using the f:selectItem and f:selectItems Tags
The itemValue attribute represents the default value for the selectItem tag. The itemLabel attribute represents the String that appears in the drop-down menu ......
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