Hi All,
Inserting an attribute using something like <xforms:insert nodeset="." position="after" at="1" origin="instance('my-attribute')/@attr1"/> used to work in the nightly builds some weeks before the 3.5 release. Since I upgraded to the 3.5 release, insert actions of this sort stopped working. Does anybody know if there was a change to the specs of how xforms:insert works? Am I missing something in the insert action? Larry -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Hi Larry,
Yes, there were changes very recently in the specification related to the <xforms:insert>. In your example, what does nodeset point to? Is it another attribute or an element? Alex On 3/12/07, Larry T. Chen <[hidden email]> wrote: > Hi All, > > Inserting an attribute using something like > > <xforms:insert nodeset="." position="after" at="1" > origin="instance('my-attribute')/@attr1"/> > > used to work in the nightly builds some weeks before the 3.5 release. > Since I upgraded to the 3.5 release, insert actions of this sort stopped > working. > Does anybody know if there was a change to the specs of how > xforms:insert works? Am I missing something in the insert action? > > Larry > > > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > -- Orbeon Forms - Web 2.0 Forms for the Enterprise http://www.orbeon.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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Alex,
I've been using this sort of insert with nodeset pointing to an element. I'm basically trying to create an attribute on an element if it doesn't already have that attribute. Should nodeset be pointing to an attribute instead? But then wouldn't it be impossible to insert an attribute if it doesn't already exist? Larry Alessandro Vernet wrote: Hi Larry, -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Hi Larry,
Hopefully the following modification in your code might work. <xforms:insert nodeset="@*" position="after" at="1" origin="instance('my-attribute')/@attr1"/> If in case it doesn't, please check whether the sample I am attaching suits your requirement. In the attached sample you have a repeat contol and two trigger controls. 1st trigger control is for inserting a node, which once inserted shows up in the list generated by the repeat control. The 2nd trigger control inserts an attribute with the value we input to the node selected by the repeat control. In case such an attribute already exists an alert message will be shown. Thanks Joseph Lawrence Stabilix Solutions "Larry T. Chen" <[hidden email]> wrote: Alex,
We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list. -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws insert-attribute.xhtml (13K) Download Attachment |
Joseph,
This will copy all the attributes that exist, but Larry wants to create an attribute from an element Larry, I'm not sure if this is the only way, but I would create a template instance with my attribute in it <xforms:instance id="template-instance"> <instance some-attribute=""/> </xforms:instance> Then you can insert this attribute, using xforms:insert and set its value using xforms:setvalue Hope this helps Ryan Joseph Lawrence wrote: Hi Larry, --
Ryan Puddephatt -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Hi Ryan,
I made the assumption that Larry's trigger was referring to the node to which the attribute need to be inserted. The reason is that before he was using the following code: <xforms:insert nodeset="." position="after" at="1" origin="instance('my-attribute')/@attr1"/> While insertion, the attribute that need to be inserted is obtained from the @origin which points to the template attribute. I expected something like <xforms:trigger ref="instance('main')/name"> <xforms:label>Insert Attribute</xforms:label> <xforms:insert nodeset="@*" position="after" at="1" origin="instance('my-attribute')/@attr1" ev:event="DOMActivate"/> </xforms:trigger> What I expect here is to get the @attr1 added as an attribute to instance('main')/name. And it seems to work as well. Thanks Joseph Lawrence Stabilix Solutions Ryan Puddephatt <[hidden email]> wrote: Joseph,
Don't pick lemons. See all the new 2007 cars at Yahoo! Autos. -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Quite correct, my bad, it was very early and i didn't fully read the email :-) Ryan Joseph Lawrence wrote: Hi Ryan, --
Ryan Puddephatt -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by Joseph Lawrence
Thank you all for your quick responses. Simply changing the nodeset to
"@*" did the trick!
Larry Joseph Lawrence wrote: Hi Larry, -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |