You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Peter Theissen <pe...@web.de> on 2008/04/03 18:46:08 UTC
Problem with submitting an additional param in a form
Hello everbody,
I'm new to Struts2 and also this mailing list.
I'm programming a user management for a non-profit organisation.
My question is now:
I have started with the basic struts2 application. In the index.jsp
there is a form which looks (nearly) like this:
>>>
<s:form action="saveReg" validate="true">
<s:param name="status" value="waiting" />
<s:textfield id="id" name="registration.id"
cssStyle="display:none"/>
<s:textfield id="firstName" label="First Name"
name="registration.firstName"/>
<s:textfield id="lastName" label="Laste Name"
name="registration.lastName"/>
<s:textfield id="email" label="Email"
name="registration.email"/>
<s:submit theme="ajax" targets="registrations"
notifyTopics="/save"/>
</s:form>
<<<
Why cant I append the paramter 'status' and pass it through to the
action class?
I read a lot of docs and faqs but didnt find the answer.
Is it my mistake, a bug or do I need a certain workaround?
I thought about taking a display:none textfield, but it would make me
quite unhappy to start the project with dirty tricks and workarounds ;-)
Any help appreciated.
Best regards
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Problem with submitting an additional param in a form
Posted by Ryan <gr...@gmail.com>.
I think what you are looking for is:
<s:hidden name="status" value="waiting" />
This creates a hidden input field in the form which then passes the "status"
parameter to the request when the form submits.
On 4/3/08, Peter Theissen <pe...@web.de> wrote:
>
> Hello everbody,
>
> I'm new to Struts2 and also this mailing list.
> I'm programming a user management for a non-profit organisation.
>
> My question is now:
> I have started with the basic struts2 application. In the index.jsp
> there is a form which looks (nearly) like this:
> >>>
> <s:form action="saveReg" validate="true">
> <s:param name="status" value="waiting" />
> <s:textfield id="id" name="registration.id" cssStyle="display:none"/>
> <s:textfield id="firstName" label="First Name"
> name="registration.firstName"/>
> <s:textfield id="lastName" label="Laste Name"
> name="registration.lastName"/>
> <s:textfield id="email" label="Email"
> name="registration.email"/>
> <s:submit theme="ajax" targets="registrations"
> notifyTopics="/save"/>
> </s:form>
> <<<
> Why cant I append the paramter 'status' and pass it through to the action
> class?
> I read a lot of docs and faqs but didnt find the answer.
> Is it my mistake, a bug or do I need a certain workaround?
> I thought about taking a display:none textfield, but it would make me
> quite unhappy to start the project with dirty tricks and workarounds ;-)
>
> Any help appreciated.
>
> Best regards
> Peter
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>