Problem with <p:selectOneMenu>

UI Components for JSF
Post Reply
burferd
Posts: 234
Joined: 01 May 2010, 16:15

22 Nov 2011, 03:32

Using PF 3.0-M4 / PF 3.0-RC1-Snapshot, Glassfish 3.3, Mojarra 2.1.3

I have a panel inside a composite component with 2 selectOneMenu components.
When I use <h:selectOneMenu> components, things work fine.
If I change the xhtml page code to use <p:selectOneMenu> components, the components to not work as expected.
The <f:selectItems> list gets filled with a bunch of random stuff that looks like page code - I get page text and other things from the page in the list.
This happens in both PF 3.0-M4 and PF 3.0-RC1-Snapshot (11/178/2011 version).

Here is the page code that works just fine:

Code: Select all

                    <h:selectOneMenu style="width: 310px;" value="#{customerProfileSessionBean.selectedAccountType}"
                                     valueChangeListener="#{customerProfileSessionBean.accountTypeValueChange}"  >
                        <f:selectItems value="#{customerProfileSessionBean.accountTypeList}"/>
                    </h:selectOneMenu>

                    <h:outputText value="Account Status: " />
                    <h:selectOneMenu style="width: 310px;" value="#{customerProfileSessionBean.selectedAccountStatus}"
                                     valueChangeListener="#{customerProfileSessionBean.accountStatusValueChange}" >
                        <f:selectItems value="#{customerProfileSessionBean.accountStatusList}"/>
                    </h:selectOneMenu>
 
Just changing from <h:selectOneMenu> to <p:selectOneMenu> causes the undesired behavior noted above.
Is there something I am missing?
Shouldn't the following work if the above code works?

Code: Select all

                    <p:selectOneMenu style="width: 310px;" value="#{customerProfileSessionBean.selectedAccountType}"
                                     valueChangeListener="#{customerProfileSessionBean.accountTypeValueChange}"  >
                        <f:selectItems value="#{customerProfileSessionBean.accountTypeList}"/>
                    </p:selectOneMenu>

                    <h:outputText value="Account Status: " />
                    <p:selectOneMenu style="width: 310px;" value="#{customerProfileSessionBean.selectedAccountStatus}"
                                     valueChangeListener="#{customerProfileSessionBean.accountStatusValueChange}" >
                        <f:selectItems value="#{customerProfileSessionBean.accountStatusList}"/>
                    </p:selectOneMenu>
Can anyone explain where I am going wrong in the last code snippet - or is this a known issue with PF 3.0?
I did not find any references to this by doing a search for selectOneMenu in the forum.

I can provide the code I use to fill the <f:selectItems> lists if that would be helpful.

Let me know if I am doing something wrong here.

Thanks.
Using PrimeFaces 3.4, Mojarra 2.1.6, Glassfish 3.1.2, NetBerans 7.2, Hibernate 3.2.5 (sometimes)
Windows 7.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 62 guests