Multiple event parameters [update, updateForm]

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple event parameters [update, updateForm]

Urmila
Hello All,

I have been struggling to get this through. I have a requirement where I have a data entry form (jsp) which is attached to an actionbean. To show the jsp I call event updateForm and from the JSP onsubmit update event should be called. But I always get this exception: net.sourceforge.stripes.exception.StripesRuntimeException: Multiple event parameters [update, updateForm]

Code snippets below:

      <sy:tab label="DB Lookup" href="#dblookup">
                <s:url var="url" beanclass="com.xyz.abc.stripes.action.profile.AttributeDBConfigureActionBean" event="updateForm" prependContext="false">
                <s:param name="profile" value="${actionBean.profile}" />
                </s:url>
                <c:import url="${url}" />
            </sy:tab>

ActionBean EventHandlers:

    /*
     * Event handlers
     */
    @DefaultHandler
    @HandlesEvent("update")
    public Resolution update() {
        doSave();

        if (getContext().getMessages().isEmpty()) {
            getContext().getMessages().add(new LocalizableMessage("message.updated"));
        }
        return new ForwardResolution("/WEB-INF/jsp/profile/dbconfigure.jsp");
    }
  
    @DontValidate
    public Resolution updateForm() {
       return new ForwardResolution("/WEB-INF/jsp/profile/dbconfupdate.jsp");
    }

jsp file:

<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/taglibs.jsp"%>
<div><s:form beanclass="com.xyz.abc.stripes.action.profile.AttributeDBConfigureActionBean" onsubmit="return Ajax.Form.submit(this);" method= "POST" id="ConfigForm" style="text-align: left; margin: 0;">
.
.
.
.
<div><s:submit name="update" value="Update" style="width: 100px;" />
</div>
</s:form>
</div>

Is there any way where I can manipulate the request param, so that only the latest event is included in the request and all previous events are overwritten?

Any leads on this is greatly appreciated.

Thanks In Advance,
Urmila

------------------------------------------------------------------------------
WINDOWS 8 is here.
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Multiple event parameters [update, updateForm]

Shawn Church-5
Maybe do a RedirectResolution in updateForm, rather than a  
ForwardResolution?  You would have to first get the "profile"  
parameter from the request, and then add it as a new parameter to the  
RedirectResolution before returning if you need it in dbconfupdate.jsp.

Shawn

Quoting Urmila Vepa <[hidden email]>:

> Hello All,
>
> I have been struggling to get this through. I have a requirement where I
> have a data entry form (jsp) which is attached to an actionbean. To show
> the jsp I call event updateForm and from the JSP onsubmit update event
> should be called. But I always get this exception:
> net.sourceforge.stripes.exception.StripesRuntimeException: Multiple event
> parameters [update, updateForm]
>
> *Code snippets below:*
>
>       <sy:tab label="DB Lookup" href="#dblookup">
>                 <s:url var="url"
> beanclass="com.xyz.abc.stripes.action.profile.AttributeDBConfigureActionBean"
> event="updateForm" prependContext="false">
>                 <s:param name="profile" value="${actionBean.profile}" />
>                 </s:url>
>                 <c:import url="${url}" />
>             </sy:tab>
>
> *ActionBean EventHandlers:
> *
>     /*
>      * Event handlers
>      */
>     @DefaultHandler
>     @HandlesEvent("update")
>     public Resolution update() {
>         doSave();
>
>         if (getContext().getMessages().isEmpty()) {
>             getContext().getMessages().add(new
> LocalizableMessage("message.updated"));
>         }
>         return new
> ForwardResolution("/WEB-INF/jsp/profile/dbconfigure.jsp");
>     }
>
>     @DontValidate
>     public Resolution updateForm() {
>        return new
> ForwardResolution("/WEB-INF/jsp/profile/dbconfupdate.jsp");
>     }
>
> *jsp file:*
>
> <%@page language="java" contentType="text/html; charset=UTF-8"
> pageEncoding="UTF-8"%>
> <%@include file="/taglibs.jsp"%>
> <div><s:form
> beanclass="com.xyz.abc.stripes.action.profile.AttributeDBConfigureActionBean"
> onsubmit="return Ajax.Form.submit(this);" method= "POST" id="ConfigForm"
> style="text-align: left; margin: 0;">
> .
> .
> .
> .
> <div><s:submit name="update" value="Update" style="width: 100px;" />
> </div>
> </s:form>
> </div>
>
> Is there any way where I can manipulate the request param, so that only the
> latest event is included in the request and all previous events are
> overwritten?
>
> Any leads on this is greatly appreciated.
>
> Thanks In Advance,
> Urmila
>



------------------------------------------------------------------------------
WINDOWS 8 is here.
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users