SelectOneMenu become empty when going back

UI Components for JSF
Post Reply
exallon
Posts: 2
Joined: 16 Apr 2014, 21:56

17 Apr 2014, 10:05

This menu will become filled when refreshing page. But if I go back via a commandLink. The menu will become empty. Not as in no value. It will shrink to no size. Using a SelectManyMenu or SelectOneListBox will fix the problem. The control will be rendered with the correct item preselected.

This can be found in both Primefaces 4.0 and 5.0 RC1. I can't get any error message or any other useful information.

Code: Select all

You can test the problem here:
http://megahooked.com:8080/BowlingFacelets/hcp/showTeam.xhtml

Fill out the parameters 
BK Strået
Div 2
1 april
30 april

Then click the command link.  On the next page. Click "Tillbaka"
Also this will print the correct info

Code: Select all

<h:outputText value="Klubb: #{serviceHCP.myCurrentClub}"></h:outputText>
Commandlink
This commandlink takes you back to the team page.

Code: Select all

<p:commandLink value="Tillbaka" action="showTeam" />
Menu that gives the error

Code: Select all

<p:selectOneMenu id="clubMenu" value="#{serviceHCP.myCurrentClub}" converter="clubConverter">
                    <f:selectItems value="#{serviceHCP.myClubList}" 
                     var="clb" itemLabel="#{clb.name}" itemValue="#{clb}"/>
                </p:selectOneMenu>
Menu that doesn't have the error (They are identical except for the Listbox and Menu)

Code: Select all

 <p:selectOneListbox id="clubMenu" value="#{serviceHCP.myCurrentClub}" converter="clubConverter">
            <f:selectItems value="#{serviceHCP.myClubList}" 
             var="clb" itemLabel="#{clb.name}" itemValue="#{clb}"/>
        </p:selectOneListbox>

exallon
Posts: 2
Joined: 16 Apr 2014, 21:56

18 Apr 2014, 09:32

Has no one seen this behavior?

I am using Tomcat7 as servlet engine.
Tested on Chrome and Firefox.

Also on both Eclipse and server environment.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 56 guests