selectonemenu and ajax problems

UI Components for JSF
Post Reply
User avatar
imanol
Posts: 20
Joined: 04 Nov 2010, 13:16

10 May 2011, 12:18

Hi, I'm trying to do a simple example, but I'm having some problems. The ajax select showcase doesn't work (for me at least), and I'm trying to do something similar without success.
This is the code:

Code: Select all

<h:form>
            <p:selectOneMenu id="portSelect" value="#{bean.selection}" >  
                <f:selectItem itemLabel="All" itemValue="all" />
                <f:selectItem itemLabel="1111" itemValue="1111"/>
                <f:selectItem itemLabel="2222" itemValue="2222"/>
                <f:selectItem itemLabel="3333" itemValue="3333"/>
                <p:ajax  update="selection" process="@this"
                         listener="#{bean.change}" />
            </p:selectOneMenu> 
            <h:outputText id="selection" value="#{bean.selection}"/>
        </h:form>

public void change() {
        System.out.println(selection);
    }
Do I have to use the valueChangeListener attribute instead of p:ajax? Does the "onchange" function need any parameter (event)?

PD: I'm using the latest snapshot of primefaces 3.0.M2 (8th May I think), Mojarra JSF 2.1.0 and glassfish 3.1

User avatar
imanol
Posts: 20
Joined: 04 Nov 2010, 13:16

13 May 2011, 10:20

Well, I have seen that the p:update issue has been fixed, great!

Any news about the selectonemenu element? It still doesn't work, the first item is always selected.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 33 guests