You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Jeff Bischoff <jb...@klkurz.com> on 2006/05/19 20:59:22 UTC

Forcing to update

Problem:

Menu labels are not updated on t:panelNavigation2 when the action 
returns null, and the same page is redisplayed. If we navigate to 
another page and then navigate back, the labels are updated correctly. 
How can we get t:panelNavigation2 to update itself without navigating to 
a different page?

I thought perhaps binding it to a UIComponent might allow me to 
programmatically force such an update, but I'm not sure what methods 
might accomplish that.

Background:

We have recently added t:panelNavigation2 as a menu to our website. At 
the end of the label for each menu item is a number representing the 
number of records in that category. When a new number is input and the 
load button is clicked, these values should change, but they do not. All 
of the other components on the page (h:inputTexts, h:outputTexts, 
t:inputCalendar, etc) do update their displayed values correctly. We are 
only having a problem with t:panelNavigation2 in particular.

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.



Re: (resolved) Forcing to update

Posted by Jeff Bischoff <jb...@klkurz.com>.
Found a workaround for this issue (and a fairly obvious one at that!) 
The answer was passing value-binding expressions (pointing to labels) 
instead of the actual labels, when building the collection of 
NavigationMenuItems.

This is the only way that I could get a usage such as

<t:panelNavigation2 id="nav1" layout="list" activeItemClass="selected">
     <t:navigationMenuItems value="#{menu.panelNavigationItems}" />	
</t:panelNavigation2>

to reliably update its labels on each request. This deviates from the 
behaviour of similar collection-referencing tags, such as dataTable and 
f:selectItems, which grab the collection anew every time.

Cheers,

Jeff Bischoff
Kenneth L Kurz & Assoc, Inc.

Jeff Bischoff wrote:
> Problem:
> 
> Menu labels are not updated on t:panelNavigation2 when the action 
> returns null, and the same page is redisplayed. If we navigate to 
> another page and then navigate back, the labels are updated correctly. 
> How can we get t:panelNavigation2 to update itself without navigating to 
> a different page?
> 
> I thought perhaps binding it to a UIComponent might allow me to 
> programmatically force such an update, but I'm not sure what methods 
> might accomplish that.
> 
> Background:
> 
> We have recently added t:panelNavigation2 as a menu to our website. At 
> the end of the label for each menu item is a number representing the 
> number of records in that category. When a new number is input and the 
> load button is clicked, these values should change, but they do not. All 
> of the other components on the page (h:inputTexts, h:outputTexts, 
> t:inputCalendar, etc) do update their displayed values correctly. We are 
> only having a problem with t:panelNavigation2 in particular.
> 
> Jeff Bischoff
> Kenneth L Kurz & Associates, Inc.
> 
> 
> 
>