You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vinicius Medeiros Peretti <vi...@peretti.eti.br> on 2007/11/01 19:28:38 UTC
Re: Submit button property in ajax not sends value to action.
Thanks very much, this is the way!
But I think that the property of submit button should be posted.
Thanks,
Vinicius
Jeromy Evans wrote:
> I've read somewhere, but can't find the reference, that you're correct
> that dojo doesn't post the value of the submit button with XHR.
>
> Instead, I always post to different methods in the action - one for
> each submit button.
>
> eg.
> <s:submit name="valueButton" theme="ajax" targets="%{target}"
> action="SomeActionMethodA" value="some"/>
> <s:submit name="valueButton" theme="ajax" targets="%{target}"
> action="SomeActionMethodB" value="other"/>
>
> with the corresponding wildcard in struts.xml:
>
> <action name="SomeAction*" method="{1}"...
>
> and two methods in your action:
>
> public String methodA() {}
> public String methodB() {}
>
> Hope that helps.
>
> regards,
> Jeromy Evans
>
> Vinicius Medeiros Peretti wrote:
>> When I submit a form, in a div using theme="ajax", the value of
>> property of submit button not goes to Action.
>>
>> E.g.
>>
>> <s:form
>> action="SomeAction"
>> method="post"
>> theme="ajax"
>> target="%{target}">
>> <s:submit
>> name="valueButton"
>> theme="ajax"
>> targets="%{target}"
>> value="some"/>
>> <s:submit
>> name="valueButton"
>> theme="ajax"
>> targets="%{target}"
>> value="other"/>
>> </s:form>
>>
>> If I click in "some" or "other", I want to get the value by
>> getValueButton().
>> But it not works. Any way to do this?
>>
>> regards,
>> Vinicius
>>
>> ---------------------------------------------------------------------
>> 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: Submit button property in ajax not sends value to action.
Posted by Musachy Barroso <mu...@gmail.com>.
Fixed on 2.1:
https://issues.apache.org/struts/browse/WW-1930
musachy
On 11/1/07, Vinicius Medeiros Peretti <vi...@peretti.eti.br> wrote:
> Thanks very much, this is the way!
> But I think that the property of submit button should be posted.
>
> Thanks,
>
> Vinicius
>
> Jeromy Evans wrote:
> > I've read somewhere, but can't find the reference, that you're correct
> > that dojo doesn't post the value of the submit button with XHR.
> >
> > Instead, I always post to different methods in the action - one for
> > each submit button.
> >
> > eg.
> > <s:submit name="valueButton" theme="ajax" targets="%{target}"
> > action="SomeActionMethodA" value="some"/>
> > <s:submit name="valueButton" theme="ajax" targets="%{target}"
> > action="SomeActionMethodB" value="other"/>
> >
> > with the corresponding wildcard in struts.xml:
> >
> > <action name="SomeAction*" method="{1}"...
> >
> > and two methods in your action:
> >
> > public String methodA() {}
> > public String methodB() {}
> >
> > Hope that helps.
> >
> > regards,
> > Jeromy Evans
> >
> > Vinicius Medeiros Peretti wrote:
> >> When I submit a form, in a div using theme="ajax", the value of
> >> property of submit button not goes to Action.
> >>
> >> E.g.
> >>
> >> <s:form
> >> action="SomeAction"
> >> method="post"
> >> theme="ajax"
> >> target="%{target}">
> >> <s:submit
> >> name="valueButton"
> >> theme="ajax"
> >> targets="%{target}"
> >> value="some"/>
> >> <s:submit
> >> name="valueButton"
> >> theme="ajax"
> >> targets="%{target}"
> >> value="other"/>
> >> </s:form>
> >>
> >> If I click in "some" or "other", I want to get the value by
> >> getValueButton().
> >> But it not works. Any way to do this?
> >>
> >> regards,
> >> Vinicius
> >>
> >> ---------------------------------------------------------------------
> >> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org