Thanks Brendan, the description of using t:saveState sounds great. I look forward to trying it out shortly.

 I'm still a bit confused on how you deal with links that go to backing bean methods for standard links/buttons. As an example, imagine the header on a page [..]=links...

John Doe    [edit user] [logs for user] [user summary]  [look up company]
1455 some address    [edit address]
Somewhere, state, 12456

The example above is a bit exaggerated, but the point is the links would have to access methods in all different kinds of backing beans. If I use commandLink for those links and provide f:param with the appropriate vars, will the backing bean called automatically be populated with those vars (assuming the backing bean has the same matching member variables)? ( Similar to the same way in Struts calling an action from a link with get params attached will populate the backing ActionForm?) or do I need to manually pull these params from the request?

Thanks for all your help.

On 8/26/05, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]> wrote:
<t:saveState> is trivially simple to use, but it's a Godsend.  Wherever you want the state of a bean to be maintained across requests, just declare the bean with request scope and put a <t:saveSave value="#{myBean}" on the pages that use it.  The bean's state will be maintained until control reaches a page that doesn't have a <t:saveState> declared for it, at which point it will go away automatically.
 
So wherever you need to maintain the state of a bean for more than one request (but don't need it for the entire session), stick in a <t:saveState> tag for all pages that use it, and you're set.
 
If you do this, and you follow Mike Kienenberger's suggestion to access the DataModel object that backs the dataTable component (illustrated in the O'Reilly book JavaServer Faces, pp. 175 - 179), you're all set; you don't need to pass any parameters through the request.
 
Using the DataModel object also is explained in the book CoreJavaServer Faces (Geary, Horstmann), pp. 185 - 201.
 
- Brendan
-----Original Message-----
From: Rick Reumann [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 26, 2005 4:41 PM
To: MyFaces Discussion
Subject: Re: Dealing with links/buttons to fire off an action? confusion on how to set this up



On 8/26/05, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]> wrote:

However, I believe that, using this mechanism, there's no real way to get around using something like <t:saveState> or having a session-scoped bean.  Just out of curiosity, what is the objection to using <t:saveState>?


Well I haven't gotten that far in my learning to have touched upon t:saveState. Was actually just more curious in general of how you deal with cases where you would typically want to use requestParams attached to a url link.


--
Rick



--
Rick

Reply via email to