cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michel Erard" <cocoon.er...@besonet.ch>
Subject Re: How to implement a back button
Date Tue, 18 May 2004 09:12:49 GMT
Yes, I've also seen this today and tried out... but then I've seen that the method with the
continuation is probably not the best way, because all the state made on the second page surely
is lost. But the input on page 1 is also lost. I think the continuation is created right after
sending page 1 to the browser.

And another question: this line of code doesn't work by me: var continuation = cocoon.createWebContinuation();

It throws an CascadingRuntimeException: createWebContinuation is not a function

Do you have this problem too? Has there something changed? I'm using cocoon-2.1.3

Thanks
Mike

---------- Original Message ----------------------------------
From: u15603 <u15603@hs-harz.de>
Reply-To: users@cocoon.apache.org
Date:  Tue, 18 May 2004 09:35:31 +0200

>Hello,
>
>I have found another solution for problems in the documentation of 
>cocoon (but i have not tried it out ;-))
>
>You can also reach previous continuations by using the getParent() 
>function in the template:
>
>   <form action="$continuation.getParent().id" >
>
>I hope it helps!
>
>Dirk Gronert
>
>
>> Hello, 
>> 
>> I've in an application something like a cycle of an order which is divided into 3
forms. Now I have to implement a back button which shows the previous page with his state.
>> Does someone know an easy and elegant way to implement this?
>> I've read something with createPageLocal(), but does this also work with sendview()?
>> 
>> Examples of my source you find below.
>> 
>> Thanks
>> 
>> Mike
>> 
>> 
>> 
>> //source in flowscript
>> 
>> function order( args_p ) {
>> 
>>    jxform( "orderForm",
>>            "order",
>>            null,
>>            null,
>>            "request");
>> }
>> 
>> 
>> function orderForm( form_p )
>> {
>>    var model  = form_p.getModel();   
>> 
>>    do {
>>       form_p.sendView( "orderPage1.form", validateOrderPage1Form );
>>    }
>>    while( !model.displayNextPage );
>> 
>>    do {
>>       form_p.sendView( "orderPage2.form", validateOrderPage2Form );
>>    }
>>    while( !model.displayNextPage );
>>       
>>    do {
>>       form_p.sendView( "orderPage3.form", validateOrderPage3Form );
>>    }
>>    
>>    while( !model.displayNextPage );
>> 
>>    doTheOrder();
>> 
>>    if ( model.errorCode == 0 ) {
>>       form_p.sendView( "oK.form", validateOKForm );
>>    }
>>    else {
>>       form_p.sendView( "noK.form", validateNOKForm );
>>    }
>>    form_p.finish();
>> }
>> 
>> 
>> 
>> function validateOrderPage1Form( form_p ){     //validateOrderPage2Form & 
>>                                                //validateOrderPage3Form are equal
 
>>    var model  = form_p.getModel();
>>    var action = form_p.getSubmitId();
>>    
>>    if ( action == "next" ) {
>>       
>> 	if (doSomeValidation()) {
>>             model.displayNextPage = true;      
>>         }
>>         else {
>>             model.displayNextPage = false;
>>    }
>>    
>> }
>> 
>> 
>> <!-- source of the form -->
>> 
>> <xf:submit id="next" continuation="forward">
>>             <xf:label><i18n:text i18n:catalogue="buttons">NEXT</i18n:text></xf:label>
>> </xf:submit> 
>> 
>>  
>> ______________ ______________ ______________
>> QuickLine WebMail - http://www.quick-line.ch
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
 

 
______________ ______________ ______________
QuickLine WebMail - http://www.quick-line.ch


 
                   

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


Mime
View raw message