Mutually exclusive Xforms output

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

Mutually exclusive Xforms output

ncrofts
I'm trying to display a different set of controls on an XForms application depending on whether or not a particular instance element has been defined i.e. at any time I only want one of two mutually exclusive groups of controls displayed.

If say I have an XForms instance as follows:

<xforms:instance id="results-data">
        <results>
                <result/>
        </results>
</xforms:instance>

I can then  bind to the result element with something like the following:

<xforms:bind nodeset="instance('results-data')/result" relevant=". != ''"/>


This will mean that a group defined as follows will be displayed provided the result element has some content, and not displayed if there is no result element.

<xforms:group ref="instance('results-data')/result">
        <p>There is a result so display this set of controls ... </p>
</xforms:group>


If however the result has not got any content, I would like to be able to display a different group of controls.


<xforms:group ref="instance('results-data')/result">
        <p>There is no result defined, so display a different set of controls ...</p>
</xforms:group>


I think I have missed something basic in my understanding of how Xforms works as I just can't see an obvious way to do this. Please can someone advise me how would this sort of behaviour be achieved using Xforms?

Regards,
Neil
Reply | Threaded
Open this post in threaded view
|

Re: Mutually exclusive Xforms output

Alexander Žaťko
Neil,

conditional hiding/display of groups was discussed here before - check  
the archives for more info but basic idea is to use XPath in the @ref  
of the xforms:group (or other "grouping" tags) tag.

A.

On 8.1.2009, at 23:24, ncrofts wrote:

>
> I'm trying to display a different set of controls on an XForms  
> application
> depending on whether or not a particular instance element has been  
> defined
> i.e. at any time I only want one of two mutually exclusive groups of
> controls displayed.
>
> If say I have an XForms instance as follows:
>
> <xforms:instance id="results-data">
> <results>
> <result/>
> </results>
> </xforms:instance>
>
> I can then  bind to the result element with something like the  
> following:
>
> <xforms:bind nodeset="instance('results-data')/result" relevant=". !
> = ''"/>
>
>
> This will mean that a group defined as follows will be displayed  
> provided
> the result element has some content, and not displayed if there is  
> no result
> element.
>
> <xforms:group ref="instance('results-data')/result">
> <p>There is a result so display this set of controls ... </p>
> </xforms:group>
>
>
> If however the result has not got any content, I would like to be  
> able to
> display a different group of controls.
>
> <!-- How can I display a different set of controls  when result is not
> defined? -->
> <xforms:group ref="instance('results-data')/result">
> <p>There is no result defined, so display a different set of controls
> ...</p>
> </xforms:group>
>
>
> I think I have missed something basic in my understanding of how  
> Xforms
> works as I just can't see an obvious way to do this. Please can  
> someone
> advise me how would this sort of behaviour be achieved using Xforms?
>
> Regards,
> Neil
> --
> View this message in context: http://www.nabble.com/Mutually-exclusive-Xforms-output-tp21362279p21362279.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: Mutually exclusive Xforms output

ncrofts
Thanks, I just found a relevant posting from 30 December 2008. Sorry I missed this in my original searches.

Regards,
Neil

Alexander Žaťko wrote
Neil,

conditional hiding/display of groups was discussed here before - check  
the archives for more info but basic idea is to use XPath in the @ref  
of the xforms:group (or other "grouping" tags) tag.

A.

On 8.1.2009, at 23:24, ncrofts wrote:

>
> I'm trying to display a different set of controls on an XForms  
> application
> depending on whether or not a particular instance element has been  
> defined
> i.e. at any time I only want one of two mutually exclusive groups of
> controls displayed.
>
> If say I have an XForms instance as follows:
>
> <xforms:instance id="results-data">
> <results>
> <result/>
> </results>
> </xforms:instance>
>
> I can then  bind to the result element with something like the  
> following:
>
> <xforms:bind nodeset="instance('results-data')/result" relevant=". !
> = ''"/>
>
>
> This will mean that a group defined as follows will be displayed  
> provided
> the result element has some content, and not displayed if there is  
> no result
> element.
>
> <xforms:group ref="instance('results-data')/result">
> <p>There is a result so display this set of controls ... </p>
> </xforms:group>
>
>
> If however the result has not got any content, I would like to be  
> able to
> display a different group of controls.
>
>
> <xforms:group ref="instance('results-data')/result">
> <p>There is no result defined, so display a different set of controls
> ...</p>
> </xforms:group>
>
>
> I think I have missed something basic in my understanding of how  
> Xforms
> works as I just can't see an obvious way to do this. Please can  
> someone
> advise me how would this sort of behaviour be achieved using Xforms?
>
> Regards,
> Neil
> --
> View this message in context: http://www.nabble.com/Mutually-exclusive-Xforms-output-tp21362279p21362279.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