You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Philipp Rech <re...@iuw.fh-darmstadt.de> on 2004/12/16 14:00:44 UTC

how 2 invalidate the cntinuation to prevent doubble db entries

Hello Cocooners,

[Cocoon Version 2.1.6]

i send a page after a database entry with sendPage("done"); 
if the user presss reload on the "done" page the data is entered into the
db twice, ..too bad! why does the page done (which is JXT) show up wit a
continuation i the URL even tough i don't use sendPageAndWait?
Could i prevent the Flowscript from executing the database operation again when
pressign reload by invalidating / deleting the continuation object just before
sendPage("done"); ?

How can I delete the continuation from flowscript?
i don't understand the usage and syntax of "Function invalidate()"
the docs have no example... 

Thank you very much for your help!
phil

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


Re: how 2 invalidate the cntinuation to prevent doubble db entries

Posted by Jean-Baptiste Quenot <jb...@anyware-tech.com>.
* Carlos Chávez:

>   That  do   not  work  because  cocoon.sendPage   no  return  a
>   WebContinuation Object.

You're right I meant sendPageAndWait(), also used by showForm().
-- 
Jean-Baptiste Quenot
Anyware Technologies
http://www.anyware-tech.com/

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


Re: how 2 invalidate the cntinuation to prevent doubble db entries

Posted by Carlos Chávez <cc...@agssa.net>.
Jean-Baptiste Quenot Escribio :-)
> Have you tried:
>
> var cont = cocoon.sendPage("done")
> cont.invalidate()

  Hi.

  That do not work because cocoon.sendPage no return a WebContinuation
  Object.

  I think you need invalidate the WebContinuation of the form.showForm
  for example:

  var kont = form.showForm("create-form-display");
  form.save(bean);
  // Make changes in the database
  insert(bean);
  kont.invalidate();
  cocoon.sendPage("/page");

  in that way although you reload the page the WebContinuation is invalid
  and the "insert(bean)" code is not executable.

  Cheers,

> --
> Jean-Baptiste Quenot
> Anyware Technologies
> http://www.anyware-tech.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


-- 
Carlos Chávez

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


Re: how 2 invalidate the cntinuation to prevent doubble db entries

Posted by Jean-Baptiste Quenot <jb...@anyware-tech.com>.
Have you tried:

var cont = cocoon.sendPage("done")
cont.invalidate()
-- 
Jean-Baptiste Quenot
Anyware Technologies
http://www.anyware-tech.com/

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