I use Primefaces 3.2 with Apache Myfaces 2 on WebSphere Application Server 8.
I have a form, where you can select 2 different view by changing a selectOneButton.
When I use this button without ajax behavior (submit with command button) then the value change works fine.
But when I use something like this:
<h:form id="form">
<p:panel header="Panel" toggleable="true" closable="true" id="pan1">
<p:panel header="Options" toggleable="true" collapsed="true" id="pan2">
<p:panelGrid style="width:100%; text-align:center;" id="pan3">
<p:row>
<!-- some outputLabels -->
<p:column rowspan="2" style="width:130px;">
<p:splitButton value="Show" action="#{ graph.update }"
update=":form" id="splitbtn">
<p:menuitem value="Update 2"
action="#{ graph.update2 }"
update=":form" />
</p:splitButton>
</p:column>
</p:row>
<p:row>
<p:column>
<p:selectOneButton id="btn1"
value="#{ bean.val }">
<f:selectItem itemLabel="lbl1" itemValue="1" />
<f:selectItem itemLabel="lbl2" itemValue="2" />
<p:ajax event="change"
update=":firstChartForm" />
</p:selectOneButton>
</p:column>
<!-- more coloumns -->
</p:row>
</p:panel>
<!-- more content -->
</p:panel>
</h:form>
Then the value of bean.val is empty when I change the button and update the form with ajax.
(Logger in setter method prints 2 times empty value).
Why is the value empty?
It is a PrimeFaces selectOneButton Bug. Fixed with PrimeFaces 3.4
Link to Issue 3767 in Issue Tracker:
http://code.google.com/p/primefaces/issues/detail?id=3767
This was fixed in version 3.4 of PrimeFaces.