-
FEATURED COMPONENTS
First time here? Check out the FAQ!
<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?
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 !! .... }
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.
Asked: 2010-09-07 04:20:47 +0800
Seen: 272 times
Last updated: Oct 05 '10