myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Madhav Bhargava" <unmarsh...@gmail.com>
Subject Re: Very strange behavior - Constructor for component gets called again after its restore state
Date Tue, 26 Dec 2006 08:06:15 GMT
I have attached the menu image with this mail.

On 12/26/06, Madhav Bhargava <unmarshall@gmail.com> wrote:
>
>
>  Hi All,
>
> I have developed a custom component. This component has only one
> HtmlPanelNavigationMenu component which constructs dynamically depending on
> the current role and some other factors.
>
> The Panel is constructed properly and changes properly on role changes.
> However there is a strange behavior. Let me explain:
>
> HtmlPanelNavigationMenu is composed of HtmlCommandNavigationItem
> components. Take the following example:
>
> For those not able to see the image here is the menu:
>
> HOME
>
> MESSAGE CENTER
>
>   >> Messages
>
>   >> Reminders
>
> .... and it continues
>
>
>
> The parent is *Message Center* and once clicked it expands into Message
> and Reminder sub menu.
>
> Following happens when *Message Center *is clicked:
>
> 1. Calls the constructor for the custom component
>
> 2. Calls restoreState  - at the end of this call all the children list for
> this custom component is available.
>
> 3. Calls encodeBegin, encodeChildren and encodeEnd methods.
>
> At the end the left Nav is expanded and is rendered properly.
>
>
>
> *However when Message link is clicked then the following happens:*
>
>    1. Enters the constructor of the custom component
>    2. Enters restoreState method
>    3. Again enters the constructor of the same custom component instead
>    of invoking the encodeBegin
>    4. Does not enter restoreState but now it enters encodeBegin
>
>  As it is clear from Step 3 and 4 that when it enters encodeBegin it does
> not have any children because it does not call restoreState the second time.
> The end result is that the page for Message is displayed but the left
> navigation menu vanishes completely.
>
>  Can anyone point out what is going wrong here?
>
> Any help will be appreciated.
>
>  Thanks and Rgds,
>
> Madhav
>
> --
> When I tell the truth, it is not for the sake of convincing those who do
> not know it, but for the sake of defending those that do
>



-- 
When I tell the truth, it is not for the sake of convincing those who do not
know it, but for the sake of defending those that do

Mime
View raw message