sj:submit with href and/or formIds outside of form

552 views
Skip to first unread message

CranCran77

unread,
Jun 1, 2011, 1:09:51 PM6/1/11
to struts2...@googlegroups.com
In my JSP I have a hidden form defined such as:

<s:form action="displayOverview"><s:param name="r" value="%{rid}"/><s:param name="sid" value="%{sid}"/></s:form>

And then I have a button my page like as follows:
<sj:submit key="button.overview" formIds="displayOverview" />

This used to automatically submit that form's data to the action URL; however this is no longer working.   How do I use the sj:submit much like a regular submit where I want to specify the form contents to serialize, the destination href or action url and have it refresh the entire page?

CranCran77

unread,
Jun 1, 2011, 1:18:17 PM6/1/11
to struts2...@googlegroups.com
Appears to be an issue when "targets" attribute isn't defined and a javascript error is thrown.

jogep

unread,
Jun 1, 2011, 1:58:51 PM6/1/11
to struts2-jquery
I think this is fixed in current trunk and SNAPSHOT.

It is related to this Issue:
http://code.google.com/p/struts2-jquery/issues/detail?id=533

Johannes
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

CranCran77

unread,
Jun 1, 2011, 2:22:50 PM6/1/11
to struts2...@googlegroups.com
How do I get the latest JARs?

jogep

unread,
Jun 1, 2011, 2:27:38 PM6/1/11
to struts2-jquery

CranCran77

unread,
Jun 1, 2011, 4:20:29 PM6/1/11
to struts2...@googlegroups.com
I just downloaded the Jun 01 snapshot and this is still an issue.  Firebug still reports that o.targets is undefined.  This property is not suppose to be required based on the java documentation but it appears that since upgrading from 2.5.3 that it's being required to avoid javascript errors so the jquery functionality works.

CranCran77

unread,
Jun 1, 2011, 4:39:43 PM6/1/11
to struts2...@googlegroups.com
Another example of my usage of the sj:submit tag is as follows:

<s:url id="servicesUrl" action="createWarrantyServiceTier"><s:param name="warrantyId" value="%{id}"/></s:url>
<sj:submit id="addService" key="button.add" openDialog="servicesDialog" href="%{servicesUrl}" />

The simple example above is erroring with o.targets is undefined.  Furthermore, the above scenario would allow me to open the sj:dialog by its id and because I wanted this dialog's content to be dynamic, the href parameter on the button controlled where the dialog was suppose to get its content.

Am I using the framework incorrectly or am I just experiencing issues with the 3.1 06/01/2011 snapshot?

jogep

unread,
Jun 2, 2011, 5:38:56 AM6/2/11
to struts2-jquery
Do you have cleared your browser caches after upgrading?

Can you please set compressed to false in your head tag and
send me the line where the error happens?

Chris Cranford

unread,
Jun 2, 2011, 9:34:20 AM6/2/11
to struts2...@googlegroups.com
On Thu, Jun 2, 2011 at 4:38 AM, jogep <joh...@googlemail.com> wrote:
> Do you have cleared your browser caches after upgrading?
Yes

> Can you please set compressed to false in your head tag and
> send me the line where the error happens?

Line #949 of jquery.struts2-3.0.2.js.

Chris

Chris Cranford

unread,
Jun 2, 2011, 9:35:20 AM6/2/11
to struts2...@googlegroups.com

The error message is as follows:

o.targets is undefined
$.each(o.targets.split(','),function(i,t) {

CranCran77

unread,
Jun 6, 2011, 9:49:10 AM6/6/11
to struts2-jquery
Any update?

jogep

unread,
Jun 7, 2011, 4:11:33 PM6/7/11
to struts2-jquery
Sorry, I was some days unavailable.

Please try the updated SNAPSHOT. The Problem should be fixed.
On Jun 6, 3:49 pm, CranCran77 <cranc...@gmail.com> wrote:
> Any update?
Reply all
Reply to author
Forward
0 new messages