cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dev at weitling <>
Subject Weird CForms/Ajax errors
Date Thu, 15 Feb 2007 14:34:33 GMT
as with my little daughter I need some help to do even small steps (with
Cocoon 2.1.10).
I have an ajaxed CForm with a text input and a submit button, provided
by test.fd.xml (definition), test.ft.xml (template), sitemap and test.js
for the flow.

Depending on wind and weather the browser sends 1 to 3 requests, makes
an update on continuation without (!) reaching my print-statement in the
flow, and receives one of code 200, 500 (internal server error) or 404
("undefined" not found, of course, why the heck does it call
"undefined"). On display everything is either fine, the textfield is
emptied, and/or it shows a red exclamation mark noting that (the just
filled) textfield is empty and required...


### test.fd.xml (definition): ###

<fd:field id="mytext" required="true">
  <fd:label>My text:</fd:label>
  <fd:datatype base="string"/>
      print("user changed mytext");

### test.ft.xml (template): ###

<ft:form-template action="${}.cont" method="POST"
    <ft:widget-label id="mytext"/>
    <ft:widget id="mytext" fi:submit-on-change="true"/>
  <input type="submit" name="submitBtn"/>

### sitemap: ###

<map:match pattern="test">
  <map:call function="doTest"/>

<map:match pattern="*.cont">
  <map:call continuation="{1}" />

### test.js: ###

function doTest () {
    var form = new Form("test.fd.xml");
    var i = 0;
    do {
        /** called before sending Page */
        print("test #"+i);
    } while ( form.lookupWidget("mytext").getValue() != "foo" ) ;

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message