You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Lars Bergström <la...@systeam.se> on 2003/09/26 16:40:05 UTC

LookupDispatchAction and submit

Hi everyone,
 
I have a <html:form> in which i have several buttons like this:
 
        <html:submit property="actionType">
          <bean:message key="button.add"/>
        </html:submit>
        <html:submit property="actionType">
          <bean:message key="button.delete"/>
        </html:submit>
        <html:submit property="actionType">
          <bean:message key="button.update"/>
        </html:submit>
 
With the help of this I use the LookupDispatchAction which my Action
class extends. This works fine for my submit buttons.
 
My action-mapping
 
    <action path="/MyAction"
            type="com.mycompany.MyAction"
            name="myBean"
            parameter="actionType">
      <forward name="input" path="/pages/myPage.jsp"/>
    </action>

 
However, I also have a <html:text property="propKey" size="55"/> in the
same <html:form>. When the text field has focus and I press enter the
LookupDispatchAction does not work.This because the execute method of
LookupDispatchAction does not receive any value in the parameter
actionType. Is this a trap, that LookupDispatchAction cannot handle this
particular case?
 
Best regards
 
Lasse
 
 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: LookupDispatchAction and submit

Posted by Jan Van Stalle <ja...@skynet.be>.
Hello,

did you try putting a hidden input in your form with the name actionType and
a default value (which would map to one of your methods).

Jan

"Lars Bergstr�m" <la...@systeam.se> wrote in message
news:E063C59E91313E47ADBF1DD4E848B5CB5E5916@infomail.igpdn1.infogrator.se...
> Hi everyone,
>
> I have a <html:form> in which i have several buttons like this:
>
>         <html:submit property="actionType">
>           <bean:message key="button.add"/>
>         </html:submit>
>         <html:submit property="actionType">
>           <bean:message key="button.delete"/>
>         </html:submit>
>         <html:submit property="actionType">
>           <bean:message key="button.update"/>
>         </html:submit>
>
> With the help of this I use the LookupDispatchAction which my Action
> class extends. This works fine for my submit buttons.
>
> My action-mapping
>
>     <action path="/MyAction"
>             type="com.mycompany.MyAction"
>             name="myBean"
>             parameter="actionType">
>       <forward name="input" path="/pages/myPage.jsp"/>
>     </action>
>
>
> However, I also have a <html:text property="propKey" size="55"/> in the
> same <html:form>. When the text field has focus and I press enter the
> LookupDispatchAction does not work.This because the execute method of
> LookupDispatchAction does not receive any value in the parameter
> actionType. Is this a trap, that LookupDispatchAction cannot handle this
> particular case?
>
> Best regards
>
> Lasse




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org