Hi,

Here's a note from http://wiki.apache.org/cocoon/RhinoWithContinuations that
explains what's going on:

NOTE: Captured continuation does not save the state of the variables, but
rather pointers to the variables. Example: two continuations will share one
instance of the local variable declared in the function, if those two
continuations were created during execution of the same call of this
function. -- Vadim 

The result of this is that when you set the form variable to the search
results form, you change the form variable in the earlier continuation too
so when you click the Back button and submit, an instance of "form B" does
the processing instead of "form A".

Probably the easiest thing to do here is to use two different variables for
the two forms.  If this is awkward (e.g. you're generating forms in a loop),
you can also use a page local variable to get the behavior you want.

Pete

> 
> hi Superbiji
> 
> thanx for your answer but i test all this without to leave the form open 
> for a long time.
> 
> maybe i dont have refer to my problem corectly
> let me describe the scenario 
> 
> 1. i'm in form_A
> 2. click on submit
> 3. i'm in form_B and posted data form form_A are here
> 4. i press browser's back button
> 5. i'm in form_A 
> 6. click on submit and i get a message that a widget with a specific id 
> (form_A's widget) does not exist 
> is it possible here flow to try to dipslay from_A instead form_B?
> 
> 
> i have the feeling that when i press browsers back button i get a cashed 
> page from my browser and flow does not understund where i am.
> 
> is it possible to be a bug in cforms or not?
> because the example is very simple (i think so)
> 
> here is my flow script
> 
> -------------
> function search() {
>       
>     var db    = new Packages.gr.osmosis.hotpoints.DatabaseAccess();
>     var list  = new Packages.java.util.ArrayList();
>     var rc    = new Packages.gr.osmosis.hotpoints.RichPathCreator();
>     var report = "";
>     
>     db.connect();
>     db.init();
>     
>     var form = new Form("forms/search_welcome.xml");
>     var search_for;
>     var max_results = "10";
>     
>     do{
> //----->FORM_A    
>         form.showForm("search_welcome-display-pipeline");
>       var model = form.getModel();
>       search_for = model.search_for;
>       max_results = model.max_results;
>       print ("Searching for [" + search_for + "] ...");
>       
>               
>       list = db.searchForElementsWithTitle(search_for);
>     
>      // if there is no records that match the criteria 
>      // list==null then redisplay the form
>     }while (list==null)
>     
>     form = new Form("forms/search_results.xml");
>     model = form.getModel();
>     
>     var items = max_results;
>     if (items > list.length){ items = list.length; }
>     
>     for (var i=0; i<items; i++){
>           rc.setElement(list[i]);
>           rc.touchElement();
>           print ("rich path : " + list[i].getRichPath());
>           model.elements[i].element_id = list[i].getId();
>           model.elements[i].title = list[i].getTitle();
>           model.elements[i].path = list[i].getPath();
>           model.elements[i].richpath = list[i].getRichPath();
>           model.elements[i].description = list[i].getDescription();
>     }
> //----->FORM_B 
> //      Here is where i press browsers back button    
>     form.showForm("search_results-display-pipeline");
> 

-- 
Supergünstige DSL-Tarife + WLAN-Router für 0,- EUR*
Jetzt zu GMX wechseln und sparen http://www.gmx.net/de/go/dsl


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

Reply via email to