You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kartik Kumar <kr...@gmail.com> on 2010/05/01 01:11:49 UTC
Struts2 - Ajax submit not working: Please advise
Hi All,
I am experiencing some issues with ajax submit with Struts2. I am trying to
do an asynchronous post to an action class that will make a crud call and
return back the html page with the updated input value. I am able to get the
result when posting to form action without using ajax.
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<s:head theme="ajax" debug="true"/>
</head>
<body>
<s:div id="updateDiv" theme="ajax">
<s:text name="Welcome : " />
<s:property value="#session['auth'].fullName" />
<table>
<tr><td><s:actionerror/><s:fielderror /></td></tr>
<s:form name="updateStatus" action="action_item_update"
validate="true">
<tr>
<td><s:select name="actionStatus" headerKey=""
headerValue="Change Status" list="statuses" />
</td>
<td><s:hidden name="id" /></td>
<td> <s:submit theme="ajax" name="update" value="Update"
notifyTopics="/action_item_update" targets="updateDiv"/> </td>
</tr>
</s:form>
</table>
</s:div>
</body>
</html>
When I remove all ajax related attributes from <s:submit .... /> tag, then
the application is submitted without any issues, but not when using Ajax
submission. On my form, I see the following:
Action Item List
DEBUG: widget ID collision on ID: action_item_update_update
On submission, I see the following error:
Action Item List
[object Error]
DEBUG: widget ID collision on ID: action_item_update_update
Action Item List
DEBUG: widget ID collision on ID: updateDiv
The form parameters are always null on ajax submit. Can anyone tell me what
I am doing wrong? Any help would be appreciated.
Re: Struts2 - Ajax submit not working: Please advise
Posted by jayakarjayaraman <ja...@yahoo.co.in>.
hi,
Even i was getting the same error. I hosted my application in firefox and
the submit was successful and even the result was showing.
Then i tried hosting the application in IE version 8,it was working fine.
I hope u r trying to host application in IE version 7.
Still i am not able to trace out why its not working in IE 7. any one knows
please reply.
--
View this message in context: http://struts.1045723.n5.nabble.com/Struts2-Ajax-submit-not-working-Please-advise-tp3495486p4613051.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org