Re: Limiting the selections in an xforms:select

Posted by Alessandro Vernet on
URL: https://discuss.orbeon.com/Limiting-the-selections-in-an-xforms-select-tp32885p32886.html

Hi Chris,

On 2/21/07, Chris Bailey <[hidden email]> wrote:
> I was wondering if there any way of restricting the number of selections
> that can be made with an xforms:select?

Like Ryan said, you can have an <xforms:bind constraint="..."> that
checks if less than x values are selected. This won't prevent users
from selecting more values, but if they do the control will become
invalid.

You can also have your own event handler for xforms-value-changed, and
set the value of the node to the first x values. This way when the
user selects too many values, the last value will be automatically
removed.

You can also imagine a UI with 2 lists, when the user moves items from
the first to the second by pointing to an item in the first list and
clicking on a button. When x values are selected, then you disable the
button with a bind readonly.

Alex
--
Orbeon Forms - Web 2.0 Forms for the Enterprise
http://www.orbeon.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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws