You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Wyatt <jw...@itree.com.au> on 2007/05/15 11:07:10 UTC
[S2] How to refresh one tab in Tabbedpanel instead of whole page?
Hi, we're using the Struts 2 tabbedpanel tag. One problem we're having is
that whenever we do a submit from within a tab, we to reload the same tab
with the results.
At the moment we our submit button posts to an XAction mentioned in the
<s:div> tag for the given X tab.
The XAction returns a TabsResult that causes the main.jsp page containing
the tabbedpanel to be loaded.
The main.jsp page causes the XAction related the given X tab to be hit
again, this time to load the contents of the tab.
The XAction returns a different TabXResult, causing a related Xtab.jsp to be
loaded and displayed in the <s:div> layer.
This works ok for one layer of tabs... we now want nested layers, which is
looking like a complex problem.
Is there an easier solution, that can maybe just reload the specific tab's
<s:div> layer with the result of the XAction? That would be most excellent.
Thanks in advance, regards
Jason
-----
Falun Dafa Truth - Compassion - Forbearance
A mind & body practice under persecution in China
<http://www.faluninfo.net/> http://www.faluninfo.net
RE: [S2] How to refresh one tab in Tabbedpanel instead of whole page?
Posted by Jason Wyatt <jw...@itree.com.au>.
Marco & Musachy,
I tried adding includeParams="all", as suggested, but this just included the
params that were used to hit the page in the first place.
I managed to get something almost working now... The submit button causes
the form to be posted to the action and refreshes the tab correctly. The key
seemed to be setting the formId, action and targets attributes in the
<s:submit> tag, along with showLoadingText="false" for IE.
Now I'm trying to tell when the user has hit the action via the submit
button vs. when they hit the page the first time. There seem to be two
unexpected phenomena related to this.
I tried using name="submit" and value="Save", but the value of the submit
param is lost... It never gets set on the Action.
<s:submit id="summarySubmit" name="submit" value="Save" formId="summaryForm"
action="NcrSummaryAction" targets="summaryTab,summaryForm,summaryComment"
showLoadingText="false" theme="ajax" />
I also tried using method="save" in the submit button:
<s:submit id="summarySubmit" name="submit" value="Save" method="save"
formId="summaryForm" action="NcrSummaryAction"
targets="summaryTab,summaryForm,summaryComment" showLoadingText="false"
theme="ajax" />
But in this case the Action's save function never gets called.
Seems either of these should work... Bugs?
Regards,
Jason
-----Original Message-----
From: Marco Carnevale [mailto:marco.carnevale@gmail.com]
Sent: Thursday, 17 May 2007 5:43 AM
To: Struts Users Mailing List
Subject: Re: [S2] How to refresh one tab in Tabbedpanel instead of whole
page?
Jason,
Using the includeParams="all" attribute of the s:url tag will probably give
you what you need.
<s:url id="refreshURL" includeParams="all" action="/RefreshAction" />
Marco
On 5/15/07, Jason Wyatt <jw...@itree.com.au> wrote:
>
> Hi Marco,
>
> I tried using the code template you gave, but couldn't get it to do a
> *form
> submit* to the action... It just seems to just do a GET without form
> parameters. Does it do a form submit for you?
>
> Sorry, I mightn't have been clear... I wanted to *submit a form*
> inside a tab to that tab's Action, then have the tab load the updated
contents.
>
> For example, say I have a tab that searches for employees. I fill out
> the search criteria then press "Search". I want the search form to be
> submitted to the employeeSearchAction, then the search tab to be
> refreshed with the list of employees, without loading the whole page.
>
> So far I've only been able to either just "refresh" a tab with some
> URL (without the form submitting), or submit a form and refresh the
> whole page.
> I haven't got both the form to submit correctly and then only that tab
> to refresh.
>
> It would be great if this is possible!
>
> Thanks
> Jason
>
>
>
> -----Original Message-----
> From: Marco Carnevale [mailto:marco.carnevale@gmail.com]
> Sent: Wednesday, 16 May 2007 2:29 AM
> To: Struts Users Mailing List
> Subject: Re: [S2] How to refresh one tab in Tabbedpanel instead of
> whole page?
>
> I am doing this on my project. The tab refreshes when the user
> selects a button.
>
> 1) You should know the div name for the tab you are interested in. In
> this example the div name is: myTabDivId
>
> <s:url id="myUrl" action="/MyAction"/> <s:tabbedPanel id="myTabs"
> name="myTabs" selectedTab="%{activeCaseTab}">
> <s:div id="myTabDivId" href="%{myUrl}" theme="ajax" label="The Tabs
> Name" /> </s:tabbedPanel>
>
> 2) You need a URL to submit to when the button is pressed that returns
> the contents (i.e. tile) of the tab (this may be the same as the url
> in step
> 1)
>
> <s:url id="refreshURL" action="/RefreshAction" />
>
> 3) You need to turn on th ajax on the button and specify the tab div
> id that you want to replace.
>
> <s:submit key="button.add" theme="ajax" targets="myTabDivId"
> disabled="false"
> href="%{refreshURL}" />
>
> Marco
>
>
>
> On 5/15/07, Musachy Barroso <mu...@gmail.com> wrote:
> >
> > If you put a whole tabbedpanel inside a remote div, then you can
> > reload it anytime you want.
> >
> > regards
> > musachy
> >
> > On 5/15/07, Jason Wyatt <jw...@itree.com.au> wrote:
> > >
> > > Hi, we're using the Struts 2 tabbedpanel tag. One problem we're
> > > having
> > is
> > > that whenever we do a submit from within a tab, we to reload the
> > > same
> > tab
> > > with the results.
> > >
> > > At the moment we our submit button posts to an XAction mentioned
> > > in the <s:div> tag for the given X tab.
> > >
> > > The XAction returns a TabsResult that causes the main.jsp page
> > containing
> > > the tabbedpanel to be loaded.
> > >
> > > The main.jsp page causes the XAction related the given X tab to be
> > > hit again, this time to load the contents of the tab.
> > >
> > > The XAction returns a different TabXResult, causing a related
> > > Xtab.jspto be loaded and displayed in the <s:div> layer.
> > >
> > > This works ok for one layer of tabs... we now want nested layers,
> > > which
> > is
> > > looking like a complex problem.
> > >
> > > Is there an easier solution, that can maybe just reload the
> > > specific
> > tab's
> > > <s:div> layer with the result of the XAction? That would be most
> > > excellent.
> > >
> > >
> > > Thanks in advance, regards
> > >
> > > Jason
> > >
> > >
> > > -----
> > > Falun Dafa Truth - Compassion - Forbearance
> > >
> > > A mind & body practice under persecution in China
> > >
> > > <http://www.faluninfo.net/> http://www.faluninfo.net
> > >
> > >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2] How to refresh one tab in Tabbedpanel instead of whole page?
Posted by Marco Carnevale <ma...@gmail.com>.
Jason,
Using the includeParams="all" attribute of the s:url tag will probably give
you what you need.
<s:url id="refreshURL" includeParams="all" action="/RefreshAction" />
Marco
On 5/15/07, Jason Wyatt <jw...@itree.com.au> wrote:
>
> Hi Marco,
>
> I tried using the code template you gave, but couldn't get it to do a
> *form
> submit* to the action... It just seems to just do a GET without form
> parameters. Does it do a form submit for you?
>
> Sorry, I mightn't have been clear... I wanted to *submit a form* inside a
> tab to that tab's Action, then have the tab load the updated contents.
>
> For example, say I have a tab that searches for employees. I fill out the
> search criteria then press "Search". I want the search form to be
> submitted
> to the employeeSearchAction, then the search tab to be refreshed with the
> list of employees, without loading the whole page.
>
> So far I've only been able to either just "refresh" a tab with some URL
> (without the form submitting), or submit a form and refresh the whole
> page.
> I haven't got both the form to submit correctly and then only that tab to
> refresh.
>
> It would be great if this is possible!
>
> Thanks
> Jason
>
>
>
> -----Original Message-----
> From: Marco Carnevale [mailto:marco.carnevale@gmail.com]
> Sent: Wednesday, 16 May 2007 2:29 AM
> To: Struts Users Mailing List
> Subject: Re: [S2] How to refresh one tab in Tabbedpanel instead of whole
> page?
>
> I am doing this on my project. The tab refreshes when the user selects a
> button.
>
> 1) You should know the div name for the tab you are interested in. In
> this
> example the div name is: myTabDivId
>
> <s:url id="myUrl" action="/MyAction"/>
> <s:tabbedPanel id="myTabs" name="myTabs" selectedTab="%{activeCaseTab}">
> <s:div id="myTabDivId" href="%{myUrl}" theme="ajax" label="The Tabs
> Name" /> </s:tabbedPanel>
>
> 2) You need a URL to submit to when the button is pressed that returns the
> contents (i.e. tile) of the tab (this may be the same as the url in step
> 1)
>
> <s:url id="refreshURL" action="/RefreshAction" />
>
> 3) You need to turn on th ajax on the button and specify the tab div id
> that
> you want to replace.
>
> <s:submit key="button.add" theme="ajax" targets="myTabDivId"
> disabled="false"
> href="%{refreshURL}" />
>
> Marco
>
>
>
> On 5/15/07, Musachy Barroso <mu...@gmail.com> wrote:
> >
> > If you put a whole tabbedpanel inside a remote div, then you can
> > reload it anytime you want.
> >
> > regards
> > musachy
> >
> > On 5/15/07, Jason Wyatt <jw...@itree.com.au> wrote:
> > >
> > > Hi, we're using the Struts 2 tabbedpanel tag. One problem we're
> > > having
> > is
> > > that whenever we do a submit from within a tab, we to reload the
> > > same
> > tab
> > > with the results.
> > >
> > > At the moment we our submit button posts to an XAction mentioned in
> > > the <s:div> tag for the given X tab.
> > >
> > > The XAction returns a TabsResult that causes the main.jsp page
> > containing
> > > the tabbedpanel to be loaded.
> > >
> > > The main.jsp page causes the XAction related the given X tab to be
> > > hit again, this time to load the contents of the tab.
> > >
> > > The XAction returns a different TabXResult, causing a related
> > > Xtab.jspto be loaded and displayed in the <s:div> layer.
> > >
> > > This works ok for one layer of tabs... we now want nested layers,
> > > which
> > is
> > > looking like a complex problem.
> > >
> > > Is there an easier solution, that can maybe just reload the specific
> > tab's
> > > <s:div> layer with the result of the XAction? That would be most
> > > excellent.
> > >
> > >
> > > Thanks in advance, regards
> > >
> > > Jason
> > >
> > >
> > > -----
> > > Falun Dafa Truth - Compassion - Forbearance
> > >
> > > A mind & body practice under persecution in China
> > >
> > > <http://www.faluninfo.net/> http://www.faluninfo.net
> > >
> > >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: [S2] How to refresh one tab in Tabbedpanel instead of whole page?
Posted by Musachy Barroso <mu...@gmail.com>.
You can also use topics to force the div to reload.
musachy
On 5/15/07, Marco Carnevale <ma...@gmail.com> wrote:
>
> I am doing this on my project. The tab refreshes when the user selects a
> button.
>
> 1) You should know the div name for the tab you are interested in. In
> this
> example the div name is: myTabDivId
>
> <s:url id="myUrl" action="/MyAction"/>
> <s:tabbedPanel id="myTabs" name="myTabs" selectedTab="%{activeCaseTab}">
> <s:div id="myTabDivId" href="%{myUrl}" theme="ajax" label="The Tabs
> Name" />
> </s:tabbedPanel>
>
> 2) You need a URL to submit to when the button is pressed that returns the
> contents (i.e. tile) of the tab (this may be the same as the url in step
> 1)
>
> <s:url id="refreshURL" action="/RefreshAction" />
>
> 3) You need to turn on th ajax on the button and specify the tab div id
> that
> you want to replace.
>
> <s:submit key="button.add" theme="ajax" targets="myTabDivId"
> disabled="false"
> href="%{refreshURL}" />
>
> Marco
>
>
>
> On 5/15/07, Musachy Barroso <mu...@gmail.com> wrote:
> >
> > If you put a whole tabbedpanel inside a remote div, then you can reload
> it
> > anytime you want.
> >
> > regards
> > musachy
> >
> > On 5/15/07, Jason Wyatt <jw...@itree.com.au> wrote:
> > >
> > > Hi, we're using the Struts 2 tabbedpanel tag. One problem we're having
> > is
> > > that whenever we do a submit from within a tab, we to reload the same
> > tab
> > > with the results.
> > >
> > > At the moment we our submit button posts to an XAction mentioned in
> the
> > > <s:div> tag for the given X tab.
> > >
> > > The XAction returns a TabsResult that causes the main.jsp page
> > containing
> > > the tabbedpanel to be loaded.
> > >
> > > The main.jsp page causes the XAction related the given X tab to be hit
> > > again, this time to load the contents of the tab.
> > >
> > > The XAction returns a different TabXResult, causing a related
> Xtab.jspto
> > > be
> > > loaded and displayed in the <s:div> layer.
> > >
> > > This works ok for one layer of tabs... we now want nested layers,
> which
> > is
> > > looking like a complex problem.
> > >
> > > Is there an easier solution, that can maybe just reload the specific
> > tab's
> > > <s:div> layer with the result of the XAction? That would be most
> > > excellent.
> > >
> > >
> > > Thanks in advance, regards
> > >
> > > Jason
> > >
> > >
> > > -----
> > > Falun Dafa Truth - Compassion - Forbearance
> > >
> > > A mind & body practice under persecution in China
> > >
> > > <http://www.faluninfo.net/> http://www.faluninfo.net
> > >
> > >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
Re: [S2] How to refresh one tab in Tabbedpanel instead of whole page?
Posted by Musachy Barroso <mu...@gmail.com>.
If you are using IE make sure you set showLoadingText="false"(nasty
difference with FF), and yes, it should work just assigning the form id to
the formId attribute, something like:
<s:tabbedpanel ...>
<s:div theme="ajax" id="parent">
<s:form id="myform" ...>
<s:submit theme="ajax" showLoadingText="false" target="parent"/>
</s:form>
</s:div>
</s:tabbedpanel>
musachy
On 5/15/07, Jason Wyatt <jw...@itree.com.au> wrote:
>
> Thanks Martin,
>
> Yes, I have been using <s:form action="IacSummaryAction" method="post" >
>
> Jason
>
>
> -----Original Message-----
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Sent: Wednesday, 16 May 2007 11:02 AM
> To: Struts Users Mailing List
> Subject: Re: [S2] How to refresh one tab in Tabbedpanel instead of whole
> page?
>
> while constructing your form *presumably* with html:form be sure to
> specify
> method= attribute here is the 1.x Taglib doc
> http://struts.apache.org/1.x/struts-taglib/tlddoc/html/form.html
>
> the 2.x Taglib doc
> http://struts.apache.org/2.x/docs/form.html
>
> HTH/
> M--
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed. If you have received this email message in error, please
> notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy. Thank you.
>
> ----- Original Message -----
> From: "Jason Wyatt" <jw...@itree.com.au>
> To: "'Struts Users Mailing List'" <us...@struts.apache.org>
> Sent: Tuesday, May 15, 2007 8:36 PM
> Subject: RE: [S2] How to refresh one tab in Tabbedpanel instead of whole
> page?
>
>
> > Hi Marco,
> >
> > I tried using the code template you gave, but couldn't get it to do a
> > *form
> > submit* to the action... It just seems to just do a GET without form
> > parameters. Does it do a form submit for you?
> >
> > Sorry, I mightn't have been clear... I wanted to *submit a form*
> > inside a tab to that tab's Action, then have the tab load the updated
> contents.
> >
> > For example, say I have a tab that searches for employees. I fill out
> > the search criteria then press "Search". I want the search form to be
> > submitted to the employeeSearchAction, then the search tab to be
> > refreshed with the list of employees, without loading the whole page.
> >
> > So far I've only been able to either just "refresh" a tab with some
> > URL (without the form submitting), or submit a form and refresh the
> > whole page.
> > I haven't got both the form to submit correctly and then only that tab
> > to refresh.
> >
> > It would be great if this is possible!
> >
> > Thanks
> > Jason
> >
> >
> >
> > -----Original Message-----
> > From: Marco Carnevale [mailto:marco.carnevale@gmail.com]
> > Sent: Wednesday, 16 May 2007 2:29 AM
> > To: Struts Users Mailing List
> > Subject: Re: [S2] How to refresh one tab in Tabbedpanel instead of
> > whole page?
> >
> > I am doing this on my project. The tab refreshes when the user
> > selects a button.
> >
> > 1) You should know the div name for the tab you are interested in. In
> > this example the div name is: myTabDivId
> >
> > <s:url id="myUrl" action="/MyAction"/> <s:tabbedPanel id="myTabs"
> > name="myTabs" selectedTab="%{activeCaseTab}">
> > <s:div id="myTabDivId" href="%{myUrl}" theme="ajax" label="The Tabs
> > Name" /> </s:tabbedPanel>
> >
> > 2) You need a URL to submit to when the button is pressed that returns
> > the contents (i.e. tile) of the tab (this may be the same as the url
> > in step
> > 1)
> >
> > <s:url id="refreshURL" action="/RefreshAction" />
> >
> > 3) You need to turn on th ajax on the button and specify the tab div
> > id that you want to replace.
> >
> > <s:submit key="button.add" theme="ajax" targets="myTabDivId"
> > disabled="false"
> > href="%{refreshURL}" />
> >
> > Marco
> >
> >
> >
> > On 5/15/07, Musachy Barroso <mu...@gmail.com> wrote:
> >>
> >> If you put a whole tabbedpanel inside a remote div, then you can
> >> reload it anytime you want.
> >>
> >> regards
> >> musachy
> >>
> >> On 5/15/07, Jason Wyatt <jw...@itree.com.au> wrote:
> >> >
> >> > Hi, we're using the Struts 2 tabbedpanel tag. One problem we're
> >> > having
> >> is
> >> > that whenever we do a submit from within a tab, we to reload the
> >> > same
> >> tab
> >> > with the results.
> >> >
> >> > At the moment we our submit button posts to an XAction mentioned in
> >> > the <s:div> tag for the given X tab.
> >> >
> >> > The XAction returns a TabsResult that causes the main.jsp page
> >> containing
> >> > the tabbedpanel to be loaded.
> >> >
> >> > The main.jsp page causes the XAction related the given X tab to be
> >> > hit again, this time to load the contents of the tab.
> >> >
> >> > The XAction returns a different TabXResult, causing a related
> >> > Xtab.jspto be loaded and displayed in the <s:div> layer.
> >> >
> >> > This works ok for one layer of tabs... we now want nested layers,
> >> > which
> >> is
> >> > looking like a complex problem.
> >> >
> >> > Is there an easier solution, that can maybe just reload the
> >> > specific
> >> tab's
> >> > <s:div> layer with the result of the XAction? That would be most
> >> > excellent.
> >> >
> >> >
> >> > Thanks in advance, regards
> >> >
> >> > Jason
> >> >
> >> >
> >> > -----
> >> > Falun Dafa Truth - Compassion - Forbearance
> >> >
> >> > A mind & body practice under persecution in China
> >> >
> >> > <http://www.faluninfo.net/> http://www.faluninfo.net
> >> >
> >> >
> >>
> >>
> >> --
> >> "Hey you! Would you help me to carry the stone?" Pink Floyd
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
RE: [S2] How to refresh one tab in Tabbedpanel instead of whole page?
Posted by Jason Wyatt <jw...@itree.com.au>.
Thanks Martin,
Yes, I have been using <s:form action="IacSummaryAction" method="post" >
Jason
-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com]
Sent: Wednesday, 16 May 2007 11:02 AM
To: Struts Users Mailing List
Subject: Re: [S2] How to refresh one tab in Tabbedpanel instead of whole
page?
while constructing your form *presumably* with html:form be sure to specify
method= attribute here is the 1.x Taglib doc
http://struts.apache.org/1.x/struts-taglib/tlddoc/html/form.html
the 2.x Taglib doc
http://struts.apache.org/2.x/docs/form.html
HTH/
M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed. If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy. Thank you.
----- Original Message -----
From: "Jason Wyatt" <jw...@itree.com.au>
To: "'Struts Users Mailing List'" <us...@struts.apache.org>
Sent: Tuesday, May 15, 2007 8:36 PM
Subject: RE: [S2] How to refresh one tab in Tabbedpanel instead of whole
page?
> Hi Marco,
>
> I tried using the code template you gave, but couldn't get it to do a
> *form
> submit* to the action... It just seems to just do a GET without form
> parameters. Does it do a form submit for you?
>
> Sorry, I mightn't have been clear... I wanted to *submit a form*
> inside a tab to that tab's Action, then have the tab load the updated
contents.
>
> For example, say I have a tab that searches for employees. I fill out
> the search criteria then press "Search". I want the search form to be
> submitted to the employeeSearchAction, then the search tab to be
> refreshed with the list of employees, without loading the whole page.
>
> So far I've only been able to either just "refresh" a tab with some
> URL (without the form submitting), or submit a form and refresh the
> whole page.
> I haven't got both the form to submit correctly and then only that tab
> to refresh.
>
> It would be great if this is possible!
>
> Thanks
> Jason
>
>
>
> -----Original Message-----
> From: Marco Carnevale [mailto:marco.carnevale@gmail.com]
> Sent: Wednesday, 16 May 2007 2:29 AM
> To: Struts Users Mailing List
> Subject: Re: [S2] How to refresh one tab in Tabbedpanel instead of
> whole page?
>
> I am doing this on my project. The tab refreshes when the user
> selects a button.
>
> 1) You should know the div name for the tab you are interested in. In
> this example the div name is: myTabDivId
>
> <s:url id="myUrl" action="/MyAction"/> <s:tabbedPanel id="myTabs"
> name="myTabs" selectedTab="%{activeCaseTab}">
> <s:div id="myTabDivId" href="%{myUrl}" theme="ajax" label="The Tabs
> Name" /> </s:tabbedPanel>
>
> 2) You need a URL to submit to when the button is pressed that returns
> the contents (i.e. tile) of the tab (this may be the same as the url
> in step
> 1)
>
> <s:url id="refreshURL" action="/RefreshAction" />
>
> 3) You need to turn on th ajax on the button and specify the tab div
> id that you want to replace.
>
> <s:submit key="button.add" theme="ajax" targets="myTabDivId"
> disabled="false"
> href="%{refreshURL}" />
>
> Marco
>
>
>
> On 5/15/07, Musachy Barroso <mu...@gmail.com> wrote:
>>
>> If you put a whole tabbedpanel inside a remote div, then you can
>> reload it anytime you want.
>>
>> regards
>> musachy
>>
>> On 5/15/07, Jason Wyatt <jw...@itree.com.au> wrote:
>> >
>> > Hi, we're using the Struts 2 tabbedpanel tag. One problem we're
>> > having
>> is
>> > that whenever we do a submit from within a tab, we to reload the
>> > same
>> tab
>> > with the results.
>> >
>> > At the moment we our submit button posts to an XAction mentioned in
>> > the <s:div> tag for the given X tab.
>> >
>> > The XAction returns a TabsResult that causes the main.jsp page
>> containing
>> > the tabbedpanel to be loaded.
>> >
>> > The main.jsp page causes the XAction related the given X tab to be
>> > hit again, this time to load the contents of the tab.
>> >
>> > The XAction returns a different TabXResult, causing a related
>> > Xtab.jspto be loaded and displayed in the <s:div> layer.
>> >
>> > This works ok for one layer of tabs... we now want nested layers,
>> > which
>> is
>> > looking like a complex problem.
>> >
>> > Is there an easier solution, that can maybe just reload the
>> > specific
>> tab's
>> > <s:div> layer with the result of the XAction? That would be most
>> > excellent.
>> >
>> >
>> > Thanks in advance, regards
>> >
>> > Jason
>> >
>> >
>> > -----
>> > Falun Dafa Truth - Compassion - Forbearance
>> >
>> > A mind & body practice under persecution in China
>> >
>> > <http://www.faluninfo.net/> http://www.faluninfo.net
>> >
>> >
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2] How to refresh one tab in Tabbedpanel instead of whole page?
Posted by Martin Gainty <mg...@hotmail.com>.
while constructing your form *presumably* with html:form be sure to specify
method= attribute here is the 1.x Taglib doc
http://struts.apache.org/1.x/struts-taglib/tlddoc/html/form.html
the 2.x Taglib doc
http://struts.apache.org/2.x/docs/form.html
HTH/
M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed. If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy. Thank you.
----- Original Message -----
From: "Jason Wyatt" <jw...@itree.com.au>
To: "'Struts Users Mailing List'" <us...@struts.apache.org>
Sent: Tuesday, May 15, 2007 8:36 PM
Subject: RE: [S2] How to refresh one tab in Tabbedpanel instead of whole
page?
> Hi Marco,
>
> I tried using the code template you gave, but couldn't get it to do a
> *form
> submit* to the action... It just seems to just do a GET without form
> parameters. Does it do a form submit for you?
>
> Sorry, I mightn't have been clear... I wanted to *submit a form* inside a
> tab to that tab's Action, then have the tab load the updated contents.
>
> For example, say I have a tab that searches for employees. I fill out the
> search criteria then press "Search". I want the search form to be
> submitted
> to the employeeSearchAction, then the search tab to be refreshed with the
> list of employees, without loading the whole page.
>
> So far I've only been able to either just "refresh" a tab with some URL
> (without the form submitting), or submit a form and refresh the whole
> page.
> I haven't got both the form to submit correctly and then only that tab to
> refresh.
>
> It would be great if this is possible!
>
> Thanks
> Jason
>
>
>
> -----Original Message-----
> From: Marco Carnevale [mailto:marco.carnevale@gmail.com]
> Sent: Wednesday, 16 May 2007 2:29 AM
> To: Struts Users Mailing List
> Subject: Re: [S2] How to refresh one tab in Tabbedpanel instead of whole
> page?
>
> I am doing this on my project. The tab refreshes when the user selects a
> button.
>
> 1) You should know the div name for the tab you are interested in. In
> this
> example the div name is: myTabDivId
>
> <s:url id="myUrl" action="/MyAction"/>
> <s:tabbedPanel id="myTabs" name="myTabs" selectedTab="%{activeCaseTab}">
> <s:div id="myTabDivId" href="%{myUrl}" theme="ajax" label="The Tabs
> Name" /> </s:tabbedPanel>
>
> 2) You need a URL to submit to when the button is pressed that returns the
> contents (i.e. tile) of the tab (this may be the same as the url in step
> 1)
>
> <s:url id="refreshURL" action="/RefreshAction" />
>
> 3) You need to turn on th ajax on the button and specify the tab div id
> that
> you want to replace.
>
> <s:submit key="button.add" theme="ajax" targets="myTabDivId"
> disabled="false"
> href="%{refreshURL}" />
>
> Marco
>
>
>
> On 5/15/07, Musachy Barroso <mu...@gmail.com> wrote:
>>
>> If you put a whole tabbedpanel inside a remote div, then you can
>> reload it anytime you want.
>>
>> regards
>> musachy
>>
>> On 5/15/07, Jason Wyatt <jw...@itree.com.au> wrote:
>> >
>> > Hi, we're using the Struts 2 tabbedpanel tag. One problem we're
>> > having
>> is
>> > that whenever we do a submit from within a tab, we to reload the
>> > same
>> tab
>> > with the results.
>> >
>> > At the moment we our submit button posts to an XAction mentioned in
>> > the <s:div> tag for the given X tab.
>> >
>> > The XAction returns a TabsResult that causes the main.jsp page
>> containing
>> > the tabbedpanel to be loaded.
>> >
>> > The main.jsp page causes the XAction related the given X tab to be
>> > hit again, this time to load the contents of the tab.
>> >
>> > The XAction returns a different TabXResult, causing a related
>> > Xtab.jspto be loaded and displayed in the <s:div> layer.
>> >
>> > This works ok for one layer of tabs... we now want nested layers,
>> > which
>> is
>> > looking like a complex problem.
>> >
>> > Is there an easier solution, that can maybe just reload the specific
>> tab's
>> > <s:div> layer with the result of the XAction? That would be most
>> > excellent.
>> >
>> >
>> > Thanks in advance, regards
>> >
>> > Jason
>> >
>> >
>> > -----
>> > Falun Dafa Truth - Compassion - Forbearance
>> >
>> > A mind & body practice under persecution in China
>> >
>> > <http://www.faluninfo.net/> http://www.faluninfo.net
>> >
>> >
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: [S2] How to refresh one tab in Tabbedpanel instead of whole page?
Posted by Jason Wyatt <jw...@itree.com.au>.
Hi Marco,
I tried using the code template you gave, but couldn't get it to do a *form
submit* to the action... It just seems to just do a GET without form
parameters. Does it do a form submit for you?
Sorry, I mightn't have been clear... I wanted to *submit a form* inside a
tab to that tab's Action, then have the tab load the updated contents.
For example, say I have a tab that searches for employees. I fill out the
search criteria then press "Search". I want the search form to be submitted
to the employeeSearchAction, then the search tab to be refreshed with the
list of employees, without loading the whole page.
So far I've only been able to either just "refresh" a tab with some URL
(without the form submitting), or submit a form and refresh the whole page.
I haven't got both the form to submit correctly and then only that tab to
refresh.
It would be great if this is possible!
Thanks
Jason
-----Original Message-----
From: Marco Carnevale [mailto:marco.carnevale@gmail.com]
Sent: Wednesday, 16 May 2007 2:29 AM
To: Struts Users Mailing List
Subject: Re: [S2] How to refresh one tab in Tabbedpanel instead of whole
page?
I am doing this on my project. The tab refreshes when the user selects a
button.
1) You should know the div name for the tab you are interested in. In this
example the div name is: myTabDivId
<s:url id="myUrl" action="/MyAction"/>
<s:tabbedPanel id="myTabs" name="myTabs" selectedTab="%{activeCaseTab}">
<s:div id="myTabDivId" href="%{myUrl}" theme="ajax" label="The Tabs
Name" /> </s:tabbedPanel>
2) You need a URL to submit to when the button is pressed that returns the
contents (i.e. tile) of the tab (this may be the same as the url in step 1)
<s:url id="refreshURL" action="/RefreshAction" />
3) You need to turn on th ajax on the button and specify the tab div id that
you want to replace.
<s:submit key="button.add" theme="ajax" targets="myTabDivId"
disabled="false"
href="%{refreshURL}" />
Marco
On 5/15/07, Musachy Barroso <mu...@gmail.com> wrote:
>
> If you put a whole tabbedpanel inside a remote div, then you can
> reload it anytime you want.
>
> regards
> musachy
>
> On 5/15/07, Jason Wyatt <jw...@itree.com.au> wrote:
> >
> > Hi, we're using the Struts 2 tabbedpanel tag. One problem we're
> > having
> is
> > that whenever we do a submit from within a tab, we to reload the
> > same
> tab
> > with the results.
> >
> > At the moment we our submit button posts to an XAction mentioned in
> > the <s:div> tag for the given X tab.
> >
> > The XAction returns a TabsResult that causes the main.jsp page
> containing
> > the tabbedpanel to be loaded.
> >
> > The main.jsp page causes the XAction related the given X tab to be
> > hit again, this time to load the contents of the tab.
> >
> > The XAction returns a different TabXResult, causing a related
> > Xtab.jspto be loaded and displayed in the <s:div> layer.
> >
> > This works ok for one layer of tabs... we now want nested layers,
> > which
> is
> > looking like a complex problem.
> >
> > Is there an easier solution, that can maybe just reload the specific
> tab's
> > <s:div> layer with the result of the XAction? That would be most
> > excellent.
> >
> >
> > Thanks in advance, regards
> >
> > Jason
> >
> >
> > -----
> > Falun Dafa Truth - Compassion - Forbearance
> >
> > A mind & body practice under persecution in China
> >
> > <http://www.faluninfo.net/> http://www.faluninfo.net
> >
> >
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2] How to refresh one tab in Tabbedpanel instead of whole page?
Posted by Marco Carnevale <ma...@gmail.com>.
I am doing this on my project. The tab refreshes when the user selects a
button.
1) You should know the div name for the tab you are interested in. In this
example the div name is: myTabDivId
<s:url id="myUrl" action="/MyAction"/>
<s:tabbedPanel id="myTabs" name="myTabs" selectedTab="%{activeCaseTab}">
<s:div id="myTabDivId" href="%{myUrl}" theme="ajax" label="The Tabs
Name" />
</s:tabbedPanel>
2) You need a URL to submit to when the button is pressed that returns the
contents (i.e. tile) of the tab (this may be the same as the url in step 1)
<s:url id="refreshURL" action="/RefreshAction" />
3) You need to turn on th ajax on the button and specify the tab div id that
you want to replace.
<s:submit key="button.add" theme="ajax" targets="myTabDivId" disabled="false"
href="%{refreshURL}" />
Marco
On 5/15/07, Musachy Barroso <mu...@gmail.com> wrote:
>
> If you put a whole tabbedpanel inside a remote div, then you can reload it
> anytime you want.
>
> regards
> musachy
>
> On 5/15/07, Jason Wyatt <jw...@itree.com.au> wrote:
> >
> > Hi, we're using the Struts 2 tabbedpanel tag. One problem we're having
> is
> > that whenever we do a submit from within a tab, we to reload the same
> tab
> > with the results.
> >
> > At the moment we our submit button posts to an XAction mentioned in the
> > <s:div> tag for the given X tab.
> >
> > The XAction returns a TabsResult that causes the main.jsp page
> containing
> > the tabbedpanel to be loaded.
> >
> > The main.jsp page causes the XAction related the given X tab to be hit
> > again, this time to load the contents of the tab.
> >
> > The XAction returns a different TabXResult, causing a related Xtab.jspto
> > be
> > loaded and displayed in the <s:div> layer.
> >
> > This works ok for one layer of tabs... we now want nested layers, which
> is
> > looking like a complex problem.
> >
> > Is there an easier solution, that can maybe just reload the specific
> tab's
> > <s:div> layer with the result of the XAction? That would be most
> > excellent.
> >
> >
> > Thanks in advance, regards
> >
> > Jason
> >
> >
> > -----
> > Falun Dafa Truth - Compassion - Forbearance
> >
> > A mind & body practice under persecution in China
> >
> > <http://www.faluninfo.net/> http://www.faluninfo.net
> >
> >
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
Re: [S2] How to refresh one tab in Tabbedpanel instead of whole page?
Posted by Musachy Barroso <mu...@gmail.com>.
If you put a whole tabbedpanel inside a remote div, then you can reload it
anytime you want.
regards
musachy
On 5/15/07, Jason Wyatt <jw...@itree.com.au> wrote:
>
> Hi, we're using the Struts 2 tabbedpanel tag. One problem we're having is
> that whenever we do a submit from within a tab, we to reload the same tab
> with the results.
>
> At the moment we our submit button posts to an XAction mentioned in the
> <s:div> tag for the given X tab.
>
> The XAction returns a TabsResult that causes the main.jsp page containing
> the tabbedpanel to be loaded.
>
> The main.jsp page causes the XAction related the given X tab to be hit
> again, this time to load the contents of the tab.
>
> The XAction returns a different TabXResult, causing a related Xtab.jsp to
> be
> loaded and displayed in the <s:div> layer.
>
> This works ok for one layer of tabs... we now want nested layers, which is
> looking like a complex problem.
>
> Is there an easier solution, that can maybe just reload the specific tab's
> <s:div> layer with the result of the XAction? That would be most
> excellent.
>
>
> Thanks in advance, regards
>
> Jason
>
>
> -----
> Falun Dafa Truth - Compassion - Forbearance
>
> A mind & body practice under persecution in China
>
> <http://www.faluninfo.net/> http://www.faluninfo.net
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd