alternative to range control

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

alternative to range control

FParsons
Hi! I'd like to have a dropdown whose items are a sequence  of integers (i.e. "1 through 10").  You could use a range control for this, but IMHO it's a space hogging and rather ugly control that's somewhat distracting. (I wish there was a range control that had the "up down" buttons like you see in some UI libraries - either on either side of a value display, or both next to the value display).

Without having a dropdown using an item set that explicitly lists every number, is there a dynamic way of creating the itemset for a sequence of numbers? (just plain integers).

There is an xforms-sandbox sample that shows incrementing a value using <xforms:setvalue>, so I tested using two triggers as "increase" / "decrease" buttons with an output field - but was unsure how to render the appropriate trigger invisible when you reach the end of the range you want the numbers to be in. Does anyone have an example of this? However, I found that the "increase"/"decrease" buttons seemed rather slow, so I don't know if it would be a good solution even if I was able to restrict it to a range.

It sounds like a different appearance for the range control would be a good thing, but I don't think I'm up to creating such a component.

Any ideas would be appreciated!
-- Francis
Reply | Threaded
Open this post in threaded view
|

Re: alternative to range control

FParsons
(bump)
-- Francis
Reply | Threaded
Open this post in threaded view
|

Re: alternative to range control

Erik Bruchez
Administrator
In reply to this post by FParsons
What about something like this:

http://gist.github.com/438616

This won't be realistic if you have more than a few dozens of items max though.

-Erik

On Sat, Jun 5, 2010 at 2:43 PM, FParsons <[hidden email]> wrote:

>
> Hi! I'd like to have a dropdown whose items are a sequence  of integers (i.e.
> "1 through 10").  You could use a range control for this, but IMHO it's a
> space hogging and rather ugly control that's somewhat distracting. (I wish
> there was a range control that had the "up down" buttons like you see in
> some UI libraries - either on either side of a value display, or both next
> to the value display).
>
> Without having a dropdown using an item set that explicitly lists every
> number, is there a dynamic way of creating the itemset for a sequence of
> numbers? (just plain integers).
>
> There is an xforms-sandbox sample that shows incrementing a value using
> <xforms:setvalue>, so I tested using two triggers as "increase" / "decrease"
> buttons with an output field - but was unsure how to render the appropriate
> trigger invisible when you reach the end of the range you want the numbers
> to be in. Does anyone have an example of this? However, I found that the
> "increase"/"decrease" buttons seemed rather slow, so I don't know if it
> would be a good solution even if I was able to restrict it to a range.
>
> It sounds like a different appearance for the range control would be a good
> thing, but I don't think I'm up to creating such a component.
>
> Any ideas would be appreciated!
>
> -----
> -- Francis
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/alternative-to-range-control-tp2244584p2244584.html
> Sent from the Orbeon Forms (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: alternative to range control

FParsons
Erik - thanks very much for the suggestion, I'll give it a try.

I didn't know about this syntax:

  <xf:itemset ref="(1 to ../max)">

I previously tried using an instance with "min", "max", "value", then using an output with "inc" and "dec" buttons, but I found it slow and had trouble getting it limited to a range.
-- Francis
Reply | Threaded
Open this post in threaded view
|

Re: Re: alternative to range control

Erik Bruchez
Administrator
Francis,

There are two interesting bits in that line (the parens were not necessary):

  <xf:itemset ref="1 to ../max">

First, we use @ref instead of @nodeset. The XForms Working Group
recently proposed to deprecate @nodeset (for several reason) and now
recommends experimenting with using @ref instead. But you could use
@nodeset as well and it wouldn't make a difference.

Second is the XPath expression. This is an XPath 2.0 expression
expressing a range of number values from 1 to whatever the value of
../max is.

Supporting atomic values (as in the number "1") in xf:itemset is an
Orbeon Forms extension. It makes sense for XPath 2.0-aware
implementations to support this though, and we hope that along with
XPath 2.0 support in XForms 1.2, this will be standardized as well.

It added the above as comment in the gist:

  http://gist.github.com/438616#comments

-Erik

On Tue, Jun 15, 2010 at 5:01 AM, FParsons <[hidden email]> wrote:

>
> Erik - thanks very much for the suggestion, I'll give it a try.
>
> I didn't know about this syntax:
>
>  <xf:itemset ref="(1 to ../max)">
>
> I previously tried using an instance with "min", "max", "value", then using
> an output with "inc" and "dec" buttons, but I found it slow and had trouble
> getting it limited to a range.
>
> -----
> -- Francis
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/alternative-to-range-control-tp2244584p2255776.html
> Sent from the Orbeon Forms (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