0

Selection on listbox with <a> element doesn't work on 5.0.4

asked 2010-09-07 04:20:47 +0800

Newion gravatar image Newion
78 1 1

<listbox id="listBox" model="@{controller.listModel}" selectedItem="@{controller.selected}" 
             multiple="true" checkmark="true" mold="paging" autopaging="true" vflex="1">

				<listitem self="@{each='role'}">
					<listcell/>
					<listcell>
					 	<a label="@{role.name}" forward="onEdit"/>
					</listcell>
					<listcell label="@{role.description}" />
				</listitem>

After clicking on <a> controller.selected is null and row is not selected on the listbox. It worked on 5.0.3!
Is it a bug?

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2010-09-14 01:51:38 +0800

SimonPai gravatar image SimonPai
1696 1

Hi Newion,

Can you provide what's in your controller?

Regards,
Simon

link publish delete flag offensive edit

answered 2010-09-15 02:59:16 +0800

Newion gravatar image Newion
78 1 1

My controller extends GenericForwardComposer.
It contains:

@Override
public void doBeforeComposeChildren(Component comp) throws Exception {
	super.doBeforeComposeChildren(comp);
	// set the composer name in the zul page for access.
	comp.setAttribute("controller", this);
}

/**
 * Selected item from the collection
 */
private T selected; //getter and setter exists

public void onEdit(Event event) {
	setEdited(getSelected());  //getSelected() returns null !!
        ....
}

link publish delete flag offensive edit

answered 2010-10-05 05:49:59 +0800

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

It is not really a bug. We make the spec more clear that: when clicking on input, textarea, button or a, it won't select the item. If this is not the behavior you want, you could specify an attribute called please nonselectableTags to control it.

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

For more information, please visit Feature 3017896.

link publish delete flag offensive edit

answered 2010-10-05 06:24:51 +0800

Bobzk gravatar image Bobzk
444 1 8

Am I correct in assuming "nonselectableTags" is 5.0.5 only?

link publish delete flag offensive edit

answered 2010-10-05 19:55:05 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

Refer http://www.zkoss.org/forum/listComment/13899

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-07 04:20:47 +0800

Seen: 272 times

Last updated: Oct 05 '10

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