Login  Register

Re: Re: Problem with repeat element

Posted by Erik Bruchez on Mar 16, 2011; 5:50am
URL: https://discuss.orbeon.com/Problem-with-repeat-element-tp3333676p3380897.html

Jimmy,

On Tue, Mar 15, 2011 at 7:55 AM, Jimmy <[hidden email]> wrote:
I have another question regarding the repeat element.

When implementing the repeat element in a new form, using the form builder,
what do I need to keep in mind?
Would there be a conflict with the control-binds declaring the XPath?
Would I have to declare my button-trigger for the repeat element within the
tag under the  if I'm also building a wizard?

Currently Form Builder does not support repeats properly. This is actually a feature that we are going to work on first thing right after Orbeon Forms 3.9 is released. We have some ideas here already:

http://wiki.orbeon.com/forms/projects/form-runner-builder/repeated-content

Now there is a complicated way of introducing the repeat by hand by modifying the source code of the form in Form Builder (from "Edit Source"), for example. This involves changing a grid that looks like this:

<fr:grid columns="4">
  <xhtml:tr>
    ...
  </xhtml:tr>
  ...
</fr:grid>

into something like this:

<fr:repeat ref="vehicle" columns="4" id="vehicles-repeat"
  <fr:body>
    <xhtml:tr>
      ...
    <xhtml:tr>
  </fr:body>
</fr:repeat>

You also need to modify the instance data under <xforms:instance id="fr-form-instance"> to introduce a child element for the repeated content. For the "vehicle" example above, you would need:

<vehicle>
  ...
</vehicle>

Finally, the <xforms:bind> section also needs to be modified to reflect all this. The new DMV-14 form is a complete example showing how this is done:

https://github.com/orbeon/orbeon-forms/blob/master/src/resources/forms/orbeon/dmv-14/form/form.xhtml

The <fr:repeat> construct already includes add/remove buttons, so you don't need to add your own, if that's what you mean.

-Erik
 


--
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