本文整理汇总了Java中org.apache.wicket.ajax.AjaxRequestTarget.prependJavaScript方法的典型用法代码示例。如果您正苦于以下问题:Java AjaxRequestTarget.prependJavaScript方法的具体用法?Java AjaxRequestTarget.prependJavaScript怎么用?Java AjaxRequestTarget.prependJavaScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.ajax.AjaxRequestTarget
的用法示例。
在下文中一共展示了AjaxRequestTarget.prependJavaScript方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEvent
import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
@Override
public void onEvent(IEvent<?> event) {
super.onEvent(event);
if (event.getPayload() instanceof AjaxRequestTarget) {
AjaxRequestTarget target = (AjaxRequestTarget) event.getPayload();
if (target.getComponents().contains(this)) {
// if this component is being repainted by ajax, directly, we
// must destroy Select2 so it removes
// its elements from DOM
target.prependJavaScript(JQuery.execute("$('#%s').select2('destroy');", getJquerySafeMarkupId()));
}
}
}
示例2: respond
import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
@Override
protected void respond(AjaxRequestTarget target) {
target.prependJavaScript(String.format(""
+ "var $button = $('#%s');"
+ "if ($button.length != 0) {"
+ "$button.removeAttr('disabled');"
+ "$button.val($button[0].prevValue);"
+ "$button.html($button[0].prevHtml);"
+ "}",
getComponent().getMarkupId()));
runTask(target);
}
示例3: respond
import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
@Override
protected void respond(AjaxRequestTarget target) {
IRequestParameters params = RequestCycle.get().getRequest().getPostParameters();
int page = params.getParameterValue("page").toInt();
target.prependJavaScript(String.format("$('#%s .loading-indicator').remove();",
getComponent().getMarkupId()));
appendPage(target, page);
target.appendJavaScript(String.format("gitplex.infiniteScroll.check('%s');",
getComponent().getMarkupId()));
}
示例4: FloatingPanel
import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
public FloatingPanel(AjaxRequestTarget target, AlignTarget alignTarget, AlignPlacement placement) {
super(((BasePage)target.getPage()).getRootComponents().newChildId());
BasePage page = (BasePage) target.getPage();
page.getRootComponents().add(this);
target.prependJavaScript(String.format("$('body').append(\"<div id='%s'></div>\");", getMarkupId()));
target.add(this);
this.alignTarget = alignTarget;
this.placement = placement;
}
示例5: ModalPanel
import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
public ModalPanel(AjaxRequestTarget target, Size size) {
super(((BasePage)target.getPage()).getRootComponents().newChildId());
this.size = size;
BasePage page = (BasePage) target.getPage();
page.getRootComponents().add(this);
target.prependJavaScript(String.format("$('body').append(\"<div id='%s'></div>\");", getMarkupId()));
target.add(this);
}
示例6: onStatusChanged
import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
private void onStatusChanged(AjaxRequestTarget target, Fragment fragment, CodeCommentStatusChange statusChange) {
WebMarkupContainer activityContainer = newActivityContainer(activitiesView.newChildId(), statusChange);
activitiesView.add(activityContainer);
String script = String.format("$('#%s .add-reply').before('<div id=\"%s\"></div>');",
CodeCommentPanel.this.getMarkupId(), activityContainer.getMarkupId());
target.prependJavaScript(script);
target.add(activityContainer);
WebMarkupContainer addReplyContainer = newAddReplyContainer();
fragment.replaceWith(addReplyContainer);
target.add(addReplyContainer);
}
示例7: onReplyAdded
import org.apache.wicket.ajax.AjaxRequestTarget; //导入方法依赖的package包/类
private void onReplyAdded(AjaxRequestTarget target, Fragment fragment, @Nullable CodeCommentReply reply) {
if (reply != null) {
WebMarkupContainer activityContainer = newActivityContainer(activitiesView.newChildId(), reply);
activitiesView.add(activityContainer);
String script = String.format("$('#%s .add-reply').before('<div id=\"%s\"></div>');",
CodeCommentPanel.this.getMarkupId(), activityContainer.getMarkupId());
target.prependJavaScript(script);
target.add(activityContainer);
}
WebMarkupContainer addReplyContainer = newAddReplyContainer();
fragment.replaceWith(addReplyContainer);
target.add(addReplyContainer);
}