Package org.itsnat.core.event

Examples of org.itsnat.core.event.ItsNatEventListenerChain


        EventListener global = new EventListenerSerial()
        {
            public void handleEvent(Event evt)
            {
                ItsNatEvent itsNatEvt = (ItsNatEvent)evt;
                ItsNatEventListenerChain chain = itsNatEvt.getItsNatEventListenerChain();
                try
                {
                    chain.continueChain();
                }
                catch(Exception ex)
                {
                    ex.printStackTrace();

                    itsNatDoc.addCodeToSend("var res = confirm('Unexpected Error! Reload?');");
                    itsNatDoc.addCodeToSend("if (res) window.location.reload(true);");
                   
                    itsNatDoc.setInvalid();
                    chain.stop();
                }
           }
        };
        itsNatDoc.addEventListener(global); // Comment this sentence to show errors in technical form
View Full Code Here


                ItsNatDOMStdEvent itsNatEvt = ((ItsNatDOMStdEvent)evt);
                String num = (String)itsNatEvt.getExtraParam("num");
                if (num == null) return; // Any other
                log("Enter in global listener");
                ItsNatEventListenerChain chain = itsNatEvt.getItsNatEventListenerChain();
                try
                {
                    if (num.equals("1")||num.equals("2"))
                        chain.continueChain();
                    else
                        chain.stop(); // Avoids third listener
                }
                catch(Exception ex)
                {
                    log("Catched exception thrown by first listener");
                }
View Full Code Here

        final ItsNatDocument itsNatDoc = null;
        EventListener global = new EventListener()
        {
            public void handleEvent(Event evt)
            {
                ItsNatEventListenerChain chain = ((ItsNatEvent)evt).getItsNatEventListenerChain();
                try
                {
                    chain.continueChain();
                }
                catch(Exception ex)
                {
                    itsNatDoc.addCodeToSend("alert('Unexpected Error! The page will reload.');");
                    itsNatDoc.addCodeToSend("window.location.reload(true);");

                    itsNatDoc.setInvalid();
                    chain.stop();
                }
           }
        };
        itsNatDoc.addEventListener(global);
    }
View Full Code Here

        EventListener global = new EventListenerSerial()
        {
            public void handleEvent(Event evt)
            {
                ItsNatEvent itsNatEvt = ((ItsNatEvent)evt);
                ItsNatEventListenerChain chain = itsNatEvt.getItsNatEventListenerChain();
                try
                {
                    chain.continueChain();
                }
                catch(Exception ex)
                {
                    if (!ex.getMessage().equals("Must be catched"))
                        throw new RuntimeException("FAILED TEST");
View Full Code Here

        EventListener list1 = new EventListenerSerial()
        {
            public void handleEvent(final Event evt)
            {
                ItsNatEventListenerChain chain = ((ItsNatEvent)evt).getItsNatEventListenerChain();
                try
                {
                    chain.continueChain();
                }
                catch(Exception ex)
                {
                    if (!ex.getMessage().equals("Must be catched"))
                        throw new RuntimeException("FAILED TEST");

                    TestEventListenerChainInComp.this.outText(" OK Chain 1-2");
                    chain.continueChain();
                }
            }
        };
        button.addEventListener("click",list1);
View Full Code Here

TOP

Related Classes of org.itsnat.core.event.ItsNatEventListenerChain

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.