Hello, I need help with a couple of issues using Orbeon XForms: * I'm trying to insert JUST one row. I mean, if I already have one row inserted, I need not being allowed to insert any more. I've tried it using number="1" in repeat line: <xforms:repeat nodeset="Interventor" id="Interventor-repeat" number="1">, using nodeset=xpath with [1>last()] in xforms:insert line and using at=1 in the same line but without success * Once rows are inserted in this way, I get a XML with an incorrect order because rows inserted are allocated on the XML above. Is there any way to insert the rows in the correct place? Maybe something to mark the location through the xpath... ---------------------------------------------------------------------- The code I'm using to insert one (or more :( ) rows of one kind is: < tr> <td class="cabecera1">Secretario <xforms:trigger appearance="minimal"> <xforms:label><img src="../apps/formularios/imagenes/add.gif"/></xforms:label> <xforms:insert ev:event="DOMActivate" nodeset="Secretario" at="last()" position="after" origin="instance('Secretario-template')"> <xsl:attribute name="context">instance('documento-instance')/ <xsl:copy-of select="$InfoAdicinal-name" />/EntLocal </xsl:attribute> </xforms:insert> </xforms:trigger> </td> </tr> <xforms:repeat nodeset="Secretario" id="Secretario-repeat"> <tr> <td class="celda-remove"> <xforms:trigger appearance="minimal"> <xforms:delete ev:event="DOMActivate" nodeset="Secretario" context="instance('documento-instance')" at="index('Secretario-repeat')" > <xsl:attribute name="nodeset"> <xsl:copy-of select="$InfoAdicinal-name" />/EntLocal/Secretario </xsl:attribute> </xforms:delete> <xforms:label>X</xforms:label> </xforms:trigger> </td> <td> <xforms:input ref="NIF-NIE"> <xforms:label class="sort-label">NIF-NIE</xforms:label> </xforms:input> </td> <td> <xforms:input ref="Apellido1"> <xforms:label class="sort-label">Apellido 1</xforms:label> </xforms:input> </td> <td> <xforms:input ref="Apellido2"> <xforms:label class="sort-label">Apellido 2</xforms:label> </xforms:input> </td> <td> <xforms:input ref="Nombre"> <xforms:label class="sort-label">Nombre</xforms:label> </xforms:input> </td> <td> <xforms:input ref="CorElectronico"> <xforms:label class="sort-label">Dir. Electrónica</xforms:label> </xforms:input> </td> </tr> </xforms:repeat>------------------------------------------------------------------ Thank you very much. Nina. Express yourself instantly with MSN Messenger! MSN Messenger -- 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
|
Nina,
Yes, you can control this with the "at" attribute on xforms:repeat. Don't use "number", this is not a valid attribute on xforms:insert. Note that if you send a standalone example that runs in the sandbox, we can more easily check it out. -Erik aa aa wrote: > > Hello, > > I need help with a couple of issues using Orbeon XForms: > > * I'm trying to insert JUST one row. I mean, if I already have one row > inserted, I need not being allowed to insert any more. > > I've tried it using number="1" in repeat line: > <xforms:repeat nodeset="Interventor" id="Interventor-repeat" > number="1">, > using nodeset=xpath with [1>last()] in xforms:insert line and > using at=1 in the same line but without success > > > * Once rows are inserted in this way, I get a XML with an incorrect > order because rows inserted are allocated on the XML above. Is there any > way to insert the rows in the correct place? > Maybe something to mark the location through the xpath... > > ---------------------------------------------------------------------- > > The code I'm using to insert one (or more :( ) rows of one kind is: > > > <tr> > > <td class="cabecera1">Secretario > > <xforms:trigger appearance="minimal"> > > <xforms:label><img > src="../apps/formularios/imagenes/add.gif"/></xforms:label> > > <xforms:insert ev:event="DOMActivate" nodeset="Secretario" at="last()" > position="after" origin="instance('Secretario-template')"> > > <xsl:attribute name="context"> > > instance('documento-instance')/<xsl:copy-of select="$InfoAdicinal-name" > />/EntLocal > > </xsl:attribute> > > </xforms:insert> > > </xforms:trigger> > > </td> > > </tr> > > <xforms:repeat nodeset="Secretario" id="Secretario-repeat"> > > <tr> > > <td class="celda-remove"> > > <xforms:trigger appearance="minimal"> > > <xforms:delete ev:event="DOMActivate" nodeset="Secretario" > context="instance('documento-instance')" at="index('Secretario-repeat')" > > > <xsl:attribute name="nodeset"> > > <xsl:copy-of select="$InfoAdicinal-name" />/EntLocal/Secretario > > </xsl:attribute> > > </xforms:delete> > > <xforms:label>X</xforms:label> > > </xforms:trigger> > > </td> > > <td> > > <xforms:input ref="NIF-NIE"> > > <xforms:label class="sort-label">NIF-NIE</xforms:label> > > </xforms:input> > > </td> > > <td> > > <xforms:input ref="Apellido1"> > > <xforms:label class="sort-label">Apellido 1</xforms:label> > > </xforms:input> > > </td> > > <td> > > <xforms:input ref="Apellido2"> > > <xforms:label class="sort-label">Apellido 2</xforms:label> > > </xforms:input> > > </td> > > <td> > > <xforms:input ref="Nombre"> > > <xforms:label class="sort-label">Nombre</xforms:label> > > </xforms:input> > > </td> > > <td> > > <xforms:input ref="CorElectronico"> > > <xforms:label class="sort-label">Dir. Electrónica</xforms:label> > > </xforms:input> > > </td> > > </tr> > > </xforms:repeat> > ------------------------------------------------------------------ > Thank you very much. > > > Nina. > > > > > > ------------------------------------------------------------------------ > Express yourself instantly with MSN Messenger! MSN Messenger > <http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/> > -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Hello again, maybe I didn't express what I really wanted to, sorry :( Using at=1, I get emplacing a row in the 1st position (at least, it's what I think), but it's not my aim, what I want is just allowing insert one row (or none), if I have something like it: Secretario + if I click on '+' mark, one row is added: Secretario + X NIF-NIE ________ Apellido1__________ Apellido2____________ Nombre__________ if I click again on '+' mark, a second row is added... Secretario + X NIF-NIE ________ Apellido1__________ Apellido2____________ Nombre__________ X NIF-NIE ________ Apellido1__________ Apellido2____________ Nombre__________ ...an so on. What I want to get is not allowing more than one row including some attribute in 'insert' or 'repeat' line (I think it may be possible) As a result of it, if I don't have line added and I click on '+' and I do, when it is inserted into the xml file, it is not made in the correct place but at the beginnig of the file, getting a xml with an incorrect order. I'd like to know if there is a way to insert elements in the correct place. Thank you very much again. > Date: Thu, 11 Oct 2007 16:35:20 -0700 > From: [hidden email] > To: [hidden email] > Subject: Re: [ops-users] Inserting rows with Orbeon Xforms. Placing them into XML > > Nina, > > Yes, you can control this with the "at" attribute on xforms:repeat. > Don't use "number", this is not a valid attribute on xforms:insert. > > Note that if you send a standalone example that runs in the sandbox, we > can more easily check it out. > > -Erik > > aa aa wrote: > > > > Hello, > > > > I need help with a couple of issues using Orbeon XForms: > > > > * I'm trying to insert JUST one row. I mean, if I already have one row > > inserted, I need not being allowed to insert any more. > > > > I've tried it using number="1" in repeat line: > > <xforms:repeat nodeset="Interventor" id="Interventor-repeat" > > number="1">, > > using nodeset=xpath with [1>last()] in xforms:insert line and > > using at=1 in the same line but without success > > > > > > * Once rows are inserted in this way, I get a XML with an incorrect > > order because rows inserted are allocated on the XML above. Is there any > > way to insert the rows in the correct place? > > Maybe something to mark the location through the xpath... > > > > ---------------------------------------------------------------------- > > > > The code I'm using to insert one (or more :( ) rows of one kind is: > > > > > > <tr> > > > > <td class="cabecera1">Secretario > > > > <xforms:trigger appearance="minimal"> > > > > <xforms:label><img > > src="../apps/formularios/imagenes/add.gif"/></xforms:label> > > > > <xforms:insert ev:event="DOMActivate" nodeset="Secretario" at="last()" > > position="after" origin="instance('Secretario-template')"> > > > > <xsl:attribute name="context"> > > > > instance('documento-instance')/<xsl:copy-of select="$InfoAdicinal-name" > > />/EntLocal > > > > </xsl:attribute> > > > > </xforms:insert> > > > > </xforms:trigger> > > > > </td> > > > > </tr> > > > > <xforms:repeat nodeset="Secretario" id="Secretario-repeat"> > > > > <tr> > > > > <td class="celda-remove"> > > > > <xforms:trigger appearance="minimal"> > > > > <xforms:delete ev:event="DOMActivate" nodeset="Secretario" > > context="instance('documento-instance')" at="index('Secretario-repeat')" > > > > > <xsl:attribute name="nodeset"> > > > > <xsl:copy-of select="$InfoAdicinal-name" />/EntLocal/Secretario > > > > </xsl:attribute> > > > > </xforms:delete> > > > > <xforms:label>X</xforms:label> > > > > </xforms:trigger> > > > > </td> > > > > <td> > > > > <xforms:input ref="NIF-NIE"> > > > > <xforms:label class="sort-label">NIF-NIE</xforms:label> > > > > </xforms:input> > > > > </td> > > > > <td> > > > > <xforms:input ref="Apellido1"> > > > > <xforms:label class="sort-label">Apellido 1</xforms:label> > > > > </xforms:input> > > > > </td> > > > > <td> > > > > <xforms:input ref="Apellido2"> > > > > <xforms:label class="sort-label">Apellido 2</xforms:label> > > > > </xforms:input> > > > > </td> > > > > <td> > > > > <xforms:input ref="Nombre"> > > > > <xforms:label class="sort-label">Nombre</xforms:label> > > > > </xforms:input> > > > > </td> > > > > <td> > > > > <xforms:input ref="CorElectronico"> > > > > <xforms:label class="sort-label">Dir. Electrónica</xforms:label> > > > > </xforms:input> > > > > </td> > > > > </tr> > > > > </xforms:repeat> > > ------------------------------------------------------------------ > > Thank you very much. > > > > > > Nina. > > > > > > > > > > > > ------------------------------------------------------------------------ > > Express yourself instantly with MSN Messenger! MSN Messenger > > <http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/> > > > > > -- > Orbeon Forms - Web Forms for the Enterprise Done the Right Way > http://www.orbeon.com/ Express yourself instantly with MSN Messenger! MSN Messenger -- 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
|
On 10/15/07, aa aa <[hidden email]> wrote:
> if I click on '+' mark, one row is added: > > Secretario + > X NIF-NIE ________ Apellido1__________ > Apellido2____________ Nombre__________ > > if I click again on '+' mark, a second row is added... > > Secretario + > X NIF-NIE ________ Apellido1__________ > Apellido2____________ Nombre__________ > X NIF-NIE ________ Apellido1__________ > Apellido2____________ Nombre__________ > > ...an so on. being added when you first press on +, but the second time you press on + you wouldn't want anything to happen (instead of having a second line inserted). Is that right? If this is the case, you can just use an if="..." on the <xforms:insert> so you don't run the insert if there is already a line there. Alex -- Orbeon Forms - Web 2.0 Forms, open-source, 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |