xforms-groups not works with multi-instance on the page

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

xforms-groups not works with multi-instance on the page

Leonardo-6
hi guys,
i'm working with xforms-groups, but i have a problem with the hide/show
groups (with relevant attribute in the bind tag) when on the page i
define more instances.

If you copy and paste the following code, the page does not work
correctly. But if you move the instance with id = searchForm and its
bind node after the instance with id = list the page works correctly...

Is this a bug ... or there is an error?


<xhtml:html
    xmlns:xforms="http://www.w3.org/2002/xforms"
    xmlns:f="http://orbeon.org/oxf/xml/formatting"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
    xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
    xmlns:widget="http://orbeon.org/oxf/xml/widget"
    xmlns:ev="http://www.w3.org/2001/xml-events"
    xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
    xmlns:xsl="http://www.w3c.org/1999/XSL/Transform"
 >
    <xhtml:head>
        <xhtml:title></xhtml:title>
        <xforms:model id="default">
           
            <xforms:instance id="searchForm">
                <searchform>
                    <id></id>
                    <author></author>
                    <projectname></projectname>
                    <datefrom></datefrom>
                    <dateto></dateto>
                    <companycode></companycode>
                    <companydescription></companydescription>
                    <input></input>
                    <mode>edit</mode>                  
                </searchform>
            </xforms:instance>
            <xforms:bind nodeset="/searchform/id"
type="xs:nonNegativeInteger"/>
            <xforms:bind nodeset="/searchform/author" type="xs:string" />
            <xforms:bind nodeset="/searchform/projectname"
type="xs:string" />
            <xforms:bind nodeset="/searchform/datefrom" type="xs:date" />
            <xforms:bind nodeset="/searchform/dateto" type="xs:date" />
            <xforms:bind nodeset="/searchform/companycode"
type="xs:string"/>
            <xforms:bind nodeset="/searchform/companydescription"
type="xs:string" />
            <xforms:bind nodeset="/searchform/input" relevant="../mode =
'edit'" />
                                               
            <xforms:instance id="list">
                <list>
                    <element id="1" mode="view"  input="" output=""
save-trigger=""/>
                    <element id="2" mode="view" input="" output=""
save-trigger=""/>
                    <element id="3" mode="view" input="" output=""
save-trigger=""/>
                </list>
            </xforms:instance>
           
            <xforms:bind nodeset="/list/element/@id"
type="xs:nonNegativeInteger"/>          
            <xforms:bind nodeset="/list/element/@input"
relevant="../@mode = 'edit'"/>          
            <xforms:bind nodeset="/list/element/@output"
relevant="../@mode = 'view'"/>
            <xforms:bind nodeset="/list/element/@save-trigger"
relevant="../@mode = 'edit'"/>
            <xforms:bind nodeset="/list/element/@mode" type="xs:string"/>
           
           
           
            <xforms:submission ref="instance('list')" id="saveInstance"
method="post" action="/activity" replace="instance" instance="list" />
           
           
        </xforms:model>          
        <xhtml:style type="text/css">
            .input input { width: 150px; }
            .password { width: 20em; }
            .textarea { height: 6em; width: 20em; }
            .list-container { padding: 5px; margin-top: 0,5em;
margin-bottom: 2px; border: solid 1px #f93;}
        </xhtml:style>      
   </xhtml:head>
    <xhtml:body>
         <xhtml:p>
                 <xhtml:div style="padding: 5px;width: 300px;">
                    <xforms:submit submission="saveInstance">
                        <xforms:label>Salva attivita'</xforms:label>
                    </xforms:submit>
                </xhtml:div>                          
                 <xhtml:div class="list-container">
                     <xforms:repeat
nodeset="instance('list')/element[position()]" id="activities-list-repeat">
                         <xhtml:div class="list-container" style="
width: 15%;">
                             <xforms:group ref="@output">  
                                 <xforms:output ref="../@id">
                                     <xforms:alert>Id deve essere un
numero maggiore di 0</xforms:alert>
                                 </xforms:output>
                                 <xforms:output ref="../@mode" />
                                 <xforms:trigger id="changeModeInput">
                                     <xforms:label>Edit</xforms:label>
                                     <xforms:action ev:event="DOMActivate">
                                        <xforms:setvalue
ref="/list/element[index('activities-list-repeat')]/@mode" value="'edit'"/>
                                        <xforms:setfocus
control="idActivity"/>
                                    </xforms:action>
                                </xforms:trigger>
                             </xforms:group>  
                             <xforms:group>
                                 <xforms:group ref="@input">            
       
                                    <xforms:input ref="../@id"
id="idActivity">
                                      <xforms:label></xforms:label>
                                      <xforms:alert>Id deve essere un
numero maggiore di 0</xforms:alert>
                                    </xforms:input>
                                    <xforms:input ref="../@mode"
id="modeActivity">
                                      <xforms:label></xforms:label>
                                    </xforms:input>
                                </xforms:group>                        
           
                                    <xforms:trigger
id="changeModeOutput" ref="@save-trigger" >
                                         <xforms:label>Salva</xforms:label>
                                    </xforms:trigger>
                                    <xforms:setvalue
ref="/list/element[index('activities-list-repeat')]/@mode"
value="'view'" ev:event="DOMActivate"/>
                             </xforms:group>                  
                        </xhtml:div>                                    
                   
                     </xforms:repeat>
                 </xhtml:div>          
        </xhtml:p>                              
    </xhtml:body>
</xhtml:html>


Thank's a lot
Leonardo


--
Ing. Leonardo Reale

QUIX S.r.l.

Strada Statale 413, 160/162
41019 - Soliera (MO)
Loc.Appalto - ITALY
Tel. 0039 059 565388
Fax. 0039 059 565322

[hidden email]
[hidden email]





--
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
Reply | Threaded
Open this post in threaded view
|

Re: xforms-groups not works with multi-instance on the page

Hank Ratzesberger
Leonardo,

I don't see where your group statements specify the instance.
With multiple instances, the engine defaults to the first
instance.  Perhaps:

<xforms:bind nodeset="instance('list')/list/element/@id"
  type="xs:nonNegativeInteger"/>

I usually do the markup this way:

<xforms:bind nodeset="instance('list')>
  <xforms:bind nodeset="/list/element/@id"  type="xs:nonNegativeInteger"/>
  ......
</xforms:bind>

Hoping that helps,
Hank

Hank Ratzesberger
Institute for Crustal Studies
University of California, Santa Barbara

----- Original Message -----
From: "Leonardo Reale" <[hidden email]>
To: <[hidden email]>
Sent: Monday, January 08, 2007 8:37 AM
Subject: [ops-users] xforms-groups not works with multi-instance on the page


> hi guys,
> i'm working with xforms-groups, but i have a problem with the hide/show
> groups (with relevant attribute in the bind tag) when on the page i
> define more instances.
>
> If you copy and paste the following code, the page does not work
> correctly. But if you move the instance with id = searchForm and its
> bind node after the instance with id = list the page works correctly...
>
> Is this a bug ... or there is an error?
>
>
> <xhtml:html
>    xmlns:xforms="http://www.w3.org/2002/xforms"
>    xmlns:f="http://orbeon.org/oxf/xml/formatting"
>    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>    xmlns:xhtml="http://www.w3.org/1999/xhtml"
>    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
>    xmlns:xi="http://www.w3.org/2001/XInclude"
>    xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
>    xmlns:widget="http://orbeon.org/oxf/xml/widget"
>    xmlns:ev="http://www.w3.org/2001/xml-events"
>    xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
>    xmlns:xsl="http://www.w3c.org/1999/XSL/Transform"
> >
>    <xhtml:head>
>        <xhtml:title></xhtml:title>
>        <xforms:model id="default">
>          
>            <xforms:instance id="searchForm">
>                <searchform>
>                    <id></id>
>                    <author></author>
>                    <projectname></projectname>
>                    <datefrom></datefrom>
>                    <dateto></dateto>
>                    <companycode></companycode>
>                    <companydescription></companydescription>
>                    <input></input>
>                    <mode>edit</mode>                  
>                </searchform>
>            </xforms:instance>
>            <xforms:bind nodeset="/searchform/id"
> type="xs:nonNegativeInteger"/>
>            <xforms:bind nodeset="/searchform/author" type="xs:string" />
>            <xforms:bind nodeset="/searchform/projectname"
> type="xs:string" />
>            <xforms:bind nodeset="/searchform/datefrom" type="xs:date" />
>            <xforms:bind nodeset="/searchform/dateto" type="xs:date" />
>            <xforms:bind nodeset="/searchform/companycode"
> type="xs:string"/>
>            <xforms:bind nodeset="/searchform/companydescription"
> type="xs:string" />
>            <xforms:bind nodeset="/searchform/input" relevant="../mode =
> 'edit'" />
>                                              
>            <xforms:instance id="list">
>                <list>
>                    <element id="1" mode="view"  input="" output=""
> save-trigger=""/>
>                    <element id="2" mode="view" input="" output=""
> save-trigger=""/>
>                    <element id="3" mode="view" input="" output=""
> save-trigger=""/>
>                </list>
>            </xforms:instance>
>          
>            <xforms:bind nodeset="/list/element/@id"
> type="xs:nonNegativeInteger"/>          
>            <xforms:bind nodeset="/list/element/@input"
> relevant="../@mode = 'edit'"/>          
>            <xforms:bind nodeset="/list/element/@output"
> relevant="../@mode = 'view'"/>
>            <xforms:bind nodeset="/list/element/@save-trigger"
> relevant="../@mode = 'edit'"/>
>            <xforms:bind nodeset="/list/element/@mode" type="xs:string"/>
>          
>          
>          
>            <xforms:submission ref="instance('list')" id="saveInstance"
> method="post" action="/activity" replace="instance" instance="list" />
>          
>          
>        </xforms:model>          
>        <xhtml:style type="text/css">
>            .input input { width: 150px; }
>            .password { width: 20em; }
>            .textarea { height: 6em; width: 20em; }
>            .list-container { padding: 5px; margin-top: 0,5em;
> margin-bottom: 2px; border: solid 1px #f93;}
>        </xhtml:style>      
>   </xhtml:head>
>    <xhtml:body>
>         <xhtml:p>
>                 <xhtml:div style="padding: 5px;width: 300px;">
>                    <xforms:submit submission="saveInstance">
>                        <xforms:label>Salva attivita'</xforms:label>
>                    </xforms:submit>
>                </xhtml:div>                          
>                 <xhtml:div class="list-container">
>                     <xforms:repeat
> nodeset="instance('list')/element[position()]" id="activities-list-repeat">
>                         <xhtml:div class="list-container" style="
> width: 15%;">
>                             <xforms:group ref="@output">  
>                                 <xforms:output ref="../@id">
>                                     <xforms:alert>Id deve essere un
> numero maggiore di 0</xforms:alert>
>                                 </xforms:output>
>                                 <xforms:output ref="../@mode" />
>                                 <xforms:trigger id="changeModeInput">
>                                     <xforms:label>Edit</xforms:label>
>                                     <xforms:action ev:event="DOMActivate">
>                                        <xforms:setvalue
> ref="/list/element[index('activities-list-repeat')]/@mode" value="'edit'"/>
>                                        <xforms:setfocus
> control="idActivity"/>
>                                    </xforms:action>
>                                </xforms:trigger>
>                             </xforms:group>  
>                             <xforms:group>
>                                 <xforms:group ref="@input">            
>      
>                                    <xforms:input ref="../@id"
> id="idActivity">
>                                      <xforms:label></xforms:label>
>                                      <xforms:alert>Id deve essere un
> numero maggiore di 0</xforms:alert>
>                                    </xforms:input>
>                                    <xforms:input ref="../@mode"
> id="modeActivity">
>                                      <xforms:label></xforms:label>
>                                    </xforms:input>
>                                </xforms:group>                        
>          
>                                    <xforms:trigger
> id="changeModeOutput" ref="@save-trigger" >
>                                         <xforms:label>Salva</xforms:label>
>                                    </xforms:trigger>
>                                    <xforms:setvalue
> ref="/list/element[index('activities-list-repeat')]/@mode"
> value="'view'" ev:event="DOMActivate"/>
>                             </xforms:group>                  
>                        </xhtml:div>                                    
>                  
>                     </xforms:repeat>
>                 </xhtml:div>          
>        </xhtml:p>                              
>    </xhtml:body>
> </xhtml:html>
>
>
> Thank's a lot
> Leonardo
>
>
> --
> Ing. Leonardo Reale
>
> QUIX S.r.l.
>
> Strada Statale 413, 160/162
> 41019 - Soliera (MO)
> Loc.Appalto - ITALY
> Tel. 0039 059 565388
> Fax. 0039 059 565322
>
> [hidden email]
> [hidden email]
>
>
>
>

--------------------------------------------------------------------------------


>
> --
> 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
>



--
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
Reply | Threaded
Open this post in threaded view
|

Re: xforms-groups not works with multi-instance on the page

Leonardo-6
Thanks a lot....

It works fine...

Best reguards
Leonardo

Hank Ratzesberger ha scritto:

> Leonardo,
>
> I don't see where your group statements specify the instance.
> With multiple instances, the engine defaults to the first instance.  
> Perhaps:
>
> <xforms:bind nodeset="instance('list')/list/element/@id"
>  type="xs:nonNegativeInteger"/>
>
> I usually do the markup this way:
>
> <xforms:bind nodeset="instance('list')>
>  <xforms:bind nodeset="/list/element/@id"  type="xs:nonNegativeInteger"/>
>  ...... </xforms:bind>
>
> Hoping that helps,
> Hank
>
> Hank Ratzesberger
> Institute for Crustal Studies
> University of California, Santa Barbara
>
> ----- Original Message ----- From: "Leonardo Reale"
> <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, January 08, 2007 8:37 AM
> Subject: [ops-users] xforms-groups not works with multi-instance on
> the page
>
>
>> hi guys,
>> i'm working with xforms-groups, but i have a problem with the
>> hide/show groups (with relevant attribute in the bind tag) when on
>> the page i define more instances.
>>
>> If you copy and paste the following code, the page does not work
>> correctly. But if you move the instance with id = searchForm and its
>> bind node after the instance with id = list the page works correctly...
>>
>> Is this a bug ... or there is an error?
>>
>>
>> <xhtml:html
>>    xmlns:xforms="http://www.w3.org/2002/xforms"
>>    xmlns:f="http://orbeon.org/oxf/xml/formatting"
>>    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>    xmlns:xhtml="http://www.w3.org/1999/xhtml"
>>    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
>>    xmlns:xi="http://www.w3.org/2001/XInclude"
>>    xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
>>    xmlns:widget="http://orbeon.org/oxf/xml/widget"
>>    xmlns:ev="http://www.w3.org/2001/xml-events"
>>    xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
>>    xmlns:xsl="http://www.w3c.org/1999/XSL/Transform"
>> >
>>    <xhtml:head>
>>        <xhtml:title></xhtml:title>
>>        <xforms:model id="default">
>>                      <xforms:instance id="searchForm">
>>                <searchform>
>>                    <id></id>
>>                    <author></author>
>>                    <projectname></projectname>
>>                    <datefrom></datefrom>
>>                    <dateto></dateto>
>>                    <companycode></companycode>
>>                    <companydescription></companydescription>
>>                    <input></input>
>>                    <mode>edit</mode>                                  
>> </searchform>
>>            </xforms:instance>
>>            <xforms:bind nodeset="/searchform/id"
>> type="xs:nonNegativeInteger"/>
>>            <xforms:bind nodeset="/searchform/author" type="xs:string" />
>>            <xforms:bind nodeset="/searchform/projectname"
>> type="xs:string" />
>>            <xforms:bind nodeset="/searchform/datefrom" type="xs:date" />
>>            <xforms:bind nodeset="/searchform/dateto" type="xs:date" />
>>            <xforms:bind nodeset="/searchform/companycode"
>> type="xs:string"/>
>>            <xforms:bind nodeset="/searchform/companydescription"
>> type="xs:string" />
>>            <xforms:bind nodeset="/searchform/input" relevant="../mode
>> = 'edit'" />
>>                                                          
>> <xforms:instance id="list">
>>                <list>
>>                    <element id="1" mode="view"  input="" output=""
>> save-trigger=""/>
>>                    <element id="2" mode="view" input="" output=""
>> save-trigger=""/>
>>                    <element id="3" mode="view" input="" output=""
>> save-trigger=""/>
>>                </list>
>>            </xforms:instance>
>>                      <xforms:bind nodeset="/list/element/@id"
>> type="xs:nonNegativeInteger"/>                      <xforms:bind
>> nodeset="/list/element/@input" relevant="../@mode =
>> 'edit'"/>                      <xforms:bind
>> nodeset="/list/element/@output" relevant="../@mode = 'view'"/>
>>            <xforms:bind nodeset="/list/element/@save-trigger"
>> relevant="../@mode = 'edit'"/>
>>            <xforms:bind nodeset="/list/element/@mode" type="xs:string"/>
>>                                          <xforms:submission
>> ref="instance('list')" id="saveInstance" method="post"
>> action="/activity" replace="instance" instance="list" />
>>                            </xforms:model>                
>> <xhtml:style type="text/css">
>>            .input input { width: 150px; }
>>            .password { width: 20em; }
>>            .textarea { height: 6em; width: 20em; }
>>            .list-container { padding: 5px; margin-top: 0,5em;
>> margin-bottom: 2px; border: solid 1px #f93;}
>>        </xhtml:style>        </xhtml:head>
>>    <xhtml:body>
>>         <xhtml:p>
>>                 <xhtml:div style="padding: 5px;width: 300px;">
>>                    <xforms:submit submission="saveInstance">
>>                        <xforms:label>Salva attivita'</xforms:label>
>>                    </xforms:submit>
>>                </xhtml:div>                                          
>> <xhtml:div class="list-container">
>>                     <xforms:repeat
>> nodeset="instance('list')/element[position()]"
>> id="activities-list-repeat">
>>                         <xhtml:div class="list-container" style="
>> width: 15%;">
>>                             <xforms:group ref="@output">  
>>                                 <xforms:output ref="../@id">
>>                                     <xforms:alert>Id deve essere un
>> numero maggiore di 0</xforms:alert>
>>                                 </xforms:output>
>>                                 <xforms:output ref="../@mode" />
>>                                 <xforms:trigger id="changeModeInput">
>>                                     <xforms:label>Edit</xforms:label>
>>                                     <xforms:action
>> ev:event="DOMActivate">
>>                                        <xforms:setvalue
>> ref="/list/element[index('activities-list-repeat')]/@mode"
>> value="'edit'"/>
>>                                        <xforms:setfocus
>> control="idActivity"/>
>>                                    </xforms:action>
>>                                </xforms:trigger>
>>                             </xforms:group>  
>>                             <xforms:group>
>>                                 <xforms:group
>> ref="@input">                                                    
>> <xforms:input ref="../@id" id="idActivity">
>>                                      <xforms:label></xforms:label>
>>                                      <xforms:alert>Id deve essere un
>> numero maggiore di 0</xforms:alert>
>>                                    </xforms:input>
>>                                    <xforms:input ref="../@mode"
>> id="modeActivity">
>>                                      <xforms:label></xforms:label>
>>                                    </xforms:input>
>>                                </xforms:group>                        
>>                                              <xforms:trigger
>> id="changeModeOutput" ref="@save-trigger" >
>>                                        
>> <xforms:label>Salva</xforms:label>
>>                                    </xforms:trigger>
>>                                    <xforms:setvalue
>> ref="/list/element[index('activities-list-repeat')]/@mode"
>> value="'view'" ev:event="DOMActivate"/>
>>                             </xforms:group>                  
>>                        
>> </xhtml:div>                                                      
>>                     </xforms:repeat>
>>                 </xhtml:div>                  
>> </xhtml:p>                                 </xhtml:body>
>> </xhtml:html>
>>
>>
>> Thank's a lot
>> Leonardo
>>
>>
>> --
>> Ing. Leonardo Reale
>>
>> QUIX S.r.l.
>>
>> Strada Statale 413, 160/162
>> 41019 - Soliera (MO)
>> Loc.Appalto - ITALY
>> Tel. 0039 059 565388
>> Fax. 0039 059 565322
>>
>> [hidden email]
>> [hidden email]
>>
>>
>>
>>
>
>
> --------------------------------------------------------------------------------
>
>
>
>>
>> --
>> 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
>>
>
> ------------------------------------------------------------------------
>
>
> --
> 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
>  

--
Ing. Leonardo Reale

QUIX S.r.l.

Strada Statale 413, 160/162
41019 - Soliera (MO)
Loc.Appalto - ITALY
Tel. 0039 059 565388
Fax. 0039 059 565322

[hidden email]
[hidden email]





--
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