On Wed, 2003-09-03 at 00:02, jcplerm wrote: > I've been taking a look at the following function found in file > "woody.js". > What I would like to understand is exactly how the form would be > displayed to the user and, upon (re-)submission, the execution return > to where the comment reads: > > "_show creates a continuation, the invocation of which will return > right here".
See the bottom of this message on the dev list for an explanation of the continuations involved: http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=105850306916270&w=2 > > Digging through code appears to be encouraged by the Cocoon community > (and actually in many instances the only way of understanding how > things work). > So, I guess you would not mind this question... > > Thanks, > > jlerm > > Form.prototype.show = function(uri, validator, locale) { > var lastWebCont = this.lastWebContinuation; > // create a continuation, the invocation of which will resend > // the page: this will be used to implement automated "back" > // navigation > var wk = this.start(lastWebCont); > > if (locale == null) > locale = java.util.Locale.getDefault(); > > while (true) { > if (cocoon.request == null) { > // this continuation has been invalidated > this.dead = true; > handleInvalidContinuation(); > Woody.suicide(); > } > var thisWebCont = this._show(uri, locale, wk); > // _show creates a continuation, the invocation of which > // will return right here: it is used to implement > // automated "next" navigation > if (this.dead || cocoon.request == null) { > // this continuation has been invalidated > handleInvalidContinuation(); > suicide(); > } > > var formContext = > new > Packages.org.apache.cocoon.woody.FormContext(this.woody.request, > locale); > var finished = this.form.process(formContext); > var evt = formContext.getActionEvent(); > if (evt != null) { > this.submitId = String(evt.getActionCommand()); > } else { > this.submitId = undefined; > } > if (validator != undefined) { > finished = validator(this) && finished; > } > if (finished) { > break; > } > } > } -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
