Possible issue with <select> tag?

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

Possible issue with <select> tag?

Chris Bailey-2
I'm using OPS 3.5M1 and noticed that when using an <xforms:select..> tag without specifying an appearance attribute that it would fail to bind to multiple selected elements correctly (it binds to the first (highest) selected item in the list rather then all selected items).

I did a quick search of the archives and bug lists and didn't find any obvious mention of this issue. The spec mentions this is an optional element and when it is missing OPS seems to assume appearance='compact'. This issue can be recreated when you remove appearance="full" from the first <select> item in the xforms-controls example.

I apologise is this issue is not pertinent (or it's by design) but it did cause me much trouble tracing the problem.

Regards,
Chris.



--
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: Possible issue with <select> tag?

Alessandro  Vernet
Administrator
Hi Chris,

I tried to create an example where an <xforms:select> without
appearance is bound multiple selected item, and the items do all
appear as selected in the list, as expected. But maybe I am not
reproducing exactly the case you are having. Would you be able to
create an example for this that we can run in the sandbox?

Alex

On 10/6/06, [hidden email] <[hidden email]> wrote:

> I'm using OPS 3.5M1 and noticed that when using an <xforms:select..> tag without specifying an appearance attribute that it would fail to bind to multiple selected elements correctly (it binds to the first (highest) selected item in the list rather then all selected items).
>
> I did a quick search of the archives and bug lists and didn't find any obvious mention of this issue. The spec mentions this is an optional element and when it is missing OPS seems to assume appearance='compact'. This issue can be recreated when you remove appearance="full" from the first <select> item in the xforms-controls example.
>
> I apologise is this issue is not pertinent (or it's by design) but it did cause me much trouble tracing the problem.
>
> Regards,
> Chris.
>
>
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Possible issue with <select> tag?

Chris Bailey-2
This is an example taken from xforms-controls

..

<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2005 Orbeon, Inc.

    This program is free software; you can redistribute it and/or modify it under the terms of the
    GNU Lesser General Public License as published by the Free Software Foundation; either version
    2.1 of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU Lesser General Public License for more details.

    The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
-->
<xhtml:html xmlns:xforms="http://www.w3.org/2002/xforms"
    xmlns:f="http://orbeon.org/oxf/xml/formatting"
    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:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">

    <xhtml:head>
        <xhtml:title>XForms Controls</xhtml:title>
        <xhtml:style type="text/css">
            .controls-range { margin-top: 1em; margin-bottom: 2em; }
            .xforms-textarea { font-family: sans-serif; }
        </xhtml:style>
        <xforms:model id="main-model">
            <xforms:instance id="instance">
                <instance>
                    <age>35</age>
                    <secret>42</secret>
                    <textarea>The world is but a canvas for the imagination.</textarea>
                    <label>Hello, World!</label>
                    <date/>
                    <flavor>v s </flavor>
                    <carrier>fedex</carrier>
                    <country-name/>
                    <new-item>
                        <label>Key lime</label>
                        <value>lime</value>
                    </new-item>
                    <range>
                        <value>1</value>
                        <letter>A</letter>
                    </range>
                    <country/>
                </instance>
            </xforms:instance>
            <xforms:instance id="items">
                <items>
                    <flavors>
                        <flavor value="v">
                            <label>Vanilla</label>
                        </flavor>
                        <flavor value="s">
                            <label>Strawberry</label>
                        </flavor>
                        <flavor value="c">
                            <label>Chocolate</label>
                        </flavor>
                    </flavors>
                    <carriers>
                        <carrier value="ups">
                            <label>UPS</label>
                        </carrier>
                        <carrier value="fedex">
                            <label>FedEx</label>
                        </carrier>
                        <carrier value="dhl">
                            <label>DHL</label>
                        </carrier>
                    </carriers>
                </items>
            </xforms:instance>
            <xforms:instance id="formatted">
                <formated-instance>
                    &lt;span>
                    &lt;/span>
                </formated-instance>
            </xforms:instance>
            <xforms:instance id="ui">
                <ui>
                    <show-instance>false</show-instance>
                </ui>
            </xforms:instance>

            <xforms:bind nodeset="instance('formatted')"
                calculate="xxforms:serialize(xxforms:call-xpl
                    ('oxf:/ops/utils/formatting/format.xpl', 'data', instance('instance'), 'data')/*, 'html')"/>
            <xforms:bind nodeset="instance('ui')/show-instance" relevant=". = 'true'"/>

        </xforms:model>
        <xhtml:style type="text/css">
            .input input { width: 20em; }
            .password { width: 20em; }
            .textarea { height: 6em; width: 20em; }
            .widget-tab-panel { padding-top: 1em; }
            .widget-tabs { width: 50em; }
        </xhtml:style>
    </xhtml:head>
    <xhtml:body>
        <widget:tabs ref=".">
            <widget:tab id="selection-controls">
                <widget:label>Selection controls</widget:label>
                <xforms:group>
                    <xforms:label>Multiple Value Selection</xforms:label>
                    <xhtml:p>
                        <xforms:select ref="./flavor" appearance="full" navindex="8">
                            <xforms:label class="fixed-width">Flavor:</xforms:label>
                            <xforms:itemset nodeset="instance('items')/flavors/flavor">
                                <xforms:label ref="label"/>
                                <xforms:value ref="@value"/>
                            </xforms:itemset>
                        </xforms:select>
                    </xhtml:p>
                    <xhtml:p>
                        <xforms:select ref="flavor" navindex="9"<!-- missing appearance tag here -->
                            <xforms:label class="fixed-width"/>
                            <xforms:itemset nodeset="instance('items')/flavors/flavor">
                                <xforms:label ref="label"/>
                                <xforms:value ref="@value"/>
                            </xforms:itemset>
                        </xforms:select>
                    </xhtml:p>
                </xforms:group>
            </widget:tab>
        </widget:tabs>
        <xhtml:p style="margin-top: 2em">
            <xforms:switch>
                <xforms:case id="instance-hidden">
                    <xforms:trigger>
                        <xforms:label>Show instance</xforms:label>
                        <xforms:toggle ev:event="DOMActivate" case="instance-visible"/>
                    </xforms:trigger>
                </xforms:case>
                <xforms:case id="instance-visible">
                    <xforms:trigger>
                        <xforms:label>Hide instance</xforms:label>
                        <xforms:toggle ev:event="DOMActivate" case="instance-hidden"/>
                    </xforms:trigger>
                    <xforms:group>
                        <xforms:label>XForms instance</xforms:label>
                        <xforms:output ref="instance('formatted')" mediatype="text/html"/>
                    </xforms:group>
                </xforms:case>
            </xforms:switch>
        </xhtml:p>
    </xhtml:body>
</xhtml:html>



--
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: Possible issue with <select> tag?

Erik Bruchez
Administrator
Chris,

Thanks, I reproduce this. I entered a bug:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=306268&group_id=168&atid=350207

-Erik

[hidden email] wrote:

> This is an example taken from xforms-controls
>
> ..
>
> <?xml version="1.0" encoding="utf-8"?>
> <!--
>     Copyright (C) 2005 Orbeon, Inc.
>
>     This program is free software; you can redistribute it and/or modify it under the terms of the
>     GNU Lesser General Public License as published by the Free Software Foundation; either version
>     2.1 of the License, or (at your option) any later version.
>
>     This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
>     without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>     See the GNU Lesser General Public License for more details.
>
>     The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
> -->
> <xhtml:html xmlns:xforms="http://www.w3.org/2002/xforms"
>     xmlns:f="http://orbeon.org/oxf/xml/formatting"
>     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:xs="http://www.w3.org/2001/XMLSchema"
>     xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
>
>     <xhtml:head>
>         <xhtml:title>XForms Controls</xhtml:title>
>         <xhtml:style type="text/css">
>             .controls-range { margin-top: 1em; margin-bottom: 2em; }
>             .xforms-textarea { font-family: sans-serif; }
>         </xhtml:style>
>         <xforms:model id="main-model">
>             <xforms:instance id="instance">
>                 <instance>
>                     <age>35</age>
>                     <secret>42</secret>
>                     <textarea>The world is but a canvas for the imagination.</textarea>
>                     <label>Hello, World!</label>
>                     <date/>
>                     <flavor>v s </flavor>
>                     <carrier>fedex</carrier>
>                     <country-name/>
>                     <new-item>
>                         <label>Key lime</label>
>                         <value>lime</value>
>                     </new-item>
>                     <range>
>                         <value>1</value>
>                         <letter>A</letter>
>                     </range>
>                     <country/>
>                 </instance>
>             </xforms:instance>
>             <xforms:instance id="items">
>                 <items>
>                     <flavors>
>                         <flavor value="v">
>                             <label>Vanilla</label>
>                         </flavor>
>                         <flavor value="s">
>                             <label>Strawberry</label>
>                         </flavor>
>                         <flavor value="c">
>                             <label>Chocolate</label>
>                         </flavor>
>                     </flavors>
>                     <carriers>
>                         <carrier value="ups">
>                             <label>UPS</label>
>                         </carrier>
>                         <carrier value="fedex">
>                             <label>FedEx</label>
>                         </carrier>
>                         <carrier value="dhl">
>                             <label>DHL</label>
>                         </carrier>
>                     </carriers>
>                 </items>
>             </xforms:instance>
>             <xforms:instance id="formatted">
>                 <formated-instance>
>                     &lt;span>
>                     &lt;/span>
>                 </formated-instance>
>             </xforms:instance>
>             <xforms:instance id="ui">
>                 <ui>
>                     <show-instance>false</show-instance>
>                 </ui>
>             </xforms:instance>
>
>             <xforms:bind nodeset="instance('formatted')"
>                 calculate="xxforms:serialize(xxforms:call-xpl
>                     ('oxf:/ops/utils/formatting/format.xpl', 'data', instance('instance'), 'data')/*, 'html')"/>
>             <xforms:bind nodeset="instance('ui')/show-instance" relevant=". = 'true'"/>
>
>         </xforms:model>
>         <xhtml:style type="text/css">
>             .input input { width: 20em; }
>             .password { width: 20em; }
>             .textarea { height: 6em; width: 20em; }
>             .widget-tab-panel { padding-top: 1em; }
>             .widget-tabs { width: 50em; }
>         </xhtml:style>
>     </xhtml:head>
>     <xhtml:body>
>         <widget:tabs ref=".">
>             <widget:tab id="selection-controls">
>                 <widget:label>Selection controls</widget:label>
>                 <xforms:group>
>                     <xforms:label>Multiple Value Selection</xforms:label>
>                     <xhtml:p>
>                         <xforms:select ref="./flavor" appearance="full" navindex="8">
>                             <xforms:label class="fixed-width">Flavor:</xforms:label>
>                             <xforms:itemset nodeset="instance('items')/flavors/flavor">
>                                 <xforms:label ref="label"/>
>                                 <xforms:value ref="@value"/>
>                             </xforms:itemset>
>                         </xforms:select>
>                     </xhtml:p>
>                     <xhtml:p>
>                         <xforms:select ref="flavor" navindex="9"<!-- missing appearance tag here -->
>                             <xforms:label class="fixed-width"/>
>                             <xforms:itemset nodeset="instance('items')/flavors/flavor">
>                                 <xforms:label ref="label"/>
>                                 <xforms:value ref="@value"/>
>                             </xforms:itemset>
>                         </xforms:select>
>                     </xhtml:p>
>                 </xforms:group>
>             </widget:tab>
>         </widget:tabs>
>         <xhtml:p style="margin-top: 2em">
>             <xforms:switch>
>                 <xforms:case id="instance-hidden">
>                     <xforms:trigger>
>                         <xforms:label>Show instance</xforms:label>
>                         <xforms:toggle ev:event="DOMActivate" case="instance-visible"/>
>                     </xforms:trigger>
>                 </xforms:case>
>                 <xforms:case id="instance-visible">
>                     <xforms:trigger>
>                         <xforms:label>Hide instance</xforms:label>
>                         <xforms:toggle ev:event="DOMActivate" case="instance-hidden"/>
>                     </xforms:trigger>
>                     <xforms:group>
>                         <xforms:label>XForms instance</xforms:label>
>                         <xforms:output ref="instance('formatted')" mediatype="text/html"/>
>                     </xforms:group>
>                 </xforms:case>
>             </xforms:switch>
>         </xhtml:p>
>     </xhtml:body>
> </xhtml:html>
--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



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