Using bind relevant to show / hide for nested childnodes

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

Using bind relevant to show / hide for nested childnodes

Alan Soo
Hi

I have this xml structure, within an instance named MAIN...

<combined>
        <modules>
                <module>
                        <marks>
                                <mark>100</mark>
                        </marks>
                        <ranges>
                                <range>A</range>
                        </ranges>
                </module>
                <module>
                        <marks>
                                <mark>90</mark>
                        </marks>
                        <ranges>
                        </ranges>
                </module>
        </modules>
</combined>

For each module at XPATH "/combined/modules/module", I am using an xforms:repeat to show a table row for each module, and within each of that level's table, i show another 2 smaller tables, for marks and ranges.... they are each using xforms:repeat as well....

I am using a bind, to try to show / hide the smaller tables (either marks or ranges)... depending on if there is a childnode value within the first node of /marks/mark or /ranges/range

<xforms:bind nodeset="instance('triggers-instance')/available_range_trigger" relevant="instance(MAIN)/modules/module/ranges/range[1] != '' "/>

Problem is, it cannot differentiate between instance(MAIN)/modules/module[1] and instance(MAIN)/modules/module[2]....

Anyone has a solution for this, on how I can reference the module node's index?


Reply | Threaded
Open this post in threaded view
|

Re: Using bind relevant to show / hide for nested childnodes

Erik Bruchez-3
Is there one trigger per module? Or only one global trigger?

-Erik

On Wed, Dec 9, 2009 at 12:15 AM, Alan Soo <[hidden email]> wrote:

>
> Hi
>
> I have this xml structure, within an instance named MAIN...
>
> <combined>
>        <modules>
>                <module>
>                        <marks>
>                                <mark>100</mark>
>                        </marks>
>                        <ranges>
>                                <range>A</range>
>                        </ranges>
>                </module>
>                <module>
>                        <marks>
>                                <mark>90</mark>
>                        </marks>
>                        <ranges>
>                        </ranges>
>                </module>
>        </modules>
> </combined>
>
> For each module at XPATH "/combined/modules/module", I am using an
> xforms:repeat to show a table row for each module, and within each of that
> level's table, i show another 2 smaller tables, for marks and ranges....
> they are each using xforms:repeat as well....
>
> I am using a bind, to try to show / hide the smaller tables (either marks or
> ranges)... depending on if there is a childnode value within the first node
> of /marks/mark or /ranges/range
>
> <xforms:bind nodeset="instance('triggers-instance')/available_range_trigger"
> relevant="instance(MAIN)/modules/module/ranges/range[1] != '' "/>
>
> Problem is, it cannot differentiate between instance(MAIN)/modules/module[1]
> and instance(MAIN)/modules/module[2]....
>
> Anyone has a solution for this, on how I can reference the module node's
> index?
>
>
>
> --
> View this message in context: http://n4.nabble.com/Using-bind-relevant-to-show-hide-for-nested-childnodes-tp955901p955901.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.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
>
>


--
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: Using bind relevant to show / hide for nested childnodes

Alan Soo
Hi Erik,

The number of modules (instance('MAIN')/modules/module) will vary, depending on my database query return...

The number of triggers need to be dynamic..

EG:
trigger 1 would check for /modules/module[1]/ranges/range[1]
trigger 2 would check for /modules/module[2]/ranges/range[1]

Am I able to declare such a dynamic trigger?





Erik Bruchez-3 wrote
Is there one trigger per module? Or only one global trigger?

-Erik

On Wed, Dec 9, 2009 at 12:15 AM, Alan Soo <alan.soo@dnium.com> wrote:
>
> Hi
>
> I have this xml structure, within an instance named MAIN...
>
> <combined>
>        <modules>
>                <module>
>                        <marks>
>                                <mark>100</mark>
>                        </marks>
>                        <ranges>
>                                <range>A</range>
>                        </ranges>
>                </module>
>                <module>
>                        <marks>
>                                <mark>90</mark>
>                        </marks>
>                        <ranges>
>                        </ranges>
>                </module>
>        </modules>
> </combined>
>
> For each module at XPATH "/combined/modules/module", I am using an
> xforms:repeat to show a table row for each module, and within each of that
> level's table, i show another 2 smaller tables, for marks and ranges....
> they are each using xforms:repeat as well....
>
> I am using a bind, to try to show / hide the smaller tables (either marks or
> ranges)... depending on if there is a childnode value within the first node
> of /marks/mark or /ranges/range
>
> <xforms:bind nodeset="instance('triggers-instance')/available_range_trigger"
> relevant="instance(MAIN)/modules/module/ranges/range[1] != '' "/>
>
> Problem is, it cannot differentiate between instance(MAIN)/modules/module[1]
> and instance(MAIN)/modules/module[2]....
>
> Anyone has a solution for this, on how I can reference the module node's
> index?
>
>
>
> --
> View this message in context: http://n4.nabble.com/Using-bind-relevant-to-show-hide-for-nested-childnodes-tp955901p955901.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>
> --
> 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
>
>


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

Re: Using bind relevant to show / hide for nested childnodes

Alan Soo
Hi Erik,

I managed to get it working... Was using the wrong approach...

I found out that using this bind, would work...

<xforms:bind nodeset="instance('main')/modules/module/ranges/range[1]" relevant="@relevant = 'true'"/>

This will check the relevant attribute within the first node 'range'...

So over at my MAIN instance, I return as follows:

<combined>
        <modules>
                <module>
                        <marks>
                                <mark>100</mark>
                        </marks>
                        <ranges>
                                <range relevant="true">A</range>
                        </ranges>
                </module>
                <module>
                        <marks>
                                <mark>100</mark>
                        </marks>
                        <ranges>
                        </ranges>
                </module>
        </modules>
</combined>

The result is that it will show the first module's range, but not the second one...






Alan Soo wrote
Hi Erik,

The number of modules (instance('MAIN')/modules/module) will vary, depending on my database query return...

The number of triggers need to be dynamic..

EG:
trigger 1 would check for /modules/module[1]/ranges/range[1]
trigger 2 would check for /modules/module[2]/ranges/range[1]

Am I able to declare such a dynamic trigger?





Erik Bruchez-3 wrote
Is there one trigger per module? Or only one global trigger?

-Erik

On Wed, Dec 9, 2009 at 12:15 AM, Alan Soo <alan.soo@dnium.com> wrote:
>
> Hi
>
> I have this xml structure, within an instance named MAIN...
>
> <combined>
>        <modules>
>                <module>
>                        <marks>
>                                <mark>100</mark>
>                        </marks>
>                        <ranges>
>                                <range>A</range>
>                        </ranges>
>                </module>
>                <module>
>                        <marks>
>                                <mark>90</mark>
>                        </marks>
>                        <ranges>
>                        </ranges>
>                </module>
>        </modules>
> </combined>
>
> For each module at XPATH "/combined/modules/module", I am using an
> xforms:repeat to show a table row for each module, and within each of that
> level's table, i show another 2 smaller tables, for marks and ranges....
> they are each using xforms:repeat as well....
>
> I am using a bind, to try to show / hide the smaller tables (either marks or
> ranges)... depending on if there is a childnode value within the first node
> of /marks/mark or /ranges/range
>
> <xforms:bind nodeset="instance('triggers-instance')/available_range_trigger"
> relevant="instance(MAIN)/modules/module/ranges/range[1] != '' "/>
>
> Problem is, it cannot differentiate between instance(MAIN)/modules/module[1]
> and instance(MAIN)/modules/module[2]....
>
> Anyone has a solution for this, on how I can reference the module node's
> index?
>
>
>
> --
> View this message in context: http://n4.nabble.com/Using-bind-relevant-to-show-hide-for-nested-childnodes-tp955901p955901.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>
> --
> 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
>
>


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