0

Zk WireElements 6.5.3 matching all InputElements

asked 2016-07-18 13:06:06 +0800

javiut gravatar image javiut flag of Venezuela, Bolivarian Republic of
90 1 5

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.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-07-24 08:21:53 +0800

Darksu gravatar image Darksu
1991 1 4

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

link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2016-07-18 13:06:06 +0800

Seen: 16 times

Last updated: Jul 24 '16

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