0

Data binding bug/enhancement - setSelectedItem

asked 2010-09-29 13:19:27 +0800

eptx gravatar image eptx
130 3

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

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2010-10-04 23:59:22 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

updated 2010-10-05 00:06:45 +0800

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.

link publish delete flag offensive edit

answered 2010-10-05 02:49:20 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

updated 2010-10-05 05:53:21 +0800

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".

link publish delete flag offensive edit

answered 2010-10-05 11:46:17 +0800

eptx gravatar image eptx
130 3

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?

link publish delete flag offensive edit

answered 2010-10-10 20:10:10 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

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.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-09-29 13:19:27 +0800

Seen: 426 times

Last updated: Oct 10 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More