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


Java AjaxLink.setOutputMarkupId方法代码示例

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


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

示例1: initLayout

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
private void initLayout(IModel<String> model, IModel<String> titleModel) {
    AjaxLink link = new AjaxLink(ID_LINK) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            onClickPerformed(target);
        }
    };

    Label image = new Label(ID_IMAGE);
    image.add(AttributeModifier.replace("class", model));
    if (titleModel != null) {
        image.add(AttributeModifier.replace("title", titleModel));
    }
    link.add(image);
    link.setOutputMarkupId(true);
    add(link);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:19,代码来源:LinkIconPanel.java

示例2: newCancelButton

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
/**
 * 
 * @return
 */
private AjaxLink newCancelButton() {
	AjaxLink cancelLink = new AjaxLink("cancelButton") {

		@Override
		public void onClick(AjaxRequestTarget target) {

			PageParameters params = new PageParameters();
			params.add(MESSAGE_PARAM,
					new StringResourceModel("canceled.message", this, null));
			params.add("id", dashboard.getId());

			// redirect to dashboard view page
			setResponsePage(DashboardViewPage.class, params);

		}
	};
	
	cancelLink.setOutputMarkupId(true);
	return cancelLink;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:25,代码来源:DashboardSharePage.java

示例3: createRoleLink

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
private Component createRoleLink(String id, IModel<PrismObject<R>> model) {
    AjaxLink<PrismObject<R>> button = new AjaxLink<PrismObject<R>>(id, model) {

        @Override
        public IModel<?> getBody() {
            return new Model<String>(getModel().getObject().asObjectable().getName().getOrig());
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            LOGGER.trace("{} CLICK: {}", this, getModel().getObject());
            toggleRole(getModel().getObject());
            target.add(this);
        }

        @Override
        protected void onComponentTag(ComponentTag tag) {
            super.onComponentTag(tag);
            PrismObject<R> role = getModel().getObject();
            if (isSelected(role)) {
                tag.put("class", "list-group-item active");
            } else {
                tag.put("class", "list-group-item");
            }
            String description = role.asObjectable().getDescription();
            if (description != null) {
                tag.put("title", description);
            }
        }
    };
    button.setOutputMarkupId(true);
    return button;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:34,代码来源:SimpleRoleSelector.java

示例4: createParamLink

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
private Component createParamLink(String id, IModel<String> itemModel) {
    AjaxLink<String> button = new AjaxLink<String>(id, itemModel) {

        @Override
        public IModel<?> getBody() {
            return new Model<String>(getModel().getObject());
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            LOGGER.trace("{} CLICK param: {}", this, getModel().getObject());
            toggleParam(getModel().getObject());
            target.add(SimpleParametricRoleSelector.this);
        }

        @Override
        protected void onComponentTag(ComponentTag tag) {
            super.onComponentTag(tag);
            String param = getModel().getObject();
            if (param.equals(selectedParam)) {
                tag.put("class", "list-group-item active");
            } else {
                tag.put("class", "list-group-item");
            }
        }
    };
    button.setOutputMarkupId(true);
    return button;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:30,代码来源:SimpleParametricRoleSelector.java

示例5: initLayout

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
private void initLayout(final boolean nullValid, final NonEmptyModel<Boolean> readOnlyModel) {
      WebMarkupContainer placeholderContainer = new WebMarkupContainer(ID_PLACEHOLDER_CONTAINER);
      placeholderContainer.setOutputMarkupPlaceholderTag(true);
      placeholderContainer.setOutputMarkupPlaceholderTag(true);
      placeholderContainer.add(new VisibleEnableBehaviour(){

          @Override
          public boolean isVisible() {
              return getModel().getObject().isEmpty();
          }
      });
      add(placeholderContainer);

      AjaxLink placeholderAdd = new AjaxLink(ID_PLACEHOLDER_ADD) {

          @Override
          public void onClick(AjaxRequestTarget target) {
              addValuePerformed(target);
          }
      };
      placeholderAdd.add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {

          @Override
          public String getObject() {
              if (buttonsDisabled()) {
                  return " " + CSS_DISABLED;
              }

              return "";
          }
      }));
      placeholderAdd.setOutputMarkupId(true);
      placeholderAdd.setOutputMarkupPlaceholderTag(true);
placeholderAdd.add(WebComponentUtil.visibleIfFalse(readOnlyModel));
      placeholderContainer.add(placeholderAdd);

      ListView repeater = new ListView<T>(ID_REPEATER, getModel()){

          @Override
          protected void populateItem(final ListItem<T> item) {

              DropDownChoice choice = new DropDownChoice<>(ID_INPUT, createDropDownItemModel(item.getModel()),
                      createChoiceList(), createRenderer());
              choice.setNullValid(nullValid);
		choice.add(WebComponentUtil.enabledIfFalse(readOnlyModel));
              item.add(choice);

              WebMarkupContainer buttonGroup = new WebMarkupContainer(ID_BUTTON_GROUP);
              item.add(buttonGroup);
              initButtons(buttonGroup, item, readOnlyModel);
          }
      };
      repeater.setOutputMarkupId(true);
      repeater.setOutputMarkupPlaceholderTag(true);
      repeater.add(new VisibleEnableBehaviour(){

          @Override
          public boolean isVisible() {
              return !getModel().getObject().isEmpty();
          }
      });
      add(repeater);
  }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:64,代码来源:MultiValueDropDownPanel.java

示例6: initLayout

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
private void initLayout(final boolean inputEnabled, final boolean showPlaceholder, final NonEmptyModel<Boolean> readOnlyModel) {
      WebMarkupContainer placeholderContainer = new WebMarkupContainer(ID_PLACEHOLDER_CONTAINER);
      placeholderContainer.setOutputMarkupPlaceholderTag(true);
      placeholderContainer.setOutputMarkupPlaceholderTag(true);
      placeholderContainer.add(new VisibleEnableBehaviour(){

          @Override
          public boolean isVisible() {
              return showPlaceholder && (getModel().getObject() == null || getModel().getObject().isEmpty());
          }
      });
      add(placeholderContainer);

      AjaxLink placeholderAdd = new AjaxLink(ID_PLACEHOLDER_ADD) {

          @Override
          public void onClick(AjaxRequestTarget target) {
              addValuePerformed(target);
          }
      };
      placeholderAdd.add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {

          @Override
          public String getObject() {
              if (buttonsDisabled()) {
                  return " " + CSS_DISABLED;
              }

              return "";
          }
      }));
placeholderAdd.add(WebComponentUtil.visibleIfFalse(readOnlyModel));
      placeholderAdd.setOutputMarkupId(true);
      placeholderAdd.setOutputMarkupPlaceholderTag(true);
      placeholderContainer.add(placeholderAdd);

      ListView repeater = new ListView<T>(ID_REPEATER, getModel()) {

          @Override
          protected void populateItem(final ListItem<T> item) {
              TextField text = new TextField<>(ID_TEXT, createTextModel(item.getModel()));
              text.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
              text.add(AttributeAppender.replace("placeholder", createEmptyItemPlaceholder()));
		if (selectedModel != null && item.getModelObject() == selectedModel.getObject()) {
			text.add(AttributeAppender.append("style", "background-color: #FFFFD0;"));			// TODO color constant
		}

		if (!inputEnabled) {
			text.add(new AttributeModifier("disabled", "disabled"));
		}
		item.add(text);

              WebMarkupContainer buttonGroup = new WebMarkupContainer(ID_BUTTON_GROUP);
              item.add(buttonGroup);
              initButtons(buttonGroup, item, readOnlyModel);
          }
      };
      repeater.setOutputMarkupId(true);
      repeater.setOutputMarkupPlaceholderTag(true);
      repeater.add(new VisibleEnableBehaviour(){

          @Override
          public boolean isVisible() {
              return getModel().getObject() != null && !getModel().getObject().isEmpty();
          }
      });
      add(repeater);
  }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:69,代码来源:MultiValueTextEditPanel.java

示例7: initError

import org.apache.wicket.ajax.markup.html.AjaxLink; //导入方法依赖的package包/类
private void initError(WebMarkupContainer operationPanel, final IModel<OpResult> model, Page parentPage) {
		Label errorLabel = new Label("errorLabel", parentPage.getString("FeedbackAlertMessageDetails.error"));
		errorLabel.add(new VisibleEnableBehaviour() {
			private static final long serialVersionUID = 1L;

			@Override
			public boolean isVisible() {
				// return true;
				return StringUtils.isNotBlank(model.getObject().getExceptionsStackTrace());

			}
		});
		errorLabel.setOutputMarkupId(true);
		operationPanel.add(errorLabel);

		Label errorMessage = new Label("errorMessage", new PropertyModel<String>(model, "exceptionMessage"));
		errorMessage.add(new VisibleEnableBehaviour() {
			private static final long serialVersionUID = 1L;

			@Override
			public boolean isVisible() {
				// return true;
				return StringUtils.isNotBlank(model.getObject().getExceptionsStackTrace());

			}
		});
		errorMessage.setOutputMarkupId(true);
		operationPanel.add(errorMessage);

		final Label errorStackTrace = new Label(ID_ERROR_STACK_TRACE,
				new PropertyModel<String>(model, "exceptionsStackTrace"));
		errorStackTrace.add(new VisibleEnableBehaviour() {
			private static final long serialVersionUID = 1L;

			@Override
			public boolean isVisible() {
				// return true;
				return model.getObject().isShowError();

			}
		});
		errorStackTrace.setOutputMarkupId(true);
		operationPanel.add(errorStackTrace);

		AjaxLink errorStackTraceLink = new AjaxLink("errorStackTraceLink") {
			private static final long serialVersionUID = 1L;

			@Override
			public void onClick(AjaxRequestTarget target) {
				OpResult result = OperationResultPanel.this.getModelObject();
				result.setShowError(!model.getObject().isShowError());
				result.setAlreadyShown(false);  // hack to be able to expand/collapse OpResult after rendered.
//				model.getObject().setShowError(!model.getObject().isShowError());
				target.add(OperationResultPanel.this);
			}

		};
		errorStackTraceLink.setOutputMarkupId(true);
		errorStackTraceLink.add(new VisibleEnableBehaviour() {
			private static final long serialVersionUID = 1L;

			@Override
			public boolean isVisible() {
				return StringUtils.isNotBlank(model.getObject().getExceptionsStackTrace());

			}
		});
		operationPanel.add(errorStackTraceLink);

	}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:71,代码来源:OperationResultPanel.java


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