cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dev at weitling <...@weitling.net>
Subject Weird CForms/Ajax errors
Date Thu, 15 Feb 2007 14:34:33 GMT
Hi,
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...

:-?
Florian



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

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



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

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


### sitemap: ###

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

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

### test.js: ###

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


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message