stateAttr and serverside forwards

37 views
Skip to first unread message

ximsce

unread,
Oct 10, 2007, 2:44:04 PM10/10/07
to JMesa
Hi,

We would like to use the stateAttr="restore" functionality with the
tag library so that filters and sorts will remain throughout the
session. However, we use tiles to construct our view on the
serverside, thus it becomes non-trivial to pass the restore parameter
into our jsp. It looks like the parameter is a boolean, so would it
be possible to instead have Spring pass in a boolean that the
tablefacade tag could read? For example, there could be an attribute
such as restoreLimit="${restore}"...

Thanks

Jeff Johnston

unread,
Oct 10, 2007, 2:57:40 PM10/10/07
to JMesa
How about if we enhanced the feature to look for the state attribute
in the request scope? That way you could set it in the request scope
from your controller. I suppose it could even look for it in
session...although I would have to think that through. The request
scope for sure would be a nice enhancement.

-Jeff Johnston

ximsce

unread,
Oct 10, 2007, 6:50:02 PM10/10/07
to JMesa
Yeah, that would do the trick. I'd still prefer to pass the boolean
value itself, but that's just a personal preference.

On Oct 10, 12:57 pm, Jeff Johnston <extremecompone...@gmail.com>
wrote:

Jeff Johnston

unread,
Oct 10, 2007, 11:18:28 PM10/10/07
to JMesa

I was planning on providing incremental builds so you prompted me to
do that tonight. I still need to provide a reference to what the
changes are as I get them in, but just know right now the only thing
in this build are a few additional column tag attributes as well as
the enhancing the State feature to look for the stateAttr in the
request scope.

http://builds.jmesa.org/

-Jeff Johnston

ximsce

unread,
Oct 12, 2007, 1:19:26 PM10/12/07
to JMesa
I've updated to the 2.3 build so the SessionState is reading the
attribute off the request scope. However, now my sorting no longer
works. I'm guessing that this is because the SessionState is loading
and rereading the stateAttr value which is still set to true, thus
ignoring the change in sorting. Is the idea that the "restore"
variable should only be set to true when I enter the page, after which
it needs to be set to false (or removed altogether) while on the page
so that sorting, etc. works? If so, do you have a recommendation for
the best way to set that up properly?

Thanks.

Jeff Johnston

unread,
Oct 12, 2007, 1:56:59 PM10/12/07
to JMesa
Yes, when the SessionState detects the stateAttr attribute in the
parameter or request context the Limit is pulled from the session. So,
in your case if you ask for it each time then it will always pull the
Limit from session. The feature was meant to work in that when you
came from a different page you would pass a parameter that said you
wanted to load the Limit from session. However, you could do something
slightly different. How about setting a hidden field in your form that
basically means, if this variable is set then I must be on the same
page as the table and I do not want to set the stateAttr in the
request. Does that make sense?

-Jeff Johnston

ximsce

unread,
Oct 12, 2007, 5:31:43 PM10/12/07
to JMesa
Yes, that makes sense; I've added a hidden input field that sets a
variable such that when that variable is set the stateAttr variable is
set to false. Looks to be working, now. Thanks!

On Oct 12, 11:56 am, Jeff Johnston <extremecompone...@gmail.com>
wrote:

Pradip Patil

unread,
Nov 1, 2012, 11:17:05 AM11/1/12
to jm...@googlegroups.com
Hi ximsce,
 
I am facing same problem. stateAttr is not working in my applicaiton. could you plz tell me apart from settng  stateAttr="restore" what else is required to be set ti make this working.
I want to persist my Limit values.
 
Pradip
Reply all
Reply to author
Forward
0 new messages