-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a method with a lot of bussiness logic and the first parameter is a Combobox i need the exact same logic but now with a chosen box i think if combobox and chosenbox would share a interface with setModel method would solve my problem something like
public interface ModelAble
{
public void setModel(ListModel<?> model);
}
Would solve my problem using ModelAble in my model and Combobox and Chosenbox would work very easy but any interface works for both? i need setModel method because is the way i put the data into both Components any workaround.
Oke,
You can solve this problem really easy.
First of all, make your interface.
Second, make a class who extends Combobox and implements your interface.
Of course same for the Chosenbox.
The next is overriding ZK default class behind this components (in lang-addon.xml) :
<component>
<component-name>button</component-name>
<extends>button</extends>
<component-class>my.path.MyCombobox</component-class>
</component>
Nothing in your application changes, just the implementation will be referring to your own class, with the extra interface.
Greetz chill.
Asked: 2016-03-28 20:36:33 +0800
Seen: 25 times
Last updated: Apr 11 '16
wrong valueException come in front of modal popup [closed]
Use parameters in a conditional @command
Problems with multiple press and onCtrlKey
MVVM @save on the fly [closed]
Unable to activate destroyed desktop
org.zkoss.zk.ui.UiException: java.lang.ClassNotFoundException
How to put a image or Letter over image on a specific XY Coordinate