I am still having this problem. Did any one went through some thing similar when using ajax to submit a form from a link or a submit Button and when used notifyTopic ?

The problem is that the form fields are never populated in the action ! Any help ?


Mansour wrote:
No, I can not see any thing logged. Here' the whole JSP. it should give you an idea about what I am doing. I am trying to save/update an account and run a JS to disable the inputs.


<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://displaytag.sf.net"; prefix="display"%>

<s:head theme="ajax" debug="true"></s:head>

<script type="text/javascript">
function disableInputs(flag)
{
if (flag == 'null') flag = true;
var inputs = document.getElementById("data_table");
inputs = inputs.getElementsByTagName('input');
for ( i = 0 ;i < inputs.length ; i++ )
   inputs[i].disabled = flag ;
}

function showMessage(){
   alert('test message!');
   disableInputs(true);
   }
</script>

<!-- show the account details -->

<table id="data_table" >
   <s:form id="MyData" action="/updateAccount.action"   >
       <tr>
           <td><s:label value="AccId:" /></td>
           <td><s:property value="acc.id" />
<s:hidden name="acc.id" value="${acc.id}" id="acc.id" /></td>
       </tr>

       <tr>
           <td><s:label value="First Name" /></td>
           <td><s:textfield name="acc.firstName" disabled="true"
               value="${acc.firstName}" /></td>
       </tr>
       <tr>
           <td><s:label value="Last Name: " /></td>
           <td><s:textfield name="acc.lastName" disabled="true"
               value="%{acc.lastName}" /></td>
       </tr>
       <tr>
       <td>
<s:submit href="/updateAccount.action" value="Save from inside the form w/o ajax" > </s:submit>
             </td>
       </tr>
         </s:form>

</table>

<hr />

<script type="text/javascript" language="javascript">
dojo.event.topic.subscribe("/disableAll" , function(data, type, request) {
 showMessage();
});
</script>

<table>
   <tr>
<td><s:a href="javascript://" onclick="disableInputs(false);">edit</s:a>
       <td><s:url id="ajaxSubmit" value="/updateAccount.action" ></s:url>
       <s:submit  href="%{ajaxSubmit}"   notifyTopics="/disableAll"
           theme="ajax" formId="MyData" > save </s:submit>
        </td>
   </tr>
</table>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to