-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Looks like data binding for setSelectedItem() does not work with grids or inplace editing. Can ZK team please confirm this and plans to fix. Thanks!
See inplace issue at: http://sourceforge.net/tracker/?func=detail&atid=785194&aid=3017896&group_id=152762
It is a spec. It is about how we handle clicks on child widgets of a listitem (nothing to do with data binding). To sum up, we don't consider it is a selection when the user clicks on an input, a button or a textarea. We cannot change it, since it might break some applications depending on it.
Currently, if you override this, you have to override JavaScript's zul.sel.SelectWidget.prototype._shallIgnore. I'll think if there is a simpler way for developers to control it -- after all, it is a bit counter-intuitive for inplace editing.
I implemented a feature called nonselectableTags to resolve this issue. Please refer to Feature 3017896 for details.
It will be available in the next freshly and 5.0.5.
For example, you want to select the item no matter what DOM element is clicked, then specify an empty
string as follows:
<listbox nonselectableTags="" multiple="true"> <listitem><listcell><textbox/></listcell></listitem> <listitem><listcell><button label="button"/></listcell></listitem> <listitem><listcell><h:input xmlns:h="native"/></listcell></listitem> </listbox>
Another example is that, if you want to prevent the selection only for button, specify nonselectableTags="button".
Thanks for responding to this query with an innovative enhancement! Curious why not reference "tag ids" in nonselectableTags rather than "types" for more fine grained control?
Also, what about selectedItem in grids?
Hi Erik, it sounds a good idea (like jQuery's selection button#id). We would consider it in next major release.
Listbox is a selectable grid, while grid is non-selectable listbox. We don't have plan to change it.
Asked: 2010-09-29 13:19:27 +0800
Seen: 426 times
Last updated: Oct 10 '10