> -----Original Message-----
> From: Bailey, Shane C. [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 03, 2003 8:23 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Reusing the same HTML Form for many actions
>
>
>
> I would do something a little more code but less confusing.
> This is just a guess I don't have this working:
>

I have completely different measure: it is less code but it is more
confusing.

Why should I use the same action for making two completely different things?
Isn't it more clear IMHO  to make separate action for each "command".

I would really like to use forms as a black box components which can be
configured.
(e.g. associated with different actions).

Is it possible?

Michal


> JSP:
> <html:form action="/addOrUpdateUser" >
>
> <html:hidden property="todo" value="<set this how you want>" />
> the value above is which method in your DispatchAction to go to
> as in add or
> update.
>
>
> struts config:
>     <action    path="/addOrUpdateUser"
>           parameter="todo"
>           type="my.web.action.AddUpdateUserAction" <--extends
> DispatchAction
>           name="updateUserForm"
>           input="doc.userForm"
>           validate="true"
>           scope="request">
>           <forward name="showUserForm"  path="doc.UserForm"/>
>           <forward name="showConfirm"  path="doc.updateUserConfirm"/>
>     </action>
>
>
>
> Action class:
> class AddUpdateUserAction extends DispatchAction
> {
>
>
> public ActionForward add(...)
> {
>       //code for adding a user
> }
>
> public ActionForward update(...)
> {
>       //code for adding a user
> }
>
>
> }
>
>
>
>
> -----Original Message-----
> From: Michal Maczka [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 03, 2003 1:21 PM
> To: [EMAIL PROTECTED]
> Subject: Reusing the same HTML Form for many actions
>
> Can somebody explain me what is the best practice if I want to
> use the same
> form (JSP page/fragment)
> for executing different action.
>
> For example I want to have "add" and "edit" action which will be processed
> differently,
> but the form for entering data will be the same.
>
> I tried to use form as >>Tiles<< and do something like:
>
> <html:form action="<tiles:getAsString name="action"/>" focus="name"
> onsubmit="return validateXXForm(this)">
>
> but this does not seems to works.
>
> any suggestions?
>
> Michal
>
>
>
>
> ---------------------------------------------------------------------
> 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]
>
>
> ----------------------------------------------------------------------
> Sportowy portal INTERIA.PL >>> http://link.interia.pl/f1730
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to