List of usage examples for org.apache.wicket.core.util.string JavaScriptUtils SCRIPT_CLOSE_TAG
String SCRIPT_CLOSE_TAG
To view the source code for org.apache.wicket.core.util.string JavaScriptUtils SCRIPT_CLOSE_TAG.
Click Source Link
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. *//* www . j a v a 2 s. c o m*/ 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 {/* w ww. j a va 2 s .com*/ 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); } }