-
FEATURED COMPONENTS
First time here? Check out the FAQ!
After updating from 7.05 to 8.5 the setCheckable(false) method (deprecated) not work anymore. I used the setSelectable method too, but the checkable icon (mode multiple) stays visible and the item can be selected. The current workaround for me is to disable the whole item.
Any suggestion?
First I wasn't aware you were using a List model, now things are clear.
Since ZK 8.0.0 selectability is controlled by the list model using the SelectionControl. The default implementation always returns true. If you have a different condition you can implement the interface or extend the DefaultSelectionControl.
In your case I added the following to the FilterModel class
modelList.setSelectionControl(new DefaultSelectionControl<Row>(modelList) {
public boolean isSelectable(Row row) {
return row.isSelectable();
}
});
And removed the obsolete part from MyRowRenderer -> updated example
This new interface was introduced as a fix for ZK-2534
I tested this zkfiddle example using 8.0.5 and 8.5. In both versions the selectable/checkable attribute works as expected. Can you please update the zkfiddle to reproduce your exact problem with the selectable property?
You can see in the source code that both selectable/checkable have the same implementation so there should be no difference at all: https://github.com/zkoss/zk/blob/master/zul/src/org/zkoss/zul/Listitem.java#L83-L128
If in doubt you can set a breakpoint in those methods to verify who/what is calling them.
Regards,
Robert
Asked: 2017-11-16 18:39:08 +0800
Seen: 22 times
Last updated: Nov 22 '17
I assume you are updating from 7.0.5 to 8.5.0 ? or 8.0.5? just to give the best answer this might help.
cor3000 ( 2017-11-16 20:26:07 +0800 )editChecked my maven pom, upgrade was from ZK 7.05 to 8.5.0
Tedatzs ( 2017-11-16 20:34:46 +0800 )editRobert,
please check the following example with a selectable and not selectable button example what create list items. Check the result with zk 7.05 and 8.05. You can reproduce the difference here.
http://zkfiddle.org/sample/1gikj3n/15-test-selectable-Listbox-with-DataFilter
Tedatzs ( 2017-11-17 17:56:22 +0800 )editAnd the difference did start with ZK 8.0
Tedatzs ( 2017-11-17 18:05:24 +0800 )editAlright, this work. Was not aware that the item renderer is not the right place for the selection control
Tedatzs ( 2017-11-17 20:13:39 +0800 )edit