Ok - here is what I finally did.
My actions just load a jsp after post so the Redirect was
unnecessary. (I actually had some in there I removed).
I have a <s:hidden name="activeTab" value="XXXXX'/> in each form in
each tab. The value is set to the id of the current tab.
In my base CRUD Action Class I added a property named activeTab, with
getters and setters.
Then on the s:tabbedPanel tag I added the selectedTab="%{activeTab}"
attribute and it worked like a champ!
Thanks to everyones help.
Brian-
On Jul 11, 2007, at 11:17 AM, Toni Lyytikäinen wrote:
I'm just redirecting to an address that's formed like this (see the
result
type "redirect-action" in the docs):
http://myapp.com/here/is/the/url.action?active=myTab
Are you doing any redirecting between the the form post and the
tabbed page,
or are you just posting to an action that renders the tabbed page?
Because
redirects don't by default preserve parameters, you have to
configure them
manually. If you're taking the second approach, and you have get/
set-methods
for your active element, quickly thinking, you could possibly just use
selectedTab="<s:property value="active" />"?
On 7/11/07, Brian Trzupek <[EMAIL PROTECTED]> wrote:
Toni,
So when you say you use "%{#parameters['active']}" after "setting a
parameter in the request", what are you actually doing?
As I have added a hidden field in my form that has an "active"
element that I set to the current tab, but it never comes back to the
page?
Any idea where I went wrong?
Thanks,
brian-
On Jul 10, 2007, at 8:50 AM, Toni Lyytikäinen wrote:
> I'd like to know the best practice too. I've done this setting a
> parameter
> in the request, and in my jsp I have
>
> <s:tabbedPanel id="adminpanel" selectedTab="%{#parameters
['active']}">
>
> not very elegant but works.
>
> On 7/10/07, Brian Trzupek <[EMAIL PROTECTED]> wrote:
>>
>> I have a page with several Struts Tabs on it.
>>
>> When I submit the page, I would like it to come back to the
'active'
>> tab (the previous selected tab).
>>
>> Is there a best practice on how to do this?
>>
>> Thanks,
>> Brian-
>>
>>
---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]