0

the ItsNat Author's challenge

asked 2010-09-02 15:08:58 +0800

zanyking gravatar image zanyking
99

the Link is at TSS:
How To Pick the Right Web Framework

I don't think the code bellow is that hard to use more than 100 lines:


<vbox id="vbox">
<zscript><![CDATA[
    String[] arr = {"Click Me!", "Cannot be Clicked"};
]]></zscript>
    <label id="lb1" value="${arr[0]}"/>
    <label id="lb2" value="${arr[1]}"/>
    
<zscript><![CDATA[//@DECLARATION
    org.zkoss.zk.ui.event.EventListener evtListener = new org.zkoss.zk.ui.event.EventListener(){
        public void onEvent(Event evt){
                evt.getTarget().removeEventListener("onClick", evtListener);
                evt.getTarget().setValue(arr[1]);
                if(evt.getTarget().equals(lb1)){
                    lb2.addEventListener("onClick", evtListener);
                    lb2.setValue(arr[0]);
                }else{
                    lb1.addEventListener("onClick", evtListener);
                    lb1.setValue(arr[0]);
                }
                new Label(evt.getTarget().getId()+" clicked").setParent(vbox);
        }};
]]><![CDATA[
    lb1.addEventListener("onClick", evtListener);
]]></zscript>
</vbox>

delete flag offensive retag edit
Be the first one to reply this discussion!
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

RSS

Stats

Asked: 2010-09-02 15:08:58 +0800

Seen: 417 times

Last updated: Sep 02 '10

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