Render select tag with configurable size attribute

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

Render select tag with configurable size attribute

Jeremy Nix
Is it possible to specify the size of a select1 box so that you can control the number of elements displayed?  For instance, I have I select box with 3 options.  In html I would write as:

<select name="a" size="3">
<option>a</option>
<option>b</option>
<option>c</option>
</select>

When rendered, the browser would make a 3 line box, displaying all options even though it is not a multi-select box.

If this is not possible, anybody know of a way of making it work?
--

Jeremy Nix
Senior Application Developer
Cincinnati Children's Hospital Medical Center


--
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: Render select tag with configurable size attribute

fl.schmitt(ops-users)
Jeremy,

maybe xhtml:size="" works - there's a thread in the ML archives:

http://orbeon-forms-ops-users.24843.n4.nabble.com/Little-question-about-xforms-select1-tp29696p29697.html


HTH
florian


--
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: Re: Render select tag with configurable size attribute

Jeremy Nix
Florian,

I tried that, and it doesn't work.  Any other ideas?  Here was a simple test I created...

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xf="http://www.w3.org/2002/xforms"
    xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <head>
        <xf:model id="modelOI">
            <xf:instance xmlns="" id="instanceData">
                <data xmlns=""><flavors>v</flavors></data>
            </xf:instance>
        </xf:model>
    </head>
    <body>
        <div>
            <xf:select1 ref="flavors" appearance="minimal" xhtml:size="3" size="3">
               <xf:label>Flavors:</xf:label>
               <xf:item>
                  <xf:label>Vanilla</xf:label><xf:value>v</xf:value>
               </xf:item>
               <xf:item>
                  <xf:label>Strawberry</xf:label><xf:value>s</xf:value>
               </xf:item>
               <xf:item>
                  <xf:label>Chocolate</xf:label><xf:value>c</xf:value>
               </xf:item>
            </xf:select1>
        </div>
    </body>
</html>



Jeremy Nix
Senior Application Developer
Cincinnati Children's Hospital Medical Center

On 09/23/2010 03:20 PM, Florian Schmitt wrote:
Jeremy,

maybe xhtml:size="" works - there's a thread in the ML archives:

http://orbeon-forms-ops-users.24843.n4.nabble.com/Little-question-about-xforms-select1-tp29696p29697.html


HTH
florian


--
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: Render select tag with configurable size attribute

Hank Ratzesberger-2
In reply to this post by Jeremy Nix

Does the style attribute get passed along?  If not, then a class attribute should get added and 
you can use it the specify css style, e.g. height: ????

Not sure what to values and dimensions to use, probably em, although that is tied to character width.

--Hank

On Sep 23, 2010, at 11:49 AM, Jeremy Nix wrote:

Is it possible to specify the size of a select1 box so that you can control the number of elements displayed?  For instance, I have I select box with 3 options.  In html I would write as:

<select name="a" size="3">
<option>a</option>
<option>b</option>
<option>c</option>
</select>

When rendered, the browser would make a 3 line box, displaying all options even though it is not a multi-select box.

If this is not possible, anybody know of a way of making it work?
--

Jeremy Nix
Senior Application Developer
Cincinnati Children's Hospital Medical Center

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

Hank Ratzesberger
NEES@UCSB
Earth Research Institute
University of California, Santa Barbara
805-893-8042








--
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: Re: Re: Render select tag with configurable size attribute

fl.schmitt(ops-users)
In reply to this post by Jeremy Nix
Jeremy,

> I tried that, and it doesn't work.  Any other ideas?  Here was a simple
> test I created...

sorry - no idea, i would estimate it as a bug since it worked in 2006.
Both the size and the style attributes get stripped :-( .

florian



--
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: Re: Re: Re: Render select tag with configurable size attribute

Jeremy Nix
Florian/Hank/Anyone else...,

I managed to get the size attribute to work by making a few modifications to the XFormsSelect1Handler.java file.  I'm attaching a diff of my changes (they're against a copy orbeon as of 20100914).  It would be nice if this functionality existed within Orbeon, but if it doesn't make it in there, its pretty easy to add it on your own.


Jeremy Nix
Senior Application Developer
Cincinnati Children's Hospital Medical Center

On 09/24/2010 03:28 AM, Florian Schmitt wrote:
Jeremy,

I tried that, and it doesn't work.  Any other ideas?  Here was a simple
test I created...
sorry - no idea, i would estimate it as a bug since it worked in 2006.
Both the size and the style attributes get stripped :-( .

florian



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

XFormsSelect1Handler.diff (1K) Download Attachment