Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Labeling a SelectOneMenu

BlueSkyNov 22 2015 — edited Nov 25 2015

In ADF I'm trying to use JSF's SelectOneMenu (please don't ask why), but I can't seem to label it easily.

This code does not show the label "MyTitle" in front of the SelectOneMenu.

<h:selectOneMenu id="sfqcd6" label="MyTitle"

                value="#{dashboardBean.titleoper}"

                 binding="#{dashboardBean.titleoperValue}">

         <f:selectItems value="#{dashboardBean.operTextList} id="srbd6z"/>

</h:selectOneMenu>

This code does show "MyTitle", but I'd rather not have to an an OutputLabel component just to get a label.

<h:outputLabel id="usernameLabel" for="sfqcd6"

               value="My Title"/>

<h:selectOneMenu id="sfqcd6"

                 value="#{dashboardBean.titleoper}"

                 binding="#{dashboardBean.titleoperValue}">

    <f:selectItems value="#{dashboardBean.operTextList}"

                   id="srbd6z"/>

</h:selectOneMenu>

The documentation says that SelectOneMenu should take a label parameter....https://docs.oracle.com/javaee/6/javaserverfaces/2.1/docs/vdldocs/facelets/h/selectOneMenu.html

In my ViewController project properties, under Libraries and Classpath, I see JSF 2.0 and JSTL 1.2., so I believe I am set up okay.

Thanks for your help,

Dale

This post has been answered by Timo Hahn on Nov 23 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 23 2015
Added on Nov 22 2015
4 comments
1,275 views