I'm new to JSF but I do have a question for you.

In your method you are setting
pageViewBean.setShowResourcesView(true); and
pageViewBean.setShowConfigView(false); but you are
never setting showResourcesView to false and
showConfigView to true.  When you tab from one to the
other shouldn't you be calling the setter for both
booleans?

You also instantiate a new PageViewBean called bean
but I didn't see where you use it.

One more thing, I think JSF renders pages top to
bottom, I don't know, but maybe you need a hidden
field above the subview with some dummy field and in
the getter for that initialize these booleans.  I'm
just guessing here since I don't understand the
details of JSF yet.

Ray

--- Lorinda Swick <[EMAIL PROTECTED]> wrote:

> Wow!  This took nearly two days to arrive from my
> yahoo account.
> 
>  
> 
> Anyway, if you have advice, I'll take it. Otherwise,
> ignore this post.
> 
>  
> 
> -Lorinda
> 
>   _____  
> 
> From: Lorinda Swick [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, January 11, 2005 7:30 PM
> To: [email protected]
> Subject: dynamic navigation and subview
> rendered=#{myBean.show}
> 
>  
> 
> Hi,
> 
> I am having a problem with dynamic navigation. I may
> be ahead of myself in
> my approach -- a lot of this is new for me. Maybe
> someone can help me. 
> 
> In a nutshell - the issue is I can't figure out
> where to instantiate and
> update a bean property such that my JSF page renders
> one and only subview
> with a jsp:include. This is why I started with the
> subject question--when
> are bean properties evaluated?
> 
> More details, my main page includes a header.jsp,
> and it has several
> subviews with the rendered attribute bound to a
> managed bean. So, this: 
> 
> <f:view> 
> <jsp:include page=/header.jsp"/>
>   <f:subview id="resourcesSubView" 
>         
> rendered="#{!pageViewBean.showResourcesView}">
>                        <jsp:include
> page="resourceViewGreeting.jsp"/>     
>   </f:subview>
>  
> <f:subview id="configsSubView" 
>          rendered="#{!pageViewBean.showConfigView}">
>                        <jsp:include
> page="configViewGreeting.jsp"/>     
>   </f:subview>
> </f:view>
> 
> 
> 
> I want only one subview to be shown at a time, the
> one with rendered = true.
> The object which knows what the user selection is
> exists in header.jsp. That
> object is a tabbed panel (WebGalileoFaces
> component). It made sense to me to
> then have the tabbed panel manage the properties.
> Here's the tab event
> handler
> 
>   // this object knows what is selected, update bean
> here
>    public void processTabSelected(TabSelectedEvent
> event)
>             throws AbortProcessingException {
>            
>            PageViewBean bean = new PageViewBean();
>          
>            FacesTabbedPanelImpl tabbedPanel =
> (FacesTabbedPanelImpl) comp;
>            ListSelectionModel model =
> tabbedPanel.getListSelectionModel();
>            int selection = model.getLastSelection();
>             if (selection == 0) {
>                       LOG.info("MenuTabPanel:
> selection=" + 0);
>                     
> pageViewBean.setShowResourcesView(true); // don't
> show
>             } else if (selection == 1) {
>                       LOG.info("MenuTabPanel:
> selection=" + 1);
>                      
> pageViewBean.setShowConfigView(false); // show this
>            } 
>     }
> 
> 
> 
> This is not having the effect I am aiming for--the
> bean properties would be
> updated so the right include page would be rendered.
> 
> I could go on about all the things I've tried...but
> I don't want this post
> to be any longer. I'd really appreciate anyone's
> time on this. 
> 
> Thanks,
> -L
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
> 



                
__________________________________ 
Do you Yahoo!? 
All your favorites on one personal page � Try My Yahoo!
http://my.yahoo.com 

Reply via email to