当前位置: 首页>>代码示例>>Java>>正文


Java AjaxRequestTarget.prependJavaScript方法代码示例

本文整理汇总了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()));
		}
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:19,代码来源:AbstractSelect2Choice.java

示例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);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:13,代码来源:RunTaskBehavior.java

示例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()));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:13,代码来源:InfiniteScrollBehavior.java

示例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;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:12,代码来源:FloatingPanel.java

示例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);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:11,代码来源:ModalPanel.java

示例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);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:14,代码来源:CodeCommentPanel.java

示例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);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:16,代码来源:CodeCommentPanel.java


注:本文中的org.apache.wicket.ajax.AjaxRequestTarget.prependJavaScript方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。