DMV-14 form question

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

DMV-14 form question

pratik.gada
Hello everyone,
               First of all, I would like to say 'thank you' to Orbeon for
developing such great web forms. I need an urgent help. It is a production
requirement, so I would really appreciate if someone can help me real quick
here. In the demo form DMV-14, under the section "Vehicles, Vessels, or
Placards Owned By You ", you can notice that one row is displayed automatically
in the table when the page displays for the first time. Is there any way I can
change that behavior to "no" rows getting displayed when the form loads. I
should still be able to Add/Remove items. Please let me know if there is any
way to achieve this. I am quite new to XForms and Orbeon, so I would really
appreciate some help here. Please let me know if you have any questions.

Sincerely,
Pratik


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: DMV-14 form question

Alexander Žaťko
Try to change the instance with  id="vehicle-template" in the forms/
DMV-14/model.xml file from:

  <!-- Template for the vehicle details -->
     <xforms:instance id="vehicle-template" xxforms:readonly="true">
         <vehicle xmlns="http://orbeon.org/oxf/examples/dmv">
             <plate-number/>
             <vin/>
             <leased/>
         </vehicle>
     </xforms:instance>

...to:

  <!-- Template for the vehicle details -->
     <xforms:instance id="vehicle-template" xxforms:readonly="true" />

Maybe you will need some dummy root in the instance like:

     <xforms:instance id="vehicle-template" xxforms:readonly="true">
        <placeholder/>
     </xforms:instance>

The idea is to have no record in the instance collecting the user data  
when the form is initiated.

A.


On Dec 10, 2009, at 4:08 PM, <[hidden email]> wrote:

> Hello everyone,
>       First of all, I would like to say 'thank you' to Orbeon for
> developing such great web forms. I need an urgent help. It is a  
> production
> requirement, so I would really appreciate if someone can help me  
> real quick
> here. In the demo form DMV-14, under the section "Vehicles, Vessels,  
> or
> Placards Owned By You ", you can notice that one row is displayed  
> automatically
> in the table when the page displays for the first time. Is there any  
> way I can
> change that behavior to "no" rows getting displayed when the form  
> loads. I
> should still be able to Add/Remove items. Please let me know if  
> there is any
> way to achieve this. I am quite new to XForms and Orbeon, so I would  
> really
> appreciate some help here. Please let me know if you have any  
> questions.
>
> Sincerely,
> Pratik
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: DMV-14 form question

pratik.gada
Hi Alexander,
       Thanks for your reply. However, there is no such instance defined in the
model.xml:

<xforms:instance id="vehicle-template" xxforms:readonly="true">

I guess the initial row comes up due to the nature of the following statement
in DMV-14/view.xml file:

<xforms:repeat nodeset="dmv:vehicle" id="vehicles-repeat">

Please let me know if I am missing something here.

Thanks again for looking into it.

-Pratik


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: DMV-14 form question

Erik Bruchez
Administrator
Check template-form.xml, which is the default instance loaded. It contains :

<vehicles>
    <vehicle>
        <plate-number/>
        <vin/>
        <leased/>
    </vehicle>
</vehicles>

If you replace this with:

<vehicles/>

then no vehicle should appear initially.

Bottom line is the UI is driven by the initial data.

-Erik

On Thu, Dec 10, 2009 at 1:47 PM,  <[hidden email]> wrote:

> Hi Alexander,
>       Thanks for your reply. However, there is no such instance defined in the
> model.xml:
>
> <xforms:instance id="vehicle-template" xxforms:readonly="true">
>
> I guess the initial row comes up due to the nature of the following statement
> in DMV-14/view.xml file:
>
> <xforms:repeat nodeset="dmv:vehicle" id="vehicles-repeat">
>
> Please let me know if I am missing something here.
>
> Thanks again for looking into it.
>
> -Pratik
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: DMV-14 form question

pratik.gada
Hi Eric,
          Sorry for getting back late. In template-form.xml, I did the changes
as mentioned by you earlier in this post, it did solve my problem of the first
row not showing up when the page loads, however now the 'Add Vehicle' trigger
is not working i.e. when i click on it, it is not creating the first row as
expected. Any idea how can this be achieved? I read in some posts that
'context' can be used in the insert statement, however I was not able to
successfully implement it. Kindly let me know if this is possible. Thanks again
for your help!

Thanks,
Pratik


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: DMV-14 form question

Erik Bruchez
Administrator
Pratik,

The DMV-14 example inserts using the following:

* an xforms:trigger on which the user activates
* an event handler reacting to activation
* an action performing the insertion into the instance

For insertions, see e.g. how the xforms:insert action works:

http://wiki.orbeon.com/forms/how-to/repeat-insert-position

-Erik

On Sun, Dec 20, 2009 at 2:06 PM,  <[hidden email]> wrote:

> Hi Eric,
>          Sorry for getting back late. In template-form.xml, I did the changes
> as mentioned by you earlier in this post, it did solve my problem of the first
> row not showing up when the page loads, however now the 'Add Vehicle' trigger
> is not working i.e. when i click on it, it is not creating the first row as
> expected. Any idea how can this be achieved? I read in some posts that
> 'context' can be used in the insert statement, however I was not able to
> successfully implement it. Kindly let me know if this is possible. Thanks again
> for your help!
>
> Thanks,
> Pratik
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: DMV-14 form question

pratik.gada
Hi Erik,
        Thanks for your reply, I did go through the link you said for how the
insert statement works. However, my question still remains unanswered. If I do
not have any rows showing up in the table when the form loads, then the 'Add
Vehicle' trigger does not work. Is there any alternative to it?

Thanks,
-Pratik


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: Re: DMV-14 form question

Alessandro  Vernet
Administrator
Pratik,

Is your <xforms:insert> inserting from a "template instance" which
just contains one empty "row", using the "origin" attribute? Borrowing
from the how-to Erik was linking to, your insert statement should look
something like:

    <xforms:insert ev:event="DOMActivate"
                   context="." nodeset="fruit"
                   origin="instance('new-fruit')"/>

Alex

On Tue, Dec 22, 2009 at 6:02 AM,  <[hidden email]> wrote:

> Hi Erik,
>        Thanks for your reply, I did go through the link you said for how the
> insert statement works. However, my question still remains unanswered. If I do
> not have any rows showing up in the table when the form loads, then the 'Add
> Vehicle' trigger does not work. Is there any alternative to it?
>
> Thanks,
> -Pratik
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet