當前位置: 首頁>>代碼示例>>Java>>正文


Java ListView.setOutputMarkupPlaceholderTag方法代碼示例

本文整理匯總了Java中org.apache.wicket.markup.html.list.ListView.setOutputMarkupPlaceholderTag方法的典型用法代碼示例。如果您正苦於以下問題:Java ListView.setOutputMarkupPlaceholderTag方法的具體用法?Java ListView.setOutputMarkupPlaceholderTag怎麽用?Java ListView.setOutputMarkupPlaceholderTag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.wicket.markup.html.list.ListView的用法示例。


在下文中一共展示了ListView.setOutputMarkupPlaceholderTag方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initLayout

import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的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

示例2: initLayout

import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的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


注:本文中的org.apache.wicket.markup.html.list.ListView.setOutputMarkupPlaceholderTag方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。