itemset strange behavior in Mozilla XForms 0.8.0.3

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

itemset strange behavior in Mozilla XForms 0.8.0.3

Chris Gamache
I'm trying to change the available options in a select1 using instance
data.

I've been testing in Firefox 2.0.0.6 and Mozilla XForms 0.8.0.3. When
I run this XForms example, it displays two blank select1 inputs:

<h:html
 xmlns:h="http://www.w3.org/1999/xhtml"
 xmlns:xforms="http://www.w3.org/2002/xforms"
 xmlns:ev="http://www.w3.org/2001/xml-events"
>
        <h:head>
        <h:title>Itemset Switching</h:title>
        <xforms:model>
                <xforms:instance>
                        <itemSelected />
                </xforms:instance>
                <xforms:instance id="meta">
                        <meta>
                                <groupSelected>All</groupSelected>
                                <listGroup group="All">
                                        <listItem value="1">One</listItem>
                                        <listItem value="2">Two</listItem>
                                        <listItem value="3">Three</listItem>
                                        <listItem value="4">Four</listItem>
                                        <listItem value="5">Five</listItem>
                                        <listItem value="6">Six</listItem>
                                </listGroup>
                                <listGroup group="Odds">
                                        <listItem value="1">One</listItem>
                                        <listItem value="3">Three</listItem>
                                        <listItem value="5">Five</listItem>
                                </listGroup>
                                <listGroup group="Evens">
                                        <listItem value="2">Two</listItem>
                                        <listItem value="4">Four</listItem>
                                        <listItem value="6">Six</listItem>
                                </listGroup>
                        </meta>
                </xforms:instance>
        </xforms:model>
        </h:head>
        <h:body>

                <xforms:select1 ref="instance('meta')/groupSelected">
                        <xforms:itemset ref="instance('meta')/listGroup">
                                        <xforms:label ref="@group" />
                                        <xforms:value ref="@group" />
                        </xforms:itemset>
                </xforms:select1>

                <xforms:select1 ref="/itemSelected">
                        <xforms:itemset ref="instance('meta')/listGroup[@group =
instance('meta')/groupSelected]/listItem">
                                        <xforms:label ref="." />
                                        <xforms:value ref="@value" />
                        </xforms:itemset>
                </xforms:select1>

        </h:body>

</h:html>

In XSmiles it may not render perfectly, but it performs as expected.

So again, I call upon the expertise in the forum to let me know if
I've done something silly (alas, at this stage in my learning it
wouldn't be unexpected) or if there's something in the addon that
needs a little tweaking.

CG

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: itemset strange behavior in Mozilla XForms 0.8.0.3

Aaron Reed
Hi CG,

You have a couple of errors on your page.

1) You need to have xmlns="" in your instance
2) You need to use @nodeset on xf:itemset, not @ref

Any time that I run into a problem where you can't understand why
something simple doesn't work, the first thing I do is run it through a
validator.  Sidewinder contains one, or you can use this one:
http://xformsinstitute.com/validator/  Though I must admit in this case
the xformsinstitute.com validator wasn't that helpful.

Have a good weekend,
--Aaron

CG wrote:

> I'm trying to change the available options in a select1 using instance
> data.
>
> I've been testing in Firefox 2.0.0.6 and Mozilla XForms 0.8.0.3. When
> I run this XForms example, it displays two blank select1 inputs:
>
> <h:html
>  xmlns:h="http://www.w3.org/1999/xhtml"
>  xmlns:xforms="http://www.w3.org/2002/xforms"
>  xmlns:ev="http://www.w3.org/2001/xml-events"
> <h:head>
> <h:title>Itemset Switching</h:title>
> <xforms:model>
> <xforms:instance>
> <itemSelected />
> </xforms:instance>
> <xforms:instance id="meta">
> <meta>
> <groupSelected>All</groupSelected>
> <listGroup group="All">
> <listItem value="1">One</listItem>
> <listItem value="2">Two</listItem>
> <listItem value="3">Three</listItem>
> <listItem value="4">Four</listItem>
> <listItem value="5">Five</listItem>
> <listItem value="6">Six</listItem>
> </listGroup>
> <listGroup group="Odds">
> <listItem value="1">One</listItem>
> <listItem value="3">Three</listItem>
> <listItem value="5">Five</listItem>
> </listGroup>
> <listGroup group="Evens">
> <listItem value="2">Two</listItem>
> <listItem value="4">Four</listItem>
> <listItem value="6">Six</listItem>
> </listGroup>
> </meta>
> </xforms:instance>
> </xforms:model>
> </h:head>
> <h:body>
>
> <xforms:select1 ref="instance('meta')/groupSelected">
> <xforms:itemset ref="instance('meta')/listGroup">
> <xforms:label ref="@group" />
> <xforms:value ref="@group" />
> </xforms:itemset>
> </xforms:select1>
>
> <xforms:select1 ref="/itemSelected">
> <xforms:itemset ref="instance('meta')/listGroup[@group =
> instance('meta')/groupSelected]/listItem">
> <xforms:label ref="." />
> <xforms:value ref="@value" />
> </xforms:itemset>
> </xforms:select1>
>
> </h:body>
>
> </h:html>
>
> In XSmiles it may not render perfectly, but it performs as expected.
>
> So again, I call upon the expertise in the forum to let me know if
> I've done something silly (alas, at this stage in my learning it
> wouldn't be unexpected) or if there's something in the addon that
> needs a little tweaking.
>
> CG
>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: itemset strange behavior in Mozilla XForms 0.8.0.3

Chris Gamache

> You have a couple of errors on your page.
>
> 1) You need to have xmlns="" in your instance
> 2) You need to use @nodeset on xf:itemset, not @ref

Brilliant! I should be more careful in the future. I should know
better.

> Any time that I run into a problem where you can't understand why
> something simple doesn't work, the first thing I do is run it through a
> validator.  Sidewinder contains one, or you can use this one:http://xformsinstitute.com/validator/ Though I must admit in this case
> the xformsinstitute.com validator wasn't that helpful.

Another brilliant suggestion!

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms