You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Matt Tyson <ma...@gmail.com> on 2006/12/15 20:24:22 UTC

Saving State

I've got a component inside a frame.  The state is server side, and JSF can't
find it.  If I hit a command button inside that frame, it can thereafter
find the state.

Leaving aside the question of why we are using frames, can anyone explain
this behavior?  During the initial request for the page, the frame requests
the viewId and I would therefore expect it to be saved.  This is the same
viewId that is submitted by the command button...

Thanks.

Matt
-- 
View this message in context: http://www.nabble.com/Saving-State-tf2828977.html#a7897676
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Saving State

Posted by Matt Tyson <ma...@gmail.com>.
William,

Yeah, its submitting the correct viewId.  The frame set submits the viewId
and then when the ajax request is sent from the component inside the frame,
its got the same viewId.

Also, I verified the session id is correct (ie, the same).

For some reason I believe myfaces is not correctly storing the view when it
has been requested from inside a frame.  I don't know why.

Any other ideas?

Thanks,

Matt 




Matt Tyson wrote:
> 
> I've got a component inside a frame.  The state is server side, and JSF
> can't find it.  If I hit a command button inside that frame, it can
> thereafter find the state.
> 
> Leaving aside the question of why we are using frames, can anyone explain
> this behavior?  During the initial request for the page, the frame
> requests the viewId and I would therefore expect it to be saved.  This is
> the same viewId that is submitted by the command button...
> 
> Thanks.
> 
> Matt
> 

-- 
View this message in context: http://www.nabble.com/Saving-State-tf2828977.html#a7900751
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Saving State

Posted by Matt Tyson <ma...@gmail.com>.
For the next person that runs into this, I've got a work around.  Say you
have a frameset, frameset.jsp that has 2 frames, frameLeft.jsp and
frameRight.jsp.  Myfaces is not handling the state saving correctly
(server-side), so the state will not be recovered for components inside
frameLeft.jsp.  

So get around this, you can make frameLeft.jsp itself a frameset that has
only one frame inside.  Inside that frame, put your actual view, and myfaces
will recover the state correctly.

Matt



Matt Tyson wrote:
> 
> I've got a component inside a frame.  The state is server side, and JSF
> can't find it.  If I hit a command button inside that frame, it can
> thereafter find the state.
> 
> Leaving aside the question of why we are using frames, can anyone explain
> this behavior?  During the initial request for the page, the frame
> requests the viewId and I would therefore expect it to be saved.  This is
> the same viewId that is submitted by the command button...
> 
> Thanks.
> 
> Matt
> 

-- 
View this message in context: http://www.nabble.com/Saving-State-tf2828977.html#a7931429
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Saving State

Posted by Matt Tyson <ma...@gmail.com>.
Looks like what is happening is the component tree is being attached to the
last frame rendered, instead of the frame that contains the component.

William,

Yeah, its submitting the correct viewId.  The frame set submits the viewId
and then when the ajax request is sent from the component inside the frame,
its got the same viewId.

Also, I verified the session id is correct (ie, the same).

For some reason I believe myfaces is not correctly storing the view when it
has been requested from inside a frame.  I don't know why.

Any other ideas?

Thanks,

Matt 

William Huang-2 wrote:
> 
> each frame will have there own component tree (their own viewId) in the
> server side..
> 
>                                                                            
>              Matt Tyson                                                    
>              <matthewcarltyson                                             
>              @gmail.com>                                                To 
>                                        users@myfaces.apache.org            
>              12/15/2006 03:09                                           cc 
>              PM                                                            
>                                                                    Subject 
>                                        Re: Saving State                    
>              Please respond to                                             
>                  "MyFaces                                                  
>                 Discussion"                                                
>              <users@myfaces.ap                                             
>                  ache.org>                                                 
>                                                                            
>                                                                            
> 
> 
> 
> 
> 
> Here is my theory.  When the request is submitted for the framed page, its
> from the framing page, with a different session ID.
> 
> 
> Matt Tyson wrote:
>>
>> I've got a component inside a frame.  The state is server side, and JSF
>> can't find it.  If I hit a command button inside that frame, it can
>> thereafter find the state.
>>
>> Leaving aside the question of why we are using frames, can anyone explain
>> this behavior?  During the initial request for the page, the frame
>> requests the viewId and I would therefore expect it to be saved.  This is
>> the same viewId that is submitted by the command button...
>>
>> Thanks.
>>
>> Matt
>>
> 
> --
> View this message in context:
> http://www.nabble.com/Saving-State-tf2828977.html#a7898365
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> 
> 
> Disclaimer: This electronic mail and any attachments are confidential and
> may be privileged. If you are not the intended recipient, please notify
> the sender immediately by replying to this email, and destroy all copies
> of this email and any attachments. Thank you.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Saving-State-tf2828977.html#a7901241
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Saving State

Posted by William Huang <WH...@intralinks.com>.
each frame will have there own component tree (their own viewId) in the
server side..

                                                                           
             Matt Tyson                                                    
             <matthewcarltyson                                             
             @gmail.com>                                                To 
                                       users@myfaces.apache.org            
             12/15/2006 03:09                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re: Saving State                    
             Please respond to                                             
                 "MyFaces                                                  
                Discussion"                                                
             <users@myfaces.ap                                             
                 ache.org>                                                 
                                                                           
                                                                           





Here is my theory.  When the request is submitted for the framed page, its
from the framing page, with a different session ID.


Matt Tyson wrote:
>
> I've got a component inside a frame.  The state is server side, and JSF
> can't find it.  If I hit a command button inside that frame, it can
> thereafter find the state.
>
> Leaving aside the question of why we are using frames, can anyone explain
> this behavior?  During the initial request for the page, the frame
> requests the viewId and I would therefore expect it to be saved.  This is
> the same viewId that is submitted by the command button...
>
> Thanks.
>
> Matt
>

--
View this message in context:
http://www.nabble.com/Saving-State-tf2828977.html#a7898365
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: Saving State

Posted by Matt Tyson <ma...@gmail.com>.
Here is my theory.  When the request is submitted for the framed page, its
from the framing page, with a different session ID.


Matt Tyson wrote:
> 
> I've got a component inside a frame.  The state is server side, and JSF
> can't find it.  If I hit a command button inside that frame, it can
> thereafter find the state.
> 
> Leaving aside the question of why we are using frames, can anyone explain
> this behavior?  During the initial request for the page, the frame
> requests the viewId and I would therefore expect it to be saved.  This is
> the same viewId that is submitted by the command button...
> 
> Thanks.
> 
> Matt
> 

-- 
View this message in context: http://www.nabble.com/Saving-State-tf2828977.html#a7898365
Sent from the MyFaces - Users mailing list archive at Nabble.com.