ICEfaces Collapsible Panel initialization problem (maybe Seam problem)
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icefaces.org  [Register] Register  [Login] Login 
ICEfaces Collapsible Panel initialization problem (maybe Seam problem)  XML
Forum Index -> JBoss Seam Integration
Author Message
laura.vigna


Joined: 31/08/2009 00:00:00
Messages: 30
Offline


Hallo everybody
we have a group PanelCollapsible components, only one is meant to be open at a time.
So when the page loads, I need to set which panel is open by default.
Obviously the "expanded" attribute is a variable in a bean (PanelHander.expanded)
PanelHander is a Seam component.

I had an init() method in the PanelHandler to set the right expanded panel when the page loads. That is configured in the seam navigation rules:
<page view-id="/main.xhtml" login-required="true" >
<action execute="#{sidebarPanelHandler.init}" />
</page>


Each Panel looks like this on the xhtml page:
<ice:panelCollapsible id="panel1"
rendered="#{showPanel1}"
actionListener="#{sidebarPanelHandler.Panel1ProcessAction}"
expanded="#{panel1.expanded}"
binding="#{sidebarPanelHandler.panel1}">
<ui:include src="sidebarPanel_search1.xhtml" />
</ice:panelCollapsible>

With the BINDING I should have easily my Collapsible Panel on my sidebarPanelHandler bean. BUT, when we reach the sidebarPanelHandler .init() method, the collapsible panel objects are null, probably because seam fires BEFORE the jsf lifecycle has instanced the components.

So our init method is wrong. Is there a way to initialize this components AFTER they have been created?
We don't wanna instance panels manually (putting new CollapsiblePanel() in the getter if the object is null for example), i've seen people doing it on the forum, but I think it's wrong. JSF should do that, otherwise there's the risk of having doubled-zombie things around.

Thanks

Laura






"Fatti non foste a viver come bruti, ma a seguir virtute e conoscenza"
judy.guglielmin

Joined: 20/02/2007 00:00:00
Messages: 1196
Offline


What scope are all these beans in? Looking at your markup, I don't think this would work in anything other than session scope, but normally I would only do a component-binding with seam if the binding bean was in request scope (to get the latest version of the view--did you look at the datapaginator example of seam-comp-showcase?). This can then be injected into a conversation-scoped object (since one of the benefits of using seam is that you no longer have to store everything in session scope).

Anyways, you might want to track the version of your backing bean that is returning a null value to see if the scopes are correct for your use. (@Create method which you can log the version of the bean you are trying to track). First guess would be a scope problem.
 
Forum Index -> JBoss Seam Integration
Go to:   
Powered by JForum 2.1.7ice © JForum Team