Don't delete the first position

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

Don't delete the first position

simone123456
How can I don't delete the first element of the model?
for example:
I have
<xforms:instance id="instance-rubrica">
                        <rubrica xmlns="">
                        <nomi>
                                        <nome>simone</nome>
                                        <nome>giacomo</nome>
                                        <nome>francesco</nome>
                        </nomi>               
                           </rubrica>

and I don't wont to delete the first I have try to set the index or set one focus,switch but i don't have understand how could I do.
Somethink can redirect me to somethink that isn't the w3c page because I 'm novice and more thing that for the w3c are obvious not are obvious  for me.
Reply | Threaded
Open this post in threaded view
|

Re: Don't delete the first position

Alessandro Vernet
Administrator
On Tue, Jul 29, 2008 at 8:24 AM, simone123456 <[hidden email]> wrote:

> How can I don't delete the first element of the model?
> for example:
> I have
> <xforms:instance id="instance-rubrica">
>                        <rubrica xmlns="">
>                        <nomi>
>                                        <nome>simone</nome>
>                                        <nome>giacomo</nome>
>                                        <nome>francesco</nome>
>                        </nomi>
>                           </rubrica>
>
> and I don't wont to delete the first I have try to set the index or set one
> focus,switch but i don't have understand how could I do.
> Somethink can redirect me to somethink that isn't the w3c page because I 'm
> novice and more thing that for the w3c are obvious not are obvious  for me.
You do not want to delete the first <nome>? How are you doing the
deletion? Are you using an <xforms:delete>? What does the code that
does the <xforms:delete> look like?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
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
Reply | Threaded
Open this post in threaded view
|

Re: Don't delete the first position

simone123456

Alessandro Vernet wrote
On Tue, Jul 29, 2008 at 8:24 AM, simone123456 <alien1982@libero.it> wrote:
> How can I don't delete the first element of the model?
> for example:
> I have
> <xforms:instance id="instance-rubrica">
>                        <rubrica xmlns="">
>                        <nomi>
>                                        <nome>simone</nome>
>                                        <nome>giacomo</nome>
>                                        <nome>francesco</nome>
>                        </nomi>
>                           </rubrica>
>
> and I don't wont to delete the first I have try to set the index or set one
> focus,switch but i don't have understand how could I do.
> Somethink can redirect me to somethink that isn't the w3c page because I 'm
> novice and more thing that for the w3c are obvious not are obvious  for me.

You do not want to delete the first <nome>? How are you doing the
deletion? Are you using an <xforms:delete>? What does the code that
does the <xforms:delete> look like?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet


--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws


-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/
because I have this code:
--
<xforms:repeat id="iteraSuINomi" nodeset="instance('instance-rubrica')/nomi/nome">
                 
                        <div>
                 
                   
<xforms:output value="./text()"/> 


           
                     </div>       
   

</xforms:repeat>
                <xforms:trigger>
 
           <xforms:label> delete nome </xforms:label>
                                <xforms:delete ev:event="DOMActivate" context="instance('instance-rubrica')"  nodeset="nomi/nome" at="index('iteraSuINomi')"/>
        </xforms:trigger>
                <xforms:trigger>
 
           <xforms:label> add nome </xforms:label>
               
                <xforms:insert ev:event="DOMActivate" context="instance('instance-rubrica')" nodeset="nomi/nome" origin="instance('instance-modifica-rubrica')/nome" />
     

  </xforms:trigger>
--
and also this model:
--

  <xforms:instance id="instance-modifica-rubrica">
                        <modifica-rubrica xmlns="">
                               
                                        <nome>giovanni</nome>
                               
                       
                        </modifica-rubrica>
            </xforms:instance> 
--
and I want to add always one name but if I delete all name I can't add one name, so I thought to put at first one elemente <nome/> and to do something that don't delete the first element that is <nome/> the element empty.I could also don't display the buttuon delete if I have one element but I haven't find something that don't display the button

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

Re: Don't delete the first position

simone123456
In reply to this post by simone123456
For the other people I post the solution tha I have found:
code:
--
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
            xmlns:xforms="http://www.w3.org/2002/xforms"
            xmlns:ev="http://www.w3.org/2001/xml-events"
            xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
    <xhtml:head>
        <xhtml:title>Modifica page-flow</xhtml:title>
        <xforms:model>
   
        <xforms:instance id="instance-rubrica">
                        <rubrica xmlns="">
                        <nomi>

                                  <nome>simone</nome>
                                        <nome>giacomo</nome>
                                        <nome>francesco</nome>
                                        <nome/>       
                        </nomi>               
                        <save>
                                <empty>false</empty>
                        </save>
                        <valore value="3"/>
                       
                       
                       
               
               
                       
                           </rubrica>
                           
            </xforms:instance>
           
           
               
               
               
               
               
               
               
               
               
               
               
               
               
               
                <xforms:instance id="instance-modifica-rubrica">
                        <modifica-rubrica xmlns="">
                               
                                        <nome>giovanni</nome>
                               
                       
                        </modifica-rubrica>
            </xforms:instance>
           <xforms:bind nodeset="instance('instance-rubrica')/save" readonly="empty='true'"/>




    </xforms:model>
                               
       
       
       
    </xhtml:head>
    <xhtml:body>





<xforms:repeat id="iteraSuINomi" nodeset="instance('instance-rubrica')/nomi/nome">
                 
                        <div>
                 
                   
<xforms:output value="./text()"/> 


           
                     </div>       
   

</xforms:repeat>
                <xforms:trigger ref="instance('instance-rubrica')/save">
 
          <xforms:label> delete nome </xforms:label>
         
 

          <xforms:delete ev:event="DOMActivate" context="instance('instance-rubrica')"  nodeset="nomi/nome" at="index('iteraSuINomi')"/>
   

<xforms:setvalue ev:event="DOMActivate"  ref="instance('instance-rubrica')/valore/@value"
 value="instance('instance-rubrica')/valore/@value -1" />


 <xforms:setvalue ev:event="DOMActivate"  ref="instance('instance-rubrica')/save/empty"
 value="if(instance('instance-rubrica')/valore/@value = 0)then 'true'else 'false'" />




        </xforms:trigger>
       
       
       
        --<xforms:output value="instance('instance-rubrica')/valore/@value"/>--
 
                <xforms:trigger>
 
           <xforms:label> add nome </xforms:label>
               
                <xforms:insert ev:event="DOMActivate" context="instance('instance-rubrica')" nodeset="nomi/nome" origin="instance('instance-modifica-rubrica')/nome" />
     
                <xforms:setvalue ev:event="DOMActivate"  ref="instance('instance-rubrica')/valore/@value"
 value="instance('instance-rubrica')/valore/@value +1" />
<xforms:setvalue ev:event="DOMActivate"  ref="instance('instance-rubrica')/save/empty"
 value="if(instance('instance-rubrica')/valore/@value = 0)then 'false'else ''" />

  </xforms:trigger>
                 

    <widget:xforms-instance-inspector xmlns:widget="http://orbeon.org/oxf/xml/widget"/>
    </xhtml:body>
</xhtml:html>


--
Simone
-------

simone123456 wrote
How can I don't delete the first element of the model?
for example:
I have
<xforms:instance id="instance-rubrica">
                        <rubrica xmlns="">
                        <nomi>
                                        <nome>simone</nome>
                                        <nome>giacomo</nome>
                                        <nome>francesco</nome>
                        </nomi>               
                           </rubrica>

and I don't wont to delete the first I have try to set the index or set one focus,switch but i don't have understand how could I do.
Somethink can redirect me to somethink that isn't the w3c page because I 'm novice and more thing that for the w3c are obvious not are obvious  for me.