Managing State on multiple simpleTogglePanels
justinhorrocks Nov 9, 2010 5:02 PMI am trying to manage the state on several <rich:simpleTogglePanel>. This was simple to do with icefaces. We have moved to richfaces and the users want to keep the same functionality. The original functionality was when I leave the page with the togglepanels and return back to the page the toggle panel that I was working in will remain open.
What I have right now isn't working, I get this error:
[#|2010-11-09T12:58:36.548-0700|INFO|glassfish3.0.1|javax.enterprise.resource.webcontainer.jsf.lifecycle|_ThreadID=28;_ThreadName=Thread-1;|WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=orderManagementFormId:pendingOrdersPanelId[severity=(ERROR 2), summary=(/order/orderManagement.xhtml @131,101 opened="#{orderManagementState.orderMgmtPendingPanelOpen}": Can't set property 'orderMgmtPendingPanelOpen' on class 'com.wjbradley.appraisal.web.bean.OrderManagementStateBean_$$_javassist_seam_8' to value 'true'.), detail=(/order/orderManagement.xhtml @131,101 opened="#{orderManagementState.orderMgmtPendingPanelOpen}": Can't set property 'orderMgmtPendingPanelOpen' on class 'com.wjbradley.appraisal.web.bean.OrderManagementStateBean_$$_javassist_seam_8' to value 'true'.)]|#]
Here are some snippets of code:
<rich:simpleTogglePanel id="pendingOrdersPanelId"
rendered="#{orderManagementState.viewPending}"
switchType="ajax"
ajaxSingle="true"
opened="#{orderManagementState.orderMgmtPendingPanelOpen}"
action="#{orderManagementState.togglePendingPanel}">
<f:facet name="header">
<h:outputText value="Pending Orders (#{orderManagement.pendingOrders.size})" />
</f:facet>
<ui:include src="pendingOrderContent.xhtml" />
</rich:simpleTogglePanel>
Here is what I have on the backing bean:
public boolean isOrderMgmtPendingPanelOpen() { return this.orderMgmtPendingPanelOpen; } public void setOrderMgmtPendingPanelOpen( final boolean pOrderMgmtPendingPanelOpen ) { this.orderMgmtPendingPanelOpen = pOrderMgmtPendingPanelOpen; }
public String togglePendingPanel()
{
setOrderMgmtPendingPanelOpen( !isOrderMgmtPendingPanelOpen() );
return null;
}
With this code, I get the error at the top. I have also tried using switchType="client" with a4j:support event="oncollapse" and event="onexpand" and the simpleTogglePanels would open and close quickly when I click on the panel. So that didn't work. I am sure I am doing something wrong.
I appreciate any help.
Justin