Rashel Shehata wrote:
> what I was thinking of doing is using the output of a pipeline entry
> as an
> input for the form constructor.

Yes, but pipeline B must fetch the output of pipeline A by calling it.
(as I said: think pull, not push)

> so a call from flowscript:
>  cocoon.sendPage("form_model-pipeline.xsp" ,
>     {questions: questionRegistry.getAllQuestions()});
>
> will be matched with the pipeline entry:
>
> <map:match pattern="*-pipeline.xsp">
>    <map:generate type="jx" src="forms/{1}.xml"/>
>     <map:serialize type="xml"/>
>   </map:match>
>
> and the jx generator looks for the file: forms/form_model.xml.... which
> generates the form definition xml and ouputs into the browser

I was wondering because the path in the error message didn't fit.

> so instead of calling cocoon.sendPage(..) im trying to use the ouput
> of teh
> pipeline, i.e. the serialized xml, as a direct argument for the form
> constructor, i.e. by calling
>>  var form = new Form("form_model-pipeline.xsp" ,
>>     {questions: questionRegistry.getAllQuestions()});
>
> but it seems that form constructor only takes system files as an argument

No, that's not correct. But sometimes it helps (for preventing mistakes
and for better readability) to specify the protocol, e.g.

new Form("file:form_model-pipeline.xsp");    -> reads the file directly, or
new Form("cocoon:form_model-pipeline.xsp");    -> makes a call to the
appropriate pipeline

This way you can call a pipeline for creating a form definition dynamically.

Besides, that you can call also non-system files, Philippe's tip is
worth thinking about it and maybe extending it:
- Generate a definition containing all you need.
- Then deactivate all widgets yo don't need (status = disabled).
- And loading data into it dynamically via form binding.

Feel free to ask again - at the moment there is great weather here but
I'm stuck to my keyboard...
Florian

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

Reply via email to