Package org.apache.beehive.netui.tags.javascript

Examples of org.apache.beehive.netui.tags.javascript.ScriptRequestState


        // @TODO: Is there any way to make this work.  Currently if
        // there is now script container, we will eat the <script> blocks
        // because we cannot write them out in the middle of the tag being
        // written
        IScriptReporter scriptReporter = getScriptReporter();
        ScriptRequestState srs = ScriptRequestState.getScriptRequestState((HttpServletRequest) pageContext.getRequest());
        if (TagConfig.isLegacyJavaScript()) {
            srs.mapLegacyTagId(scriptReporter, _name, realName);
        }
        write(realName);
        localRelease();
        return SKIP_BODY;
    }
View Full Code Here


        if ((_focus != null) && (_focusMap != null)) {
            String focusName = (String) _focusMap.get(_focus);

            if (focusName != null) {
                String formName = _realName;
                ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
                srs.writeFeature(getScriptReporter(), writer, CoreScriptFeature.SET_FOCUS, false, true,
                        new Object[]{formName, focusName});
            }
        }

        if (_formSubmit) {
            ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
            srs.writeFeature(getScriptReporter(), writer, CoreScriptFeature.ANCHOR_SUBMIT, true, false, null);
        }

        // output any generated javascript
        if (idScript != null)
            write(idScript);
View Full Code Here

        // Legacy Java Script support -- This writes out a single table with both the id and names
        // mixed.  This is legacy support to match the pre beehive behavior.
        String idScript = null;
        IScriptReporter scriptReporter = getScriptReporter();
        ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
        if (TagConfig.isLegacyJavaScript()) {
            idScript = srs.mapLegacyTagId(scriptReporter, id, _state.id);
        }

        // map the tagId to the real id
        if (TagConfig.isDefaultJavaScript()) {
            String script = srs.mapTagId(scriptReporter, id, _state.id, _state.name);

            // if we wrote out script in legacy mode, we need to make sure we preserve it.
            if (idScript != null) {
                idScript = idScript + script;
            }
View Full Code Here

    public int doStartTag() throws JspException
    {
        if (_rolloverImage != null && getJavaScriptAttribute(ONMOUSEOVER) == null) {
            // cause the roll over script to be inserted
            WriteRenderAppender writer = new WriteRenderAppender(pageContext);
            ScriptRequestState srs = ScriptRequestState.getScriptRequestState((HttpServletRequest) pageContext.getRequest());
            srs.writeFeature(getScriptReporter(), writer, CoreScriptFeature.ROLLOVER, true, false, null);
        }

        return EVAL_BODY_BUFFERED;
    }
View Full Code Here

        // Legacy Java Script support -- This writes out a single table with both the id and names
        // mixed.  This is legacy support to match the pre beehive behavior.
        String idScript = null;
        if (TagConfig.isLegacyJavaScript()) {
            ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
            if (!ctrlState) {
                idScript = srs.mapLegacyTagId(getScriptReporter(), id, state.id);
            }
            else {
                AbstractHtmlControlState cState = (AbstractHtmlControlState) state;
                if (cState.name != null)
                    idScript = srs.mapLegacyTagId(getScriptReporter(), id, cState.name);
                else
                    idScript = srs.mapLegacyTagId(getScriptReporter(), id, state.id);
            }
        }

        // map the tagId to the real id
        String name = null;
View Full Code Here

    {

        // map the tagId to the real id
        String script = null;
        if (TagConfig.isDefaultJavaScript()) {
            ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
            script = srs.mapTagId(getScriptReporter(), id, state.id, name);
        }
        return script;
    }
View Full Code Here

        }
        br.doEndTag(writer);

        //Emit javascript if this button needs to sumbit the form or open a popup window
        if (idScript != null || _popupSupport != null || buttonDisable || buttonDisableAndSubmit) {
            ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
            InternalStringBuilder script = new InternalStringBuilder(32);
            StringBuilderRenderAppender scriptWriter = new StringBuilderRenderAppender(script);
            IScriptReporter sr = getScriptReporter();

            if (buttonDisableAndSubmit)
                srs.writeFeature(sr, scriptWriter, CoreScriptFeature.BUTTON_DISABLE_AND_SUBMIT, true, false, null);
            if (buttonDisable)
                srs.writeFeature(sr, scriptWriter, CoreScriptFeature.BUTTON_DISABLE, true, false, null);
            if (_popupSupport != null)
                _popupSupport.writeScript(request, srs, getScriptReporter(), scriptWriter);
            if (idScript != null)
                scriptWriter.append(idScript);
            write(script.toString());
View Full Code Here

    private String mapLegacyTagId(String tagId, String value)
    {
        // @todo: this is sort of broken, it needs to be updated
        IScriptReporter scriptReporter = getScriptReporter();
        ScriptRequestState srs = ScriptRequestState.getScriptRequestState((HttpServletRequest) pageContext.getRequest());
        String scriptId = srs.mapLegacyTagId(scriptReporter,tagId, value);
        return scriptId;
    }
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.tags.javascript.ScriptRequestState

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.