You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by me <sm...@ix.netcom.com> on 2006/01/09 13:20:50 UTC

tabChangeEvent

I have just started working with MyFaces and have come across a couple issues with the tabs and events. The first straightforward, the second more philosophical.

1) Tomahawk's org.apache.myfaces.custom.tabbedpane.tabChangeEvent has the value for the tab index, but not the tab id which might be useful in some cases.  If, for example, the tabs are reordered, the event listener can still identify the selected UIComponent. One solution is to add a tabComponent property to tabChangeEvent that is set to child tab that is selected.  

2) The tabChangeEvent has an oldTabIndex, but I am not sure if it is useful.  Consider if it is the first time the tabs have been accessed - what is the value of oldTabIndex? If the above suggestion is implemented and the parallel property oldTabComponent is added, what would be the value of oldTabComponent on the first run? Null? What value for oldTabIndex would agree with that? Also, in order to get the old tab index, a special value for the tab must be posted, which in turn means this value can not be used for a tab label.  This must be the reason for the lines in HtmlTabbedPaneRenderer that change the label to "Tab x" even if it is explicitly set to an empty string.

It should be left to the listener or its delegates to handle the change and store any old values it may need.

Steve



Re: tabChangeEvent

Posted by Manfred Geiler <ma...@gmail.com>.
Users list instead of dev list please, see
http://myfaces.apache.org/mailinglists.html
Thanks,
Manfred

2006/1/9, me <sm...@ix.netcom.com>:
> I have just started working with MyFaces and have come across a couple issues with the tabs and events. The first straightforward, the second more philosophical.
>
> 1) Tomahawk's org.apache.myfaces.custom.tabbedpane.tabChangeEvent has the value for the tab index, but not the tab id which might be useful in some cases.  If, for example, the tabs are reordered, the event listener can still identify the selected UIComponent. One solution is to add a tabComponent property to tabChangeEvent that is set to child tab that is selected.
>
> 2) The tabChangeEvent has an oldTabIndex, but I am not sure if it is useful.  Consider if it is the first time the tabs have been accessed - what is the value of oldTabIndex? If the above suggestion is implemented and the parallel property oldTabComponent is added, what would be the value of oldTabComponent on the first run? Null? What value for oldTabIndex would agree with that? Also, in order to get the old tab index, a special value for the tab must be posted, which in turn means this value can not be used for a tab label.  This must be the reason for the lines in HtmlTabbedPaneRenderer that change the label to "Tab x" even if it is explicitly set to an empty string.
>
> It should be left to the listener or its delegates to handle the change and store any old values it may need.
>
> Steve
>
>
>