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);
}
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