You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andrew Madu <an...@gmail.com> on 2006/07/13 02:51:21 UTC

Entire page being re-written between DIV tags after dojo/ajax/Cform submit

Hi,
I have finally started get this dojo thing working, to a degree! The problem
I am having at the moment is that after a form is submitted the entire page
is re-written to the div tag I have assigned to hold the returned results,
instead of just the form (widgets) section. My code is as follows:

my Dojo.js:
dojo.require("dojo.io.*");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.*");

function init()
{
    var x = new dojo.io.FormBind({

    formNode: "Form1",

    load: function(load, data, e) {
      dojo.byId('output').innerHTML = data;
    },

    error: function(type, error) {
        alert("Error: " + type + "n" + error);
    }
  });
}
dojo.addOnLoad(init);

myCForm.jx:
    <jx:import uri="resource://org/apache/cocoon/forms/generation/jx-
macros.xml"/>
    <tableR>
      <ft:form-template action="details.kont" id="Form1" method="post"
ajax="true">
        <ft:continuation-id/>
        <ft:group id="creditCardDetails">
        <div id="output">
            <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="55" valign="bottom"><img
src="images/firstname.gif" width="89" height="16" /></td>
                      <td width="220" valign="top" align="left">
                              <fi:styling type="tabs"/>
                                  <fi:state>
                                        <ft:widget id="fname">
                                            <fi:styling listbox-size="22"
class="keyinbox" value="${userGlobal.getFirstName()}"/>
                                        </ft:widget>
                                  </fi:state>
                      </td>
                    </tr>
                </table></td>
            </tr>
......
            <tr><td><input type="submit" name="send" value="Send"
/></td></tr>

</div>
</ft:group>

As I mentioned earlier, the sumitted results are being returned correctly,
it's just that it is being returned with the rest of the page as well, so
every time I click submit I get the page re-written inside itself again,
when all I want is the form area to be re-displayed. How do I remedy this
situation?

Also I have noticed that the next process in flow after the form, which is a
cocoon.sendPageAndWait("orderSuccess.xml", {"OrderDetails":neworder}),  has
successfully been submitted also loads in the DIV tag instead of instead of
in the window. What is the issue with this as well?
regards

Andrew