From: Chuck H. <ch...@gl...> - 2010-07-29 21:00:50
|
On Jul 29, 2010, at 10:06 AM, Dev WO wrote: > Actually the "disabled" attribute should be able on either the entire "select" (basically making the entire popup non selectable), on the "optgroup" making only this specific optgroup and related "option" non selectable, and finally on an "option" element making only this element non selectable. > We're also missing a "multiple" attribute on the the "select". > > Regarding what's missing on the "select", the easiest way would be to have direct binding for them like in the default wopopup (disabled, multiple) > I wouldn't try to handle the optgroup's disabled attribute directly, but rather check if every option within an optgroup has the disabled attribute and so put only one for the optgroup. > For the option's disabled attribute, I was thinking about: > instead of having a dictionary <Option, Optgroup>, maybe we could have a dictionary <dictionary<attribute, option>, optgroup>. The enclosed dictionary is even overkill, but it's flexible enough for example if someone wants to provide other attributes like css or whatever. Assuming you pass directly the entire string attribute-value. > > What do you think? That last one would break existing code. Patches welcome! :-) Chuck >> It was not in my plans. :-) How were you thinking to implement this? >> >> Chuck >> >> On Jul 29, 2010, at 2:45 AM, Dev WO wrote: >> >>> Hello Chuck, >>> >>> I'm just wondering if you were planning to add "disabled" key in your ERXOptGroup like: >>> >>> <select name="blabla"> >>> <optgroup label="Manage"> >>> <option selected value="0">Add a feature</option> >>> </optgroup> >>> <optgroup label="Browse"> >>> <option value="1" disabled>List features</option> >>> <option value="2">Search feature</option> >>> </optgroup> >>> </select> >>> >>> :) >>> >>> Xavier >>> >>> >>> >>>> Hi Xavier, >>>> >>>> I am not sure how much sense this will make extracted from the application... >>>> >>>> DictionaryPopup: ERXOptGroupPopupButton { >>>> list = orderedKeys; >>>> group = sortGroup; >>>> item = key; >>>> displayString = displayString; >>>> selection = ^selection; >>>> value = value; >>>> noSelectionString = ^noSelectionString; >>>> escapeHTML = ^escapeHTML; >>>> } >>>> >>>> public NSArray orderedKeys() { >>>> if (orderedKeys == null) { >>>> orderedKeys = ERXDictionaryUtilities.keysSortedByValueAscending(dictionary()); >>>> } >>>> >>>> return orderedKeys; >>>> } >>>> >>>> public String displayString() { >>>> return ((DisplayAdState) dictionary().objectForKey(key)).shortName(); >>>> } >>>> >>>> public Object sortGroup() { >>>> return ((DisplayAdState) dictionary().objectForKey(key)).sortGroup(); >>>> } >>>> >>>> >>>> >>>> The key binding is group. The list is bound to an array of keys that are sorted and are used in a dictionary of objects that have different groups. When the group changes, the component starts a new group. If the "label" binding is present, it is used to separate groups, otherwise a blank option is used. There is not much to it, you just have to return a different value for group when appropriate for the data bound to the list. >>>> >>>> >>>> >>>> /** >>>> * Quick hack at extending WOPopUpButton to use HTML 4 optgroups. It adds two bindings: >>>> * group and label. group is required. When this value changes, a new optgroup is created. >>>> * label is optional. This is used as the label for an option group. If label is not >>>> * bound, an empty string is used as the option group label. >>>> * >>>> * @binding group Object, required - keyPath to value that changes when the group of options changes >>>> * @binding label String, optional - String used as label for an option group >>>> */ >>>> >>>> >>>> Chuck >>>> >>>> On Jan 28, 2010, at 2:48 AM, Xavier Destombes wrote: >>>> >>>>> Hello Chuck, >>>>> >>>>> Just in case you have this at hand, do you have a small sample to showcase the usage? >>>>> >>>>> Thanks, >>>>> >>>>> Xavier >>>>> >>>>> >>>>>> It is there in package com.webobjects.appserver._private.ERXOptGroupPopupButton >>>>>> >>>>>> I made it, I use it still. >>>>>> >>>>>> Chuck >>>>>> >>>>>> >>>>>> >>>>>> On Jan 20, 2010, at 10:50 AM, Xavier Destombes wrote: >>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> I remember something about ERXOptGroupPopupButton in the release of >>>>>>> Wonder 4.0. >>>>>>> But it appears there's nothing in the source nor the documentation. >>>>>>> >>>>>>> Is this something that should be there or the component has been >>>>>>> dropped? >>>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Xavier >>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------------------------------ >>>>>>> Throughout its 18-year history, RSA Conference consistently attracts the >>>>>>> world's best and brightest in the field, creating opportunities for Conference >>>>>>> attendees to learn about information security's most important issues through >>>>>>> interactions with peers, luminaries and emerging and established companies. >>>>>>> http://p.sf.net/sfu/rsaconf-dev2dev >>>>>>> _______________________________________________ >>>>>>> Wonder-disc mailing list >>>>>>> Won...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/wonder-disc >>>>>> >>>>>> -- >>>>>> Chuck Hill Senior Consultant / VP Development >>>>>> >>>>>> Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. >>>>>> http://www.global-village.net/products/practical_webobjects >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>> >>>> -- >>>> Chuck Hill Senior Consultant / VP Development >>>> >>>> Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. >>>> http://www.global-village.net/products/practical_webobjects >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>> >> >> -- >> Chuck Hill Senior Consultant / VP Development >> >> Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. >> http://www.global-village.net/products/practical_webobjects >> >> >> >> >> >> >> > -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects |