Hello, I want to set for the position attribute of the xforms:insert expression a value which is variable. What I'm trying to do is as here: <xf:repeat nodeset="InvoiceItems/item" id="item-repeat"> <xxforms:variable name="position" select="position()"/> <xxforms:variable name="insertWhere" select="if($position=count(instance('content')/InvoiceItems/item))then 'after' else 'before'"/>
<xf:insert ev:event="DOMActivate" context="instance('content')/InvoiceItems" nodeset="item" at="index('item-repeat')"
position="$insertWhere" origin="instance('invoice-item-template')" /> </xf:repeat> the problem is that my variable is not recognized in this statement and Orbeon is asking only for the static values "after" or "before". If I'm displaying the value of that variable everything works great.
<xf:output value="$insertWhere"/> Thanks. Alexandru -- 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 |
Administrator
|
Alexandru,
This doesn't work because the value of "position" is supposed to be either "before" or "after"; it can't be an XPath expression that returns that value. In some places, Orbeon Forms supports AVTs for this, as an extension to XForms spec, so you can write position="{$insertWhere}", but this is not one of those places. I created an RFE for this: http://forge.ow2.org/tracker/index.php?func=detail&aid=314804&group_id=168&atid=350207 Alex On Sun, Mar 7, 2010 at 6:20 AM, Alexandru Ionita <[hidden email]> wrote: > > > > Hello, > I want to set for the position attribute of the xforms:insert expression a > value which is variable. What I'm trying to do is as here: > > <xf:repeat nodeset="InvoiceItems/item" id="item-repeat"> > <xxforms:variable name="position" select="position()"/> > <xxforms:variable name="insertWhere" > select="if($position=count(instance('content')/InvoiceItems/item))then > 'after' else 'before'"/> > <xf:insert ev:event="DOMActivate" > context="instance('content')/InvoiceItems" nodeset="item" > at="index('item-repeat')" > position="$insertWhere" origin="instance('invoice-item-template')" /> > </xf:repeat> > > the problem is that my variable is not recognized in this statement and > Orbeon is asking only for the static values "after" or "before". > If I'm displaying the value of that variable everything works great. > <xf:output value="$insertWhere"/> > > Thanks. > Alexandru > > -- > 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 - http://www.orbeon.com/ 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 |
FYI this was an easy one so I implemented it. I also migrated the doc
on AVTs to the wiki: http://wiki.orbeon.com/forms/doc/developer-guide/xforms-attribute-value-templates -Erik On Mon, Mar 8, 2010 at 10:35 AM, Alessandro Vernet <[hidden email]> wrote: > Alexandru, > > This doesn't work because the value of "position" is supposed to be > either "before" or "after"; it can't be an XPath expression that > returns that value. In some places, Orbeon Forms supports AVTs for > this, as an extension to XForms spec, so you can write > position="{$insertWhere}", but this is not one of those places. I > created an RFE for this: > > http://forge.ow2.org/tracker/index.php?func=detail&aid=314804&group_id=168&atid=350207 > > Alex > > On Sun, Mar 7, 2010 at 6:20 AM, Alexandru Ionita > <[hidden email]> wrote: >> >> >> >> Hello, >> I want to set for the position attribute of the xforms:insert expression a >> value which is variable. What I'm trying to do is as here: >> >> <xf:repeat nodeset="InvoiceItems/item" id="item-repeat"> >> <xxforms:variable name="position" select="position()"/> >> <xxforms:variable name="insertWhere" >> select="if($position=count(instance('content')/InvoiceItems/item))then >> 'after' else 'before'"/> >> <xf:insert ev:event="DOMActivate" >> context="instance('content')/InvoiceItems" nodeset="item" >> at="index('item-repeat')" >> position="$insertWhere" origin="instance('invoice-item-template')" /> >> </xf:repeat> >> >> the problem is that my variable is not recognized in this statement and >> Orbeon is asking only for the static values "after" or "before". >> If I'm displaying the value of that variable everything works great. >> <xf:output value="$insertWhere"/> >> >> Thanks. >> Alexandru >> >> -- >> 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 - > http://www.orbeon.com/ > 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 > > -- 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 |
thanks for your help. Later on I was able to find out what AVT is about. Alex
On Mon, Mar 8, 2010 at 20:44, Erik Bruchez <[hidden email]> wrote: FYI this was an easy one so I implemented it. I also migrated the doc -- 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 |
Free forum by Nabble | Edit this page |