struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gvanma...@comcast.net (Gary VanMatre)
Subject Re: [shale] Dynamic includes in clay
Date Tue, 18 Apr 2006 18:44:41 GMT
>From: "Ryan Wynn" <bigwynnr@gmail.com> 
>
> On 4/18/06, Richard Wallace wrote: 
> > The problem I'm running into is that when next or previous are clicked, 
> > instead of the content for the next page being displayed,the content 
> > from the first page is always displayed. I've checked by logic and made 
> > sure the the value of {@managed-bean-name.currentPage.viewId} is what it 
> > should be. The problem looks like the method getCurrentPage() is never 
> > even called when the next/prev links are hit. I'm guessing it's because 
> > clay is caching the results from the first time the page is loaded and 
> > then just using that on subsequent requests. 
> 
> 
> Richard, 
> 
> I was able to accomplish something similiar to what you are describing 
> but I had to have clay re-create the view on next/back. 
> 
> protected void navigate(String viewId) { 
> UIViewRoot newView = FacesContext.getCurrentInstance().getApplication() 
> 
> .getViewHandler().createView(FacesContext.getCurrentInstance(),viewId); 
> FacesContext.getCurrentInstance().setViewRoot(newView); 
> } 
> 

That's a nifty trick.  I would have setup navigation rules but that's more dynamic.

> I'll defer to Gary on whether or not this is required. 
> 

I agree.  It sounds like the component tree needs to be recreated.  Clay will rebuild the
component tree only when the view is created.   Otherwise, you would need to use a rendered
value binding.  

> Ryan 

Gary
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message