Hello again. I have a problem trying to add a new node with xforms:insert. When a insert a new node, and the list of element have some elements, it works perfectly. But if I delete all the elements and then I try to insert a new one it doesn't work. I found that if I have only two levels at my xml instance (Tes/TesDet) it works perfectly. But I have three levels. Is it a bug or I'm doing something wrong?? Thanks a lot in advance. My code: <xforms:model id="documento-model" schema="/apps/formularios/basico/doc_CuentaBasico.xsd"> <xforms:instance id="documento-instance"> <Cuenta-04-Bas xmlns=""> <Tes> <TesDet> <CobPptoIngCorr>300000.00</CobPptoIngCorr> </TesDet> </Tes> </Cuenta-04-Bas> </xforms:instance>
<xforms:instance id="TesDet-template"> <TesDet xmlns=""> <CobPptoIngCorr/> </TesDet> </xforms:instance></xforms:model> ........ < xforms:trigger appearance="minimal"> <xforms:label><img src="../apps/xforms-bookcast/images/add.gif"/></xforms:label> <xforms:insert ev:event="DOMActivate" nodeset="/Cuenta-04-Bas/Tes/TesDet" context="instance('documento-instance')" at="last()" position="after" origin="instance('TesDet-template')"/> </xforms:trigger>... <xforms:repeat nodeset="Tes/TesDet" id="TesDet-repeat"> <tr> <td class="celda-remove"> <xforms:trigger appearance="minimal"> <xforms:delete ev:event="DOMActivate" nodeset="/Cuenta-04-Bas/Tes/TesDet" context="instance('documento-instance')" at="index('TesDet-repeat')"/> <xforms:label><img src="../apps/xforms-bookcast/images/remove.gif"/></xforms:label> </xforms:trigger> </td> <td> <xforms:input ref="CobPptoIngCorr"> <xforms:label class="sort-label">COBROS</xforms:label> </xforms:input> </td> ... Llama a tus amigos de PC a PC: ¡Es GRATIS! Pruébalo -- 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
|
When the @nodeset attribute returns something empty, nodes are inserted
as children of the node pointed to by the @context element. In your case, you have: <xforms:insert ev:event="DOMActivate" nodeset="/Cuenta-04-Bas/Tes/TesDet" context="instance('documento-instance')" at="last()" position="after" origin="instance('TesDet-template')"/> So the nodes will be inserted as children of the root element of instance('documento-instance'). Try maybe something like this: <xforms:insert ev:event="DOMActivate" nodeset="TesDet" context="/Cuenta-04-Bas/Tes/" at="last()" position="after" origin="instance('TesDet-template')"/> -Erik aa aa wrote: > > Hello again. > > I have a problem trying to add a new node with xforms:insert. > When a insert a new node, and the list of element have some elements, it > works perfectly. But if I delete all the elements and then I try to > insert a new one it doesn't work. > > I found that if I have only two levels at my xml instance (Tes/TesDet) > it works perfectly. But I have three levels. > > Is it a bug or I'm doing something wrong?? > > Thanks a lot in advance. > > My code: > > > > <xforms:model id="documento-model" > schema="/apps/formularios/basico/doc_CuentaBasico.xsd"> > > > > <xforms:instance id="documento-instance"> > > <Cuenta-04-Bas xmlns=""> > > <Tes> > > <TesDet> > > <CobPptoIngCorr>300000.00</CobPptoIngCorr> > > </TesDet> > > </Tes> > > </Cuenta-04-Bas> > > </xforms:instance> > > > > <xforms:instance id="TesDet-template"> > > <TesDet xmlns=""> > > <CobPptoIngCorr/> > > </TesDet> > > </xforms:instance> > > > > </xforms:model> > > ........ > > > <xforms:trigger appearance="minimal"> > > <xforms:label><img > src="../apps/xforms-bookcast/images/add.gif"/></xforms:label> > > <xforms:insert ev:event="DOMActivate" > nodeset="/Cuenta-04-Bas/Tes/TesDet" > context="instance('documento-instance')" at="last()" position="after" > origin="instance('TesDet-template')"/> > > </xforms:trigger> > > ... > > > <xforms:repeat nodeset="Tes/TesDet" id="TesDet-repeat"> > > <tr> > > <td class="celda-remove"> > > <xforms:trigger appearance="minimal"> > > <xforms:delete ev:event="DOMActivate" > nodeset="/Cuenta-04-Bas/Tes/TesDet" > context="instance('documento-instance')" at="index('TesDet-repeat')"/> > > <xforms:label><img > src="../apps/xforms-bookcast/images/remove.gif"/></xforms:label> > > </xforms:trigger> > > </td> > > <td> > > <xforms:input ref="CobPptoIngCorr"> > > <xforms:label class="sort-label">COBROS</xforms:label> > > </xforms:input> > > </td> > ... > > > > ------------------------------------------------------------------------ > Llama a tus amigos de PC a PC: ¡Es GRATIS! Pruébalo > <http://get.live.com/messenger/overview> > -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way 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 |
In reply to this post by aa aa-2
Thank you very much!!
I used: nodeset="TesDet" context="instance('documento-instance')/Cuenta-04-Bas/Tes" and it works perfectly! Thank you again! > Date: Mon, 2 Jul 2007 13:14:53 +0200 > From: [hidden email] > To: [hidden email] > Subject: Re: [ops-users] Problem with xforms:insert > > When the @nodeset attribute returns something empty, nodes are inserted > as children of the node pointed to by the @context element. In your > case, you have: > > <xforms:insert ev:event="DOMActivate" > nodeset="/Cuenta-04-Bas/Tes/TesDet" > context="instance('documento-instance')" at="last()" position="after" > origin="instance('TesDet-template')"/> > > So the nodes will be inserted as children of the root element of > instance('documento-instance'). > > Try maybe something like this: > > <xforms:insert ev:event="DOMActivate" > nodeset="TesDet" > context="/Cuenta-04-Bas/Tes/" > at="last()" position="after" > origin="instance('TesDet-template')"/> > > -Erik > > aa aa wrote: > > > > Hello again. > > > > I have a problem trying to add a new node with xforms:insert. > > When a insert a new node, and the list of element have some elements, it > > works perfectly. But if I delete all the elements and then I try to > > insert a new one it doesn't work. > > > > I found that if I have only two levels at my xml instance (Tes/TesDet) > > it works perfectly. But I have three levels. > > > > Is it a bug or I'm doing something wrong?? > > > > Thanks a lot in advance. > > > > My code: > > > > > > > > <xforms:model id="documento-model" > > schema="/apps/formularios/basico/doc_CuentaBasico.xsd"> > > > > > > > > <xforms:instance id="documento-instance"> > > > > <Cuenta-04-Bas xmlns=""> > > > > <Tes> > > > > <TesDet> > > > > <CobPptoIngCorr>300000.00</CobPptoIngCorr> > > > > </TesDet> > > > > </Tes> > > > > </Cuenta-04-Bas> > > > > </xforms:instance> > > > > > > > > <xforms:instance id="TesDet-template"> > > > > <TesDet xmlns=""> > > > > <CobPptoIngCorr/> > > > > </TesDet> > > > > </xforms:instance> > > > > > > > > </xforms:model> > > > > ........ > > > > > > <xforms:trigger appearance="minimal"> > > > > <xforms:label><img > > src="../apps/xforms-bookcast/images/add.gif"/></xforms:label> > > > > <xforms:insert ev:event="DOMActivate" > > nodeset="/Cuenta-04-Bas/Tes/TesDet" > > context="instance('documento-instance')" at="last()" position="after" > > origin="instance('TesDet-template')"/> > > > > </xforms:trigger> > > > > ... > > > > > > <xforms:repeat nodeset="Tes/TesDet" id="TesDet-repeat"> > > > > <tr> > > > > <td class="celda-remove"> > > > > <xforms:trigger appearance="minimal"> > > > > <xforms:delete ev:event="DOMActivate" > > nodeset="/Cuenta-04-Bas/Tes/TesDet" > > context="instance('documento-instance')" at="index('TesDet-repeat')"/> > > > > <xforms:label><img > > src="../apps/xforms-bookcast/images/remove.gif"/></xforms:label> > > > > </xforms:trigger> > > > > </td> > > > > <td> > > > > <xforms:input ref="CobPptoIngCorr"> > > > > <xforms:label class="sort-label">COBROS</xforms:label> > > > > </xforms:input> > > > > </td> > > ... > > > > > > > > ------------------------------------------------------------------------ > > Llama a tus amigos de PC a PC: ¡Es GRATIS! Pruébalo > > <http://get.live.com/messenger/overview> > > > > > -- > Orbeon Forms - Web Forms for the Enterprise Done the Right Way > http://www.orbeon.com/ > Prueba algunos de los nuevos servicios en línea que te ofrece Windows Live Ideas: tan nuevos que ni siquiera se han publicado oficialmente todavía. Pruébalo -- 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 |