-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a dom like this
<listbox>
<listitem>
<listcell><decimalbox/></listcell>
<listcell><textbox/></listcell>
</listitem>
</listbox>
Of course there is a lot of differents componentes I want a listen which listen all onChange onChanging onSelect onCheck of all elements is this possible i dont want to put it a listen for each one i would like to a single method which listen all?
i have something like this
@Listen("onChange=listbox#results > listitem > listcell;onChanging=listbox#results > listitem > listcell > ?????;"
+"onSelect=listbox#results > listitem > listcell;onCheck=listbox#results > listitem > listcell > ????;"
+"onChanging=listbox#results > listitem > listcell > ?????;")
public void multipleEventListener(final Event event){
businessLogic();
}
But what snippet can i add to ????? tag? is this possible or i am asking to much thanks a lot.
Hello javiut ,
Please use the following code:
Zul
<window id="win" title="Test" width="400px" border="normal"
apply="test">
<grid>
<rows>
<row>
Title:
<textbox id="titleTextbox1" />
<textbox id="titleTextbox2" />
</row>
</rows>
</grid>
</window>
Java
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.InputEvent;
import org.zkoss.zk.ui.select.SelectorComposer;
import org.zkoss.zk.ui.select.annotation.Listen;
import org.zkoss.zk.ui.select.annotation.Wire;
import org.zkoss.zul.Textbox;
import org.zkoss.zul.Window;
public class test extends SelectorComposer<Component> {
private static final long serialVersionUID = 1L;
@Wire
private Window win;
@Wire
private Textbox titleTextbox;
@Listen("onChange = textbox")
public void changeTitle(InputEvent event) {
System.out.println("Listen: " + event.getTarget());
System.out.println("Listen: " + event.getValue());
}
}
Best Regards,
Darksu
Asked: 2016-07-18 13:06:06 +0800
Seen: 16 times
Last updated: Jul 24 '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