selectable model discussion

Charles Goodwin <[email protected]> Fri, 02 Jan 2004 20:15:40 +0000
Newsgroups gmane.comp.java.xwt.widgets
Organization XWT Foundation
Message-ID <[email protected]>
I've been thinking about the selectable model.

First, I'd like the group widget to be more integrated with selectable. 
There should be 3 variables for use with group:

<group id="group" />

$group.select;      // put to when a selection event occurs
                    //   true for selection, false for deselection
$group.selected;    // the most recently (de)selected item
$group.selection;   // the current selection array

We originally decided to go with a max and a min.  However, that did add
annoying little complexities and, when thinking about it, I cannot think
of an instance when a minimum would be needed.

Instead, I say we just go with a 'mustselect' option where at least one
of the selectable group is _always_ selected.

If there is a situation where a minimum selection is desired, then it is
up to the application to not accept anything less than the minimum
selection requirements:

$group.selected += function( v ) {
    $nextbutton.enabled = ( $group.selection > mymin );
}

Any thoughts or objections?

- Charlie

-- 
Charles Goodwin <[email protected]>
Member of the XWT Foundation

The future of the net - www.xwt.org