Problem with repeat element

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

Problem with repeat element

Jimmy
Hey guys n' gals!

I'm relatively new to xforms and Orbeon and have pondered the same problem now for a week or so.
I'm uncertain if I fully understand how 'instance' functions and am working on a form with a repeat element.
The problem I'm experiencing is a little tricky but basically whenever I get the repeat element to work all other elements not included within the repeat tag stops working and vice versa.

I've attached the file..

Best regards

Jimmy

view.xhtml
Reply | Threaded
Open this post in threaded view
|

Re: Problem with repeat element

Hank Ratzesberger-2
Hi Jimmy,

I think everyone has found XForms a bit of a journey,
and an interesting one.

I think what you are seeing is the XPath context, which can be
set by <group ref="..."> and is set to the current item of the
select within a repeat.

To reference data outside this context, you must use the full
XML path to the data, which often must include the particular
instance:

<output ref="instance('some-other-inst')/node"/>

--Hank


On Mar 3, 2011, at 8:33 AM, Jimmy wrote:

> Hey guys n' gals!
>
> I'm relatively new to xforms and Orbeon and have pondered the same problem
> now for a week or so.
> I'm uncertain if I fully understand how 'instance' functions and am working
> on a form with a repeat element.
> The problem I'm experiencing is a little tricky but basically whenever I get
> the repeat element to work all other elements not included within the repeat
> tag stops working and vice versa.
>
> I've attached the file..
>
> Best regards
>
> Jimmy
>
> http://orbeon-forms-ops-users.24843.n4.nabble.com/file/n3333676/view.xhtml
> view.xhtml
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Problem-with-repeat-element-tp3333676p3333676.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
> --
> 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
Hank Ratzesberger
NEES@UCSB
Earth Research Institute
6707 Ellison Hall
University of California, Santa Barbara
805-893-8042









--
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: Problem with repeat element

Erik Bruchez
Administrator
In reply to this post by Jimmy
Jimmy,

I see your file, but you don't say how to reproduce the problem:

* what behavior you observe with the current file
* what to change to observe the other behavior

-Erik

On Thu, Mar 3, 2011 at 8:33 AM, Jimmy <[hidden email]> wrote:
Hey guys n' gals!

I'm relatively new to xforms and Orbeon and have pondered the same problem
now for a week or so.
I'm uncertain if I fully understand how 'instance' functions and am working
on a form with a repeat element.
The problem I'm experiencing is a little tricky but basically whenever I get
the repeat element to work all other elements not included within the repeat
tag stops working and vice versa.

I've attached the file..

Best regards

Jimmy

http://orbeon-forms-ops-users.24843.n4.nabble.com/file/n3333676/view.xhtml
view.xhtml

--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Problem-with-repeat-element-tp3333676p3333676.html
Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.


--
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: Problem with repeat element

Jimmy
Hi Erik

I am a bit unsure as to whether my main instance is appropriately structured.
In the current file my repeat element is fully functioning but all other elements
represented in my main instance is not..

I'm not quite sure what to make of it. But simplifying the structure of my
main instance will get the other elements working again.


Hope that helps

-Jimmy
Reply | Threaded
Open this post in threaded view
|

Re: Problem with repeat element

Jimmy
In reply to this post by Hank Ratzesberger-2
Hey Hank

Worked like a charm!
Feel I have a better understanding of the repeat function now.


Thanks a bunch

-Jimmy
Reply | Threaded
Open this post in threaded view
|

Re: Problem with repeat element

Jimmy
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
<fr:buttons>
 tag under the
<fr:body>
 if I'm also building a wizard?
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem with repeat element

Erik Bruchez
Administrator
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:


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:


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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem with repeat element

Jimmy
Hi, Erik


I managed to figure it out, finaly. Within the repeat tag I'm able to adjust min and max repeats and set the path to the template.


Thanks for the help.

//Jimmy
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Problem with repeat element

Erik Bruchez
Administrator
Jimmy: good to hear.

-Erik

On Wed, Mar 16, 2011 at 8:30 AM, Jimmy <[hidden email]> wrote:
Hi, Erik


I managed to figure it out, finaly. Within the repeat tag I'm able to adjust
min and max repeats and set the path to the template.


Thanks for the help.

//Jimmy

--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Problem-with-repeat-element-tp3333676p3382091.html
Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.


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