Example usage for org.apache.wicket.core.util.string JavaScriptUtils SCRIPT_OPEN_TAG

List of usage examples for org.apache.wicket.core.util.string JavaScriptUtils SCRIPT_OPEN_TAG

Introduction

In this page you can find the example usage for org.apache.wicket.core.util.string JavaScriptUtils SCRIPT_OPEN_TAG.

Prototype

String SCRIPT_OPEN_TAG

To view the source code for org.apache.wicket.core.util.string JavaScriptUtils SCRIPT_OPEN_TAG.

Click Source Link

Document

Script open tag including content prefix

Usage

From source file:de.invesdwin.nowicket.component.palette.component.AOptions.java

License:Apache License

/**
 * A piece of javascript to avoid serializing the options during AJAX serialization.
 *//*w  ww .  java 2s .c om*/
protected void avoidAjaxSerialization() {
    getResponse().write(JavaScriptUtils.SCRIPT_OPEN_TAG
            + "if (typeof(Wicket) != \"undefined\" && typeof(Wicket.Form) != \"undefined\")"
            + "    Wicket.Form.excludeFromAjaxSerialization." + getMarkupId() + "='true';"
            + JavaScriptUtils.SCRIPT_CLOSE_TAG);
}

From source file:org.efaps.ui.wicket.components.form.command.EsjpAjaxComponent.java

License:Apache License

@Override
public void onComponentTagBody(final MarkupStream _markupstream, final ComponentTag _componenttag) {
    super.onComponentTagBody(_markupstream, _componenttag);
    try {/*from   ww  w  .  j a v a 2  s  . co m*/
        final CharSequence script = ((AjaxCmdBehavior) getBehaviors().get(0)).getCallbackScript();
        final UICmdField uiObject = (UICmdField) getDefaultModelObject();

        final AbstractUIPageObject pageObject = (AbstractUIPageObject) getPage().getDefaultModelObject();
        final Map<String, String> uiID2Oid = pageObject == null ? null : pageObject.getUiID2Oid();
        final StringBuilder content = new StringBuilder();
        content.append(JavaScriptUtils.SCRIPT_OPEN_TAG).append("function ")
                .append(uiObject.getFieldConfiguration().getName()).append("(){\n").append(script)
                .append("\n};").append(JavaScriptUtils.SCRIPT_CLOSE_TAG)
                .append(uiObject.getRenderedContent(script.toString(), uiID2Oid));
        replaceComponentTagBody(_markupstream, _componenttag, content);
    } catch (final EFapsException e) {
        EsjpAjaxComponent.LOG.error("onComponentTagBody", e);
    }
}