You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jorg Heymans <jh...@domek.be> on 2004/08/20 14:35:59 UTC

CForms / flow question

Hi,

I want to continuously display a form (the submit results are in another 
frame), saving the widgets' state in between submits.

so i do

while(true){
   var form = new Form(...);
   form.showForm("blabla");

   //some call here to save the forms state to itself
}

Which method call am I missing? I am looking at userdocs/flow/api.html 
but the Form object is not documented there. Looking at the Form.java 
source in the form block i can't see anything related .


regards
Jorg


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


Re: CForms / flow question

Posted by Bruno Dumon <br...@outerthought.org>.
On Fri, 2004-08-20 at 15:22, Jorg Heymans wrote:
> ugh how obvious, thanks Bruno.
> 
> Actually I don't think i need continuations for my usecase, and I read 
> about the difference between sendPage() and showForm().
> 
> So i changed the showForm call to
>    cocoon.sendPage("display", {"CocoonFormsInstance": form});
> 
> 
> and i'm getting a classcastexception at
<snip/>

this is because CocoonFormsInstance must point to the java form object,
not its javascript wrapper. Using form.form should work.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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


Re: CForms / flow question

Posted by Jorg Heymans <jh...@domek.be>.
ugh how obvious, thanks Bruno.

Actually I don't think i need continuations for my usecase, and I read 
about the difference between sendPage() and showForm().

So i changed the showForm call to
   cocoon.sendPage("display", {"CocoonFormsInstance": form});


and i'm getting a classcastexception at
	at 
org.apache.cocoon.forms.transformation.FormsPipelineConfig.findForm(FormsPipelineConfig.java:178)
	at 
org.apache.cocoon.forms.transformation.EffectWidgetReplacingPipe$FormHandler.process(EffectWidgetReplacingPipe.java:288)
	at 
org.apache.cocoon.forms.transformation.EffectPipe.startElement(EffectPipe.java:412)
	at 
org.apache.cocoon.components.sax.XMLTeePipe.startElement(XMLTeePipe.java:83)
	at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)

the "display" pipeline looks like

<map:generate src="forms/form_template.xml"/>
<map:transform type="forms"/>
....


Am i doing something deprecated/forbidden/stupid here?

Jorg
Bruno Dumon wrote:

> On Fri, 2004-08-20 at 14:35, Jorg Heymans wrote:
> 
>>Hi,
>>
>>I want to continuously display a form (the submit results are in another 
>>frame), saving the widgets' state in between submits.
>>
>>so i do
>>
>>while(true){
>>   var form = new Form(...);
>>   form.showForm("blabla");
>>
>>   //some call here to save the forms state to itself
>>}
> 
> 
> a form object contains the forms state, so there's no need to 'save it
> to itself', simply putting the "new Form(...)" above the while should do
> it.
> 
> 
>>Which method call am I missing? I am looking at userdocs/flow/api.html 
>>but the Form object is not documented there. Looking at the Form.java 
>>source in the form block i can't see anything related .
> 
> 
> the javascript Form object is declared in the Form.js file, which also
> contains some docs.
> 


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


Re: CForms / flow question

Posted by Bruno Dumon <br...@outerthought.org>.
On Fri, 2004-08-20 at 14:35, Jorg Heymans wrote:
> Hi,
> 
> I want to continuously display a form (the submit results are in another 
> frame), saving the widgets' state in between submits.
> 
> so i do
> 
> while(true){
>    var form = new Form(...);
>    form.showForm("blabla");
> 
>    //some call here to save the forms state to itself
> }

a form object contains the forms state, so there's no need to 'save it
to itself', simply putting the "new Form(...)" above the while should do
it.

> 
> Which method call am I missing? I am looking at userdocs/flow/api.html 
> but the Form object is not documented there. Looking at the Form.java 
> source in the form block i can't see anything related .

the javascript Form object is declared in the Form.js file, which also
contains some docs.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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