Just to add more info, here's an example:

jsp:

 <stripes:form class="com.home.ui.action.services.ExampleActionBean"
name="multipleElements" action="post">
       <p>
            name: <stripes:text name="name"/>
       </p>
       <p>
           <stripes:submit name="hello" value="hello" class="btn"/>
           <stripes:submit name="goodbye" value="goodbye" class="btn"/>
       </p>
   </stripes:form>

html:

<form action="post"
class="com.home.ui.action.services.ExampleActionBean"
name="multipleElements" method="post">
       <p>
            name: <input type="text" name="name" />
       </p>
       <p>

           <input value="hello" type="submit" class="btn" name="hello" />
           <input value="goodbye" class="btn" name="goodbye" />
       </p>
  <!--removed hidden soruce page element-->
</form>

action bean:

 public String name;

    public Resolution hello(){
        getContext().getMessages().add(new SimpleMessage("hello " + name));

        return new RedirectResolution(WelcomeActionBean.class,"view");
    }
    public Resolution goodbye(){
        getContext().getMessages().add(new SimpleMessage("goodbye " +
name));
        return new RedirectResolution(WelcomeActionBean.class,"view");
    }

Results in:

WARN  net.sourceforge.stripes.exception.DefaultExceptionHandler  -
Unhandled exception caught by the Stripes default exception handler.
net.sourceforge.stripes.exception.StripesRuntimeException: Multiple
event parameters [hello, goodbye] are present in this request. Only
one event parameter may be specified per request. Otherwise, Stripes
would be unable to determine which event to execute.

It was my understanding that multiple submit events could be rendered
and only the submit 'clicked' would be past to the action bean.

cheers,
Phil

On Wed, Jul 22, 2009 at 10:30 AM, phil
darley<[email protected]> wrote:
> Hi,
>
> If I try and add multiple submit buttons on one form only the first
> submit is rendered correctly, the others have the
> 'type="submit"attribute missing on the html element. Has anybody come
> across this before?
>
> Cheers,
> Phil
>

------------------------------------------------------------------------------
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to