In trying to dynamically generate an XForms instance, we have followed your
suggestion below and now use a pipeline to create the XForm.  Our controller
now looks like:

<page id="newTimeSheetScreen2ID" path-info="/newTimeSheet2"
        xforms="newTimeSheetForm2.xpl"
        model="newTimeSheetModel2.xpl"
        view="newTimeSheetView2.xsl">
  <action id="enter" when="/UserAction = 'add'"
action="newTimeSheetAddAction.xpl">
        <result id="validID" when="/Result = 'success'"/>
        ...
  </action>
  ...
</page>

The problem however is that the newTimeSheetForm2.xpl pipeline that
dynamically creates the XForm only get's called the *first* time this page
is visited...?  This page collects information from a user, who can then
press a button to "add more", at which point the action send the user back
to this same page.  We have debugging printouts for both
newTimeSheetForm2.xpl and newTimeSheetModel2.xpl, and the first time the
page is visited, they both print their debug, but the second time, only the
Model2.xpl prints its debug -- thus thwarting our attempts to build our
XForm dynamically on all subsequent visits to the page.

Any tips?  Is this a bug in the page handling by OXF, or something we don't
know about how pages behave when they're revisited?

Thanks.

-Scott
UC Berkeley Center for Document Engineering


> From: Alessandro Vernet <[EMAIL PROTECTED]>
> Date: Mon, 14 Jul 2003 18:52:31 -0700
> To: Justin Makeig <[EMAIL PROTECTED]>
> Subject: Re: Dynamic XForms model
>
> Hi Justin,
>
> If you want to dynamically build the XForms model, create a pipeline
> that generates this XForms model. This pipeline must have an output
> named "data". Say you pipeline is stored in xforms.xpl. Then modify
> your controller.xml to point to this pipeline (xforms="xforms.xpl").
> In the pipeline, you can do anything you want. You can connect to a
> database, read other resources, etc.
>
> BTW, please send your question to the oxf-users mailing list in the
> future, so other users can benefit from your experience. Thank you.
>
> Alex
>
> Justin Makeig wrote:
> > Is it possible to dynamically generate the XForms input to a view? The
> > xforms attribute in the page element in the controller
> specifies a file. Is
> > it possible to use an XForms instance built on the fly?
> >
> > Our xforms.xml on the file system looks like this:
> >
> > <xforms:model xmlns:xforms="http://www.w3.org/2002/01/xforms";>
> >     <xforms:instance>
> >
> >                 <NameAndPhone>
> >                   <Name/>
> >                   <Phone/>
> >               </NameAndPhone>
> >
> >     </xforms:instance>
> > </xforms:model>
> >
> > Currently we seem to be limited to the above instance document
> as it exists
> > on disk. We would like to dynamically wrap the instance to look
> something
> > like:
> >
> > <xforms:model xmlns:xforms="http://www.w3.org/2002/01/xforms";>
> >     <xforms:instance>
> >         <pipeEnvelope>
> >             <pipeMetaData>
> >                  <selection/>
> >              </pipeMetaData>
> >              <pipeUserData>
> >                 <NameAndPhone>
> >                   <Name/>
> >                   <Phone/>
> >               </NameAndPhone>
> >             </pipeUserData>
> >          </pipeEnvelope>
> >     </xforms:instance>
> > </xforms:model>
> >
> > How do we communicate this augmented XForms instance to the
> XForms processor
> > and the request handler?
> >
> > Our controller looks something like the following:
> >
> > <page id="newTimeSheetScreen2ID"
> >             path-info="/somepath"
> >             xforms="/xforms.xml"
> >             model="/somepipe.xpl"
> >             view="/someview.xsl">
> >
> > Any assistance would be much appreciated.
> >
> > - Justin
> >
> >

_______________________________________________
oxf-users mailing list
[EMAIL PROTECTED]
http://mail.orbeon.com/mailman/listinfo/oxf-users

Reply via email to