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


Java AjaxRequestAttributes.setChannel方法代码示例

本文整理汇总了Java中org.apache.wicket.ajax.attributes.AjaxRequestAttributes.setChannel方法的典型用法代码示例。如果您正苦于以下问题:Java AjaxRequestAttributes.setChannel方法的具体用法?Java AjaxRequestAttributes.setChannel怎么用?Java AjaxRequestAttributes.setChannel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.wicket.ajax.attributes.AjaxRequestAttributes的用法示例。


在下文中一共展示了AjaxRequestAttributes.setChannel方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initPrevious

import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; //导入方法依赖的package包/类
private void initPrevious() {
    WebMarkupContainer previous = new WebMarkupContainer(ID_PREVIOUS);
    previous.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return isPreviousEnabled() ? "" : "disabled";
        }
    }));
    add(previous);
    AjaxLink previousLink = new AjaxLink(ID_PREVIOUS_LINK) {

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            previousPerformed(target);
        }
    };
    previousLink.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isEnabled() {
            return isPreviousEnabled();
        }
    });
    previous.add(previousLink);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:32,代码来源:NavigatorPanel.java

示例2: initFirst

import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; //导入方法依赖的package包/类
private void initFirst() {
    WebMarkupContainer first = new WebMarkupContainer(ID_FIRST);
    first.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return isFirstEnabled() ? "" : "disabled";
        }
    }));
    add(first);
    AjaxLink firstLink = new AjaxLink(ID_FIRST_LINK) {

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            firstPerformed(target);
        }
    };
    firstLink.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isEnabled() {
            return BooleanUtils.isTrue(showPageListingModel.getObject()) && isFirstEnabled();
        }
    });
    first.add(firstLink);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:32,代码来源:NavigatorPanel.java

示例3: initNext

import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; //导入方法依赖的package包/类
private void initNext() {
    WebMarkupContainer next = new WebMarkupContainer(ID_NEXT);
    next.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return isNextEnabled() ? "" : "disabled";
        }
    }));
    add(next);

    AjaxLink nextLink = new AjaxLink(ID_NEXT_LINK) {

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            nextPerformed(target);
        }
    };
    nextLink.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isEnabled() {
            return isNextEnabled();
        }
    });
    next.add(nextLink);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:33,代码来源:NavigatorPanel.java

示例4: initLast

import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; //导入方法依赖的package包/类
private void initLast() {
    WebMarkupContainer last = new WebMarkupContainer(ID_LAST);
    last.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return isLastEnabled() ? "" : "disabled";
        }
    }));
    add(last);

    AjaxLink lastLink = new AjaxLink(ID_LAST_LINK) {

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            lastPerformed(target);
        }
    };
    lastLink.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isEnabled() {
            return BooleanUtils.isTrue(showPageListingModel.getObject()) && isLastEnabled();
        }
    });
    last.add(lastLink);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:33,代码来源:NavigatorPanel.java

示例5: updateAjaxAttributes

import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; //导入方法依赖的package包/类
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
{
	super.updateAjaxAttributes(attributes);
	
	attributes.setChannel(new AjaxChannel(getId()));
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:8,代码来源:WidgetTabs.java

示例6: init

import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; //导入方法依赖的package包/类
private void init() {
	setOutputMarkupId(true);	
	
	// render chart by ajax, uppon request
	chartRenderAjaxBehavior = new AbstractDefaultAjaxBehavior() {
		private static final long	serialVersionUID	= 1L;

		@Override
		protected void respond(AjaxRequestTarget target) {
			//log.debug("chartRenderAjaxBehavior.Responding for "+ getId());
			renderImage(target, true);
		}
		
		@Override
		public boolean isEnabled(Component component) {
			return state < 2;
		}
		
		@Override
		protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
		{
			super.updateAjaxAttributes(attributes);
			
			attributes.setChannel(new AjaxChannel(getId()));
		}
	};
	add(chartRenderAjaxBehavior);
	
	// fields for maximized chart size
	setDefaultModel(new CompoundPropertyModel(this));
	form = new Form("chartForm");
	form.add(new HiddenField("maxWidth"));
	form.add(new HiddenField("maxHeight"));
	add(form);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:36,代码来源:AjaxLazyLoadImage.java

示例7: initCartButton

import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; //导入方法依赖的package包/类
private void initCartButton(WebMarkupContainer headerPanel){
    AjaxButton cartButton = new AjaxButton(ID_CART_BUTTON) {
        private static final long serialVersionUID = 1L;

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
        }

        @Override
        public void onClick(AjaxRequestTarget ajaxRequestTarget) {
            navigateToNext(new PageAssignmentsList(true));
        }
    };
    cartButton.setOutputMarkupId(true);
    headerPanel.add(cartButton);

    Label cartItemsCount = new Label(ID_CART_ITEMS_COUNT,  new LoadableModel<String>(true) {
        private static final long serialVersionUID = 1L;

        @Override
        public String load(){
            return Integer.toString(getRoleCatalogStorage().getAssignmentShoppingCart().size());
        }
    });
    cartItemsCount.add(new VisibleEnableBehaviour() {
        @Override
        public boolean isVisible() {
            return !(getRoleCatalogStorage().getAssignmentShoppingCart().size() == 0);
        }
    });
    cartItemsCount.setOutputMarkupId(true);
    cartButton.add(cartItemsCount);
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:35,代码来源:PageAssignmentShoppingKart.java

示例8: updateAjaxAttributes

import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; //导入方法依赖的package包/类
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
	super.updateAjaxAttributes(attributes);
	attributes.setChannel(new AjaxChannel("input-assist", AjaxChannel.Type.DROP));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:6,代码来源:InputAssistBehavior.java

示例9: initCartButton

import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; //导入方法依赖的package包/类
private void initCartButton(WebMarkupContainer headerPanel){
    AjaxButton cartButton = new AjaxButton(ID_CART_BUTTON) {
        private static final long serialVersionUID = 1L;

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
        }

        @Override
        public void onClick(AjaxRequestTarget ajaxRequestTarget) {
            pageBase.navigateToNext(new PageAssignmentsList(true));
        }
    };
    cartButton.add(new VisibleEnableBehaviour(){
        public boolean isVisible(){
            return !isCatalogOidEmpty();
        }
    });
    cartButton.setOutputMarkupId(true);
    headerPanel.add(cartButton);

    Label cartItemsCount = new Label(ID_CART_ITEMS_COUNT,  new LoadableModel<String>(true) {
        private static final long serialVersionUID = 1L;

        @Override
        public String load(){
            return Integer.toString(getRoleCatalogStorage().getAssignmentShoppingCart().size());
        }
    });
    cartItemsCount.add(new VisibleEnableBehaviour() {
        @Override
        public boolean isVisible() {
            SessionStorage storage = pageBase.getSessionStorage();
            if (storage.getRoleCatalog().getAssignmentShoppingCart().size() == 0) {
                return false;
            } else {
                return true;
            }
        }
    });
    cartItemsCount.setOutputMarkupId(true);
    cartButton.add(cartItemsCount);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:45,代码来源:AssignmentCatalogPanel.java

示例10: setAutoDetermineChartSizeByAjax

import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; //导入方法依赖的package包/类
public void setAutoDetermineChartSizeByAjax(final String jquerySelectorForContainer) {
	autoDetermineChartSizeByAjax = true;
	AbstractDefaultAjaxBehavior determineChartSizeBehavior = new AbstractDefaultAjaxBehavior() {
		private static final long	serialVersionUID	= 1L;

		@Override
		protected void respond(AjaxRequestTarget target) {
			// parse desired image size
			Request req = RequestCycle.get().getRequest();

			selectedWidth = req.getQueryParameters().getParameterValue("width").toInt(400);					

			selectedHeight = req.getQueryParameters().getParameterValue("height").toInt(200);
			if(selectedHeight < 200)
			{
				selectedHeight = 200;
			}
			// render chart image
			renderImage(target, true);
		}

		@Override
		public void renderHead(Component component, IHeaderResponse response) {
			
			super.renderHead(component, response);
			response.render(OnDomReadyHeaderItem.forScript(getCallbackScript(component)));
		}
		
		@Override
		protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
		{
			super.updateAjaxAttributes(attributes);
			
			attributes.setChannel(new AjaxChannel(getId()));
			
			String dynamicExtraParams = "return { 'height': jQuery('" + jquerySelectorForContainer
					+ "').height(), 'width': jQuery('" + jquerySelectorForContainer + "').width() }";
			attributes.getDynamicExtraParameters().add(dynamicExtraParams);
		}
	};	
	
	add(determineChartSizeBehavior);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:44,代码来源:AjaxLazyLoadImage.java

示例11: updateAjaxAttributes

import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; //导入方法依赖的package包/类
@Override
protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) {
	super.updateAjaxAttributes(attributes);
	attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:6,代码来源:GbAjaxLink.java


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