Question on select1

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

Question on select1

Marcus-2
Hi
 
i've got the following situation and try to find a dynamical solution. Here we go:
 
Part of my document-instance:
---------------------------------------------
<Ident>
    <Quellen>
        <Quelle>
            <Bib/>
            <Qid/>
            <Seiten/>
        </Quelle>
        <Quelle>
            <Bib/>
            <Qid/>
            <Seiten/>
        </Quelle>
        <Quelle>
            <Bib/>
            <Qid/>
            <Seiten/>
        </Quelle>
    </Quellen>
</Ident>
 
Part of my reference-instance:
-------------------------------------------
<references>
    <reference>
        <id>2</id>
        <Kurztitel>Testlink 2</Kurztitel>
    </reference>
    <reference>
        <id>3</id>
        <Kurztitel>Testlink 3</Kurztitel>
    </reference>
</references>
 
Part of my view:
-----------------------
<xforms:group ref="Ident">
    <xforms:group ref="Quellen">
    <table align="left">
        <xforms:repeat nodeset="Quelle" id="hsq-repeat">
            <tr>
                <td><xforms:output value="count(preceding-sibling::Quelle) + 1"/></td>
                <td>
                    <xforms:select1 ref="Bib">
                        <xforms:item>
                            <xforms:label value=" 'Neue Referenz' "/>
                            <xforms:value/>
                        </xforms:item>
                        <xforms:itemset nodeset="xxforms:instance('references-instance')//reference/Kurztitel">
                            <xforms:label ref="."/>
                            <xforms:value ref="."/>
                        </xforms:itemset>
                        <xforms:action ev:event="xforms-value-changed">
 
<!-- this part i'm searching for :
While select1 ref="Bib" sets the value of Bib automatical, i need to set ref="Qid" to the ID of Bib.
So, when selecting Testlink2 <Bib>Testlink2</Bib> AND <Qid>2</Qid>
But i need to do this with only having this information, so inside my xforms-groups, so can use this part anywhere in my doc, without having to change paths. Is that possible?
-->
 
                        </xforms:action>
                    </xforms:select1>
                </td>
                <td>
                    <xforms:output model="resources-model" value="instance('resources-instance')/forms/detail/titles/Kurztitel"/>:
                    <xforms:output ref="Bib" class="dmv-last-name"/>
                </td>
                <td>
                    <xforms:output model="resources-model" value="instance('resources-instance')/forms/detail/titles/ref-id"/>:
                    <xforms:output ref="Qid" class="dmv-last-name"/>
                </td>
                <td>
                    <xforms:output model="resources-model" value="instance('resources-instance')/forms/detail/titles/Seiten"/>:
                    <xforms:input incremental="true" ref="Seiten" class="dmv-last-name"/>
                </td>
            </tr>
        </xforms:repeat>
    </table>
    </xforms:group>
</xforms:group>
 
 
Regards, Marcus


--
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: Question on select1

Marcus-2
Hi,
i could solve this one with the help of the extension-function "xxforms:repeat-current()"
 
<xforms:repeat nodeset="Quelle" id="hsq-repeat">
<tr>
    <td><xforms:output value="count(preceding-sibling::Quelle) + 1"/></td>
    <td>
        <xforms:select1 ref="Bib">
            <xforms:item>
                <xforms:label value=" 'Neue Referenz' "/>
                <xforms:value/>
            </xforms:item>
            <xforms:itemset nodeset="xxforms:instance('references-instance')//reference/Kurztitel">
                <xforms:label ref="."/>
                <xforms:value ref="."/>
            </xforms:itemset>
            <xforms:action ev:event="xforms-value-changed">
                <xforms:setvalue ref="xxforms:repeat-current()/Qid" value="xxforms:instance('references-instance')//reference[Kurztitel/text()=xxforms:repeat-current()/Bib]/id" />
            </xforms:action>
        </xforms:select1>
    </td>
</tr>
</xforms:repeat>
 
I bit tricky, but this function does great work! :-))
Just want to let you know, that this question is closed.
 
Regards, Marcus
 
 


--
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: Question on select1

Erik Bruchez
Administrator
Marcus wrote:

> Hi,
> i could solve this one with the help of the extension-function
> "xxforms:repeat-current()"
>  
> <xforms:repeat nodeset="Quelle" id="hsq-repeat">
> <tr>
>     <td><xforms:output value="count(preceding-sibling::Quelle) + 1"/></td>
>     <td>
>         <xforms:select1 ref="Bib">
>             <xforms:item>
>                 <xforms:label value=" 'Neue Referenz' "/>
>                 <xforms:value/>
>             </xforms:item>
>             <xforms:itemset
> nodeset="xxforms:instance('references-instance')//reference/Kurztitel">
>                 <xforms:label ref="."/>
>                 <xforms:value ref="."/>
>             </xforms:itemset>
>             <xforms:action ev:event="xforms-value-changed">
>                 <xforms:setvalue ref="xxforms:repeat-current()/Qid"
> value="xxforms:instance('references-instance')//reference[Kurztitel/text()=xxforms:repeat-current()/Bib]/id"
> />
>             </xforms:action>
>         </xforms:select1>
>     </td>
> </tr>
> </xforms:repeat>
>  
> I bit tricky, but this function does great work! :-))
> Just want to let you know, that this question is closed.
We like those ;-)

-Erik

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