Hi Grzegorz,
after your plausible explanation could you give me one more?:

Either hitting return on the textfield or submitting via button results
in the browser sending two requests:
1st request (params):
forms_submit_id=&mytext=blass&dojo.transport=xmlhttp&cocoon-ajax=true
1st response: <bu:document
xmlns:bu='http://apache.org/cocoon/browser-update/1.0'><bu:continue/></bu:document>
2nd request (params): cocoon-ajax-continue=true
2nd response: The complete html-page

Well, the user gets an updated screen, but I'm missing the
get-data-and-change-view-behind-the-scenes-without-reloading-the-page-ajax-magic.

:-?
Thanks (again), Florian


Grzegorz Kossakowski wrote:
> Dev at weitling napisaƂ(a):
>> 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...
>>
>>
>> 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" ) ;
>>   
> Everything works as expected. Let me explain it a little bit.
> Firstly, showForm will not return until validation of your form not
> finished successfully. It means, that showForm has it's own loop that
> will showForm until input provided by the user is valid.
> That explains why your print statement is not reached, you see red
> exclamation mark so showForm function has not returned yet.
>
> If you want to do your own validation you should put it into your own
> validator, see javascript custom validators concept:
> http://cocoon.apache.org/2.1/userdocs/widgetconcepts/validation.html
>
> Hope that helps.
>

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

Reply via email to