Package org.itsnat.impl.core.clientdoc

Examples of org.itsnat.impl.core.clientdoc.ClientDocumentStfulImpl


        getResponseLoadDoc().sendMarkupToClient(docMarkup);
    }

    public void dispatchRequestListeners()
    {
        ClientDocumentStfulImpl clientDoc = getClientDocumentStful();
        Browser browser = clientDoc.getBrowser();
        if (clientDoc.canReceiveALLNormalEvents() &&
            browser.isCachedBackForwardExecutedScripts())
        {
            // Opera 9 y BlackBerryOld tienen este problema
            // Opera 9 soporta DOMContentLoaded
            // el cual se env�a *antes* del evento load, es importante porque Opera
            // no recarga la p�gina en un back/forward y la emisi�n de este evento
            // puede provocar la recarga de la p�gina, as� evitamos un fallo con load que es un evento
            // m�s normal que pueda usar el usuario.
            // Acerca de DOMContentLoad: http://developer.mozilla.org/en/docs/Gecko-Specific_DOM_Events
            // Alternativas: http://dean.edwards.name/weblog/2005/02/order-of-events/

            ItsNatStfulDocumentImpl itsNatDoc = getItsNatStfulDocument();
            Document doc = itsNatDoc.getDocument();

            OnLoadBackForwardListenerImpl listener = new OnLoadBackForwardListenerImpl();
            ParamTransport[] extraParam = OnLoadBackForwardListenerImpl.createExtraParams();
            String eventType;
            EventTarget target;
            if (browser.isClientWindowEventTarget())
            {
                if (browser.isDOMContentLoadedSupported())
                    eventType = "DOMContentLoaded";
                else
                    eventType = "load";
                target = (EventTarget)((DocumentView)doc).getDefaultView();
            }
            else
            {
                eventType = "SVGLoad";
                target = (EventTarget)doc.getDocumentElement();
            }

            clientDoc.addEventListener(target,eventType,listener,false,clientDoc.getCommMode(),extraParam,null,-1,null);
        }

        getResponseLoadDoc().dispatchRequestListeners();

    }
View Full Code Here


        // del textarea, NO el atributo "value". Al cargar la p�gina en control remoto
        // el atributo value tiene el valor del actual estado del control sin embargo en tiempo de carga
        // dicho atributo es ignorado en favor del nodo de texto hijo. Por lo tanto
        // necesitamos definir expl�citamente la propiedad "value".

        final ClientDocumentStfulImpl clientDoc = getClientDocumentStful();
        if (!clientDoc.isScriptingEnabled())
            return;

        // Revertir cambios hechos a trav�s de JavaScript y que el navegador ha podido memorizar para el autofill, por ejemplo la etiqueta de un bot�n que cambia
        boolean revertJSChanges = delegByBrowser.getRevertJSChanges();

        String code = rewriteClientUIControlProperties(revertJSChanges);
        clientDoc.addCodeToSend(code);
    }
View Full Code Here

        // http://starkravingfinkle.org/blog/wp-content/uploads/2007/07/foreignobject-text.svg
        // Y por supuesto XUL tambi�n admite XHTML embebido

        // Devolvemos true si es un elemento XHTML

        ClientDocumentStfulImpl clientDoc = getClientDocumentStful();

        if (!(elem instanceof HTMLElement))
            return false; // No es un elemento XHTML, puede haber tambi�n elementos SVG etc

        if (elem instanceof HTMLSelectElement)
        {
            HTMLSelectElement select = (HTMLSelectElement)elem;
            code.append( "var elem = " + clientDoc.getNodeReference(elem,true,true) + ";\n" );

            // El uso de HTMLSelectElement.getOptions() es terriblemente ineficiente
            // Toleramos la presencia de <optgroup>
            // Los <option> dentro de un <optgroup> se manifiestan en la colecci�n JavaScript "options"
            LinkedList<Node> options = DOMUtilInternal.getChildElementListWithTagNameNS(select,NamespaceUtil.XHTML_NAMESPACE,"option",true);
View Full Code Here

        {
            setScriptContent(scriptElem,code.toString());
        }
        else
        {
            ClientDocumentStfulImpl clientDoc = getClientDocumentStful();

            clientDoc.setScriptLoadCode(code.toString());

            StringBuilder url = new StringBuilder();
            url.append(getServletPath());
            url.append("?itsnat_action=load_script&itsnat_file=initial");
            url.append("&itsnat_client_id=" + clientDoc.getId());
            setScriptURLAttribute(scriptElem,url.toString());
        }

        return scriptElem;
    }
View Full Code Here

        return code.toString();
    }

    protected String getInitJSDocumentCode(final int prevScriptsToRemove)
    {
        ClientDocumentStfulImpl clientDoc = getClientDocumentStful();
        ItsNatStfulDocumentImpl itsNatDoc = getItsNatStfulDocument();

        Browser browser = clientDoc.getBrowser();
        int browserType = browser.getTypeCode();
        int browserSubType = browser.getSubTypeCode();
        ItsNatSessionImpl itsNatSession = clientDoc.getItsNatSessionImpl();
        String token = itsNatSession.getToken();
        String sessionId = itsNatSession.getId();
        String clientId = clientDoc.getId();
        String servletPath = delegByBrowser.getServletPathForEvents();

        int errorMode = itsNatDoc.getClientErrorMode();
        StringBuilder code = new StringBuilder();

        String attachType = null;
        if (clientDoc instanceof ClientDocumentAttachedClientImpl)
        {
            if (clientDoc instanceof ClientDocumentAttachedClientTimerImpl)
                attachType = "attach_timer";
            else if (clientDoc instanceof ClientDocumentAttachedClientCometImpl)
                attachType = "attach_comet";
            else
                attachType = "attach_none";
        }

        boolean usePost = true;
        boolean xhrSyncSup = true;
        if (browser instanceof BrowserWebKit)
        {
            BrowserWebKit webKit = (BrowserWebKit)browser;
            usePost = webKit.isXHRPostSupported();
            xhrSyncSup = webKit.isXHRSyncSupported();
        }

        code.append( "\n");
        code.append( "var win = " + getWindowReference() + ";\n");

        SVGWebInfoImpl svgWeb = clientDoc.getSVGWebInfo();
        boolean svgweb = (svgWeb != null);
        if (svgweb)
        {
            boolean msie = (browser instanceof BrowserMSIEOld);
            int metaPos = -1;
View Full Code Here

        return type;
    }

    public void handleEvent(Event evt)
    {
        ClientDocumentStfulImpl clientDoc = (ClientDocumentStfulImpl)((ItsNatEvent)evt).getClientDocument();
        clientDoc.getCodeToSendRegistry().removeWaitForEventListener(this);
    }
View Full Code Here

    }
   
    @Override
    public void processEvent()   
    {
        ClientDocumentStfulImpl clientDoc = getClientDocumentStful();
        clientDoc.getNodeCacheRegistry().clearCache(); // Elimina los nodos cacheados en la fase de carga, lo que cuenta es la fase del evento pues es la que devuelve el JavaScript que se env�a al cliente
        clientDoc.addCodeToSend("document.getItsNatDoc().clearNodeCache(); try{ \n");         
        try
        {
            super.processEvent();
        }
        finally
        {
            // Pase lo que pase lo dejamos limpito 
            clientDoc.addCodeToSend("\n }finally{ document.getItsNatDoc().clearNodeCache(); }");             
        }     
    }
View Full Code Here

        this.globalEventListener = new EventListenerInternal()
        {
            public void handleEvent(Event evt)
            {
                ClientDocumentStfulImpl clientDoc = (ClientDocumentStfulImpl)((ItsNatEvent)evt).getClientDocument();
                ItsNatCellEditorClientImpl editClient = ItsNatCellEditorClientImpl.getItsNatHTMLCellEditorClient(clientDoc.getBrowser(),ItsNatCellEditorImpl.this.getCellEditorComponent());
                editClient.handleGlobalEvent(evt, ItsNatCellEditorImpl.this);
            }
        };
    }
View Full Code Here

            ItsNatComponent compEditor = getCellEditorComponent();
            ItsNatStfulDocumentImpl itsNatDoc = (ItsNatStfulDocumentImpl)getItsNatDocument();
            ClientDocumentStfulImpl[] clientList = itsNatDoc.getAllClientDocumentStfulsCopy();
            for(int i = 0; i < clientList.length; i++)
            {
                ClientDocumentStfulImpl clientDoc = clientList[i];
                ItsNatCellEditorClientImpl editClient = ItsNatCellEditorClientImpl.getItsNatHTMLCellEditorClient(clientDoc.getBrowser(),compEditor);
                editClient.handleEvent(evt, this, clientDoc);
            }
        }
    }
View Full Code Here

        ItsNatStfulDocumentImpl itsNatDoc = (ItsNatStfulDocumentImpl)getItsNatDocument();
        ClientDocumentStfulImpl[] clientList = itsNatDoc.getAllClientDocumentStfulsCopy();

        for(int i = 0; i < clientList.length; i++)
        {
            ClientDocumentStfulImpl clientDoc = clientList[i];
            ItsNatCellEditorClientImpl editClient = ItsNatCellEditorClientImpl.getItsNatHTMLCellEditorClient(clientDoc.getBrowser(),compEditor);
            editClient.registerEventListeners(this,clientDoc);
        }

        /*
         * �ltimo recurso cuando por alguna raz�n no se env�a el blur
View Full Code Here

TOP

Related Classes of org.itsnat.impl.core.clientdoc.ClientDocumentStfulImpl

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.