Package org.itsnat.core.event

Examples of org.itsnat.core.event.ItsNatEventDOMStateless


        itsNatDoc.addEventListener(this);
    }

    public void handleEvent(Event evt)
    {
        ItsNatEventDOMStateless itsNatEvt = (ItsNatEventDOMStateless)evt;
       
        Text counterText = (Text)counterElem.getFirstChild();
        String currCountStr = counterText.getData();
        int counter = Integer.parseInt(currCountStr);
        counter++;
        counterText.setData(String.valueOf(counter));       
       
        Document doc = itsNatDoc.getDocument();       

        Element elemParent = doc.getElementById("insertHereId");
        ScriptUtil scriptGen = itsNatDoc.getScriptUtil();
        String elemRef = scriptGen.getNodeReference(elemParent);
        ClientDocument clientDoc = itsNatEvt.getClientDocument();
        clientDoc.addCodeToSend(elemRef + ".innerHTML = '';");       
        clientDoc.addCodeToSend("alert('Currently inserted fragment removed before');");       
               
        ItsNatServlet servlet = itsNatDoc.getItsNatDocumentTemplate().getItsNatServlet()
        ItsNatHTMLDocFragmentTemplate docFragTemplate = (ItsNatHTMLDocFragmentTemplate)servlet.getItsNatDocFragmentTemplate("manual.stless.example.fragment")
View Full Code Here


        googleAnalyticsElem.setAttribute("src",googleAnalyticsIFrameURL + stateName);
    }

    public void handleEvent(Event evt)
    {
        ItsNatEventDOMStateless itsNatEvt = (ItsNatEventDOMStateless)evt;
       
        String stateName = (String)itsNatEvt.getExtraParam("state_name");
        String stateSecondaryName = (String)itsNatEvt.getExtraParam("state_secondary_name");
       
        changeState(stateName,stateSecondaryName);
    }
View Full Code Here

        itsNatDoc.addEventListener(this);
    }

    public void handleEvent(Event evt)
    {
        ItsNatEventDOMStateless itsNatEvt = (ItsNatEventDOMStateless)evt;
       
        Text counterText = (Text)counterElem.getFirstChild();
        String currCountStr = counterText.getData();
        int counter = Integer.parseInt(currCountStr);
        counter++;
        counterText.setData(String.valueOf(counter));       
       
        Document doc = itsNatDoc.getDocument();       
       
        Element elemParent = doc.getElementById("insertHereId");
        ScriptUtil scriptGen = itsNatDoc.getScriptUtil();
        String elemRef = scriptGen.getNodeReference(elemParent);
        ClientDocument clientDoc = itsNatEvt.getClientDocument();
        clientDoc.addCodeToSend(elemRef + ".innerHTML = '';");       
        clientDoc.addCodeToSend("alert('Currently inserted fragment removed before');");       
               
        ItsNatServlet servlet = itsNatDoc.getItsNatDocumentTemplate().getItsNatServlet()
        ItsNatHTMLDocFragmentTemplate docFragTemplate = (ItsNatHTMLDocFragmentTemplate)servlet.getItsNatDocFragmentTemplate("manual.stless.example.fragment")
View Full Code Here

        }
    } 
 
    public void handleEvent(Event evt
    { 
        ItsNatEventDOMStateless itsNatEvt = (ItsNatEventDOMStateless)evt;
        String action = (String)itsNatEvt.getExtraParam("action");
       
        try
        {
            if ("remove".equals(action))
            {
                DefaultListModel dataModel = (DefaultListModel)listComp.getListModel();            
                ListSelectionModel selModel = listComp.getListSelectionModel();

                if (!selModel.isSelectionEmpty()) 
                { 
                    // Selection Model is in SINGLE_INTERVAL_SELECTION mode 
                    int min = selModel.getMinSelectionIndex()
                    int max = selModel.getMaxSelectionIndex()
                    dataModel.removeRange(min,max)
                }             
                else
                {
                    itsNatDoc.addCodeToSend("alert('None selected');");
                }
            }
            else if ("select".equals(action))       
            {
                ListSelectionModel selModel = listComp.getListSelectionModel();

                boolean selected = Boolean.valueOf((String)itsNatEvt.getExtraParam("selected"));           
                int index = Integer.parseInt((String)itsNatEvt.getExtraParam("index"));
                if (!selected) selModel.addSelectionInterval(index, index);
                else selModel.removeSelectionInterval(index, index);
            }
            else if ("update".equals(action))       
            {
                String name = (String)itsNatEvt.getExtraParam("name");             
                int index = Integer.parseInt((String)itsNatEvt.getExtraParam("index"));

                DefaultListModel dataModel = (DefaultListModel)listComp.getListModel();            
                City city = (City)dataModel.getElementAt(index);
                city.setName(name);
                dataModel.setElementAt(city,index);             
            }      
            else if ("insert".equals(action))       
            {
                String name = (String)itsNatEvt.getExtraParam("name");             
                int index = Integer.parseInt((String)itsNatEvt.getExtraParam("index"));

                DefaultListModel dataModel = (DefaultListModel)listComp.getListModel();            
                City city = new City(db.generateId(),name);
                dataModel.insertElementAt(city,index);              
            }               
View Full Code Here

        itsNatDoc.addEventListener(this);
    }

    public void handleEvent(Event evt)
    {
        ItsNatEventDOMStateless itsNatEvt = (ItsNatEventDOMStateless)evt;
       
        ItsNatDocument itsNatDoc = itsNatEvt.getItsNatDocument();
        Document doc = itsNatDoc.getDocument();
        Element elemParent = doc.getElementById("testElemId");
        ScriptUtil scriptGen = itsNatDoc.getScriptUtil();
        String elemRef = scriptGen.getNodeReference(elemParent);
        ClientDocument clientDoc = itsNatEvt.getClientDocument();
        clientDoc.addCodeToSend(elemRef + ".innerHTML = '';");       
        clientDoc.addCodeToSend("alert('Removed current children');");       
               
        ItsNatServlet servlet = itsNatDoc.getItsNatDocumentTemplate().getItsNatServlet()
        ItsNatHTMLDocFragmentTemplate docFragTemplate = (ItsNatHTMLDocFragmentTemplate)servlet.getItsNatDocFragmentTemplate("test_html_fragment_fragment")
View Full Code Here

        this.parent = parent;
    }

    public void handleEvent(Event evt)
    {
        ItsNatEventDOMStateless itsNatEvt = (ItsNatEventDOMStateless)evt;       
        ClientDocument clientDoc = itsNatEvt.getClientDocument();
        clientDoc.addCodeToSend("alert('OK Template Level Listener');");        
    }
View Full Code Here

TOP

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

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.