List of usage examples for org.apache.wicket.markup.repeater RepeatingView setOutputMarkupId
public final Component setOutputMarkupId(final boolean output)
From source file:com.evolveum.midpoint.web.component.input.MultiStateHorizontalButton.java
License:Apache License
private void initLayout() { WebMarkupContainer buttonsPanel = new WebMarkupContainer(ID_BUTTONS_CONTAINER); buttonsPanel.setOutputMarkupId(true); add(buttonsPanel);/*from w ww . j av a2s .co m*/ RepeatingView buttons = new RepeatingView(ID_BUTTON); buttons.setOutputMarkupId(true); buttonsPanel.add(buttons); for (String propertyKey : propertyKeysList) { AjaxSubmitButton button = new AjaxSubmitButton(buttons.newChildId(), pageBase.createStringResource(propertyKey)) { @Override public void onSubmit(AjaxRequestTarget ajaxRequestTarget) { MultiStateHorizontalButton.this.onStateChanged(propertyKeysList.indexOf(propertyKey), ajaxRequestTarget); } @Override public void onError(AjaxRequestTarget ajaxRequestTarget) { MultiStateHorizontalButton.this.onStateChanged(propertyKeysList.indexOf(propertyKey), ajaxRequestTarget); } }; button.add(getActiveButtonClassAppender(propertyKeysList.indexOf(propertyKey))); button.setOutputMarkupId(true); buttons.add(button); } }
From source file:com.evolveum.midpoint.web.component.objectdetails.FocusPersonasTabPanel.java
License:Apache License
private void initLayout(ModelServiceLocator serviceLocator) { WebMarkupContainer container = new WebMarkupContainer(ID_PERSONAS_CONTAINER); container.setOutputMarkupId(true);//from w w w. j a va2 s.c o m add(container); RepeatingView view = new RepeatingView(ID_PERSONAS_TABLE); view.setOutputMarkupId(true); container.add(view); LoadableModel<List<PrismObject<FocusType>>> personasListModel = loadModel(); if (personasListModel.getObject() == null || personasListModel.getObject().size() == 0) { WebMarkupContainer viewChild = new WebMarkupContainer(view.newChildId()); viewChild.setOutputMarkupId(true); view.add(viewChild); WebMarkupContainer emptyContainer = new WebMarkupContainer(ID_PERSONAS_SUMMARY); emptyContainer.setOutputMarkupId(true); viewChild.add(emptyContainer); return; } Task task = pageBase.createSimpleTask(OPERATION_LOAD_PERSONAS); for (PrismObject<FocusType> personaObject : personasListModel.getObject()) { ObjectWrapper<FocusType> personaWrapper = ObjectWrapperUtil.createObjectWrapper( WebComponentUtil.getEffectiveName(personaObject, RoleType.F_DISPLAY_NAME), "", personaObject, ContainerStatus.MODIFYING, task, getPageBase()); WebMarkupContainer personaPanel = new WebMarkupContainer(view.newChildId()); personaPanel.setOutputMarkupId(true); view.add(personaPanel); FocusSummaryPanel.addSummaryPanel(personaPanel, personaObject, personaWrapper, ID_PERSONAS_SUMMARY, serviceLocator); } }
From source file:com.evolveum.midpoint.web.page.admin.resources.component.TestConnectionMessagesPanel.java
License:Apache License
private void initLayout() { setOutputMarkupId(true);/* w w w . j a v a 2s . c o m*/ WebMarkupContainer messagesPanel = new WebMarkupContainer(ID_MESSAGES_PANEL); messagesPanel.setOutputMarkupId(true); add(messagesPanel); ListView<ConnectorStruct> connectorView = new ListView<ConnectorStruct>(ID_CONNECTOR_MESSAGES_PANEL, connectorResourceResults) { private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem<ConnectorStruct> item) { Label connectorNameLabel = new Label(ID_CONNECTOR_NAME, item.getModelObject().connectorName); item.add(connectorNameLabel); RepeatingView connectorResultView = new RepeatingView(ID_CONNECTOR_MESSAGES); List<OpResult> resultsDto = item.getModelObject().connectorResultsDto; if (resultsDto != null) { initResultsPanel(connectorResultView, resultsDto, parentPage); } item.add(connectorResultView); } }; messagesPanel.add(connectorView); RepeatingView resultView = new RepeatingView(ID_RESOURCE_MESSAGES); if (modelResourceResults.getObject() != null) { initResultsPanel(resultView, modelResourceResults.getObject(), parentPage); } resultView.setOutputMarkupId(true); messagesPanel.add(resultView); }
From source file:com.evolveum.midpoint.web.page.admin.resources.component.TestConnectionResultPanel.java
License:Apache License
private void initLayout(Page parentPage) { WebMarkupContainer contentPanel = new WebMarkupContainer(ID_CONTENT_PANEL); contentPanel.setOutputMarkupId(true); add(contentPanel);// w ww . j a va 2 s .c o m Label messageLabel = new Label(ID_MESSAGE, ((PageBase) parentPage).createStringResource("TestConnectionResultPanel.message")); messageLabel.setOutputMarkupId(true); contentPanel.add(messageLabel); messageLabel.add(new VisibleEnableBehaviour() { public boolean isVisible() { return waitForResults; } }); RepeatingView resultView = new RepeatingView(ID_RESULT); if (model.getObject() != null && model.getObject().size() > 0) { initResultsPanel(resultView, parentPage); } resultView.setOutputMarkupId(true); resultView.add(new VisibleEnableBehaviour() { public boolean isVisible() { return !waitForResults; } }); contentPanel.add(resultView); AjaxButton ok = new AjaxButton(ID_OK) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { getPageBase().hideMainPopup(target); okPerformed(target); } }; contentPanel.add(ok); }
From source file:com.evolveum.midpoint.web.page.admin.users.component.OrgMemberPanel.java
License:Apache License
private WebMarkupContainer createManagerContainer() { WebMarkupContainer managerContainer = new WebMarkupContainer(ID_CONTAINER_MANAGER); managerContainer.setOutputMarkupId(true); managerContainer.setOutputMarkupPlaceholderTag(true); RepeatingView view = new RepeatingView(ID_MANAGER_TABLE); view.setOutputMarkupId(true); ObjectQuery managersQuery = createManagerQuery(); OperationResult searchManagersResult = new OperationResult(OPERATION_SEARCH_MANAGERS); Collection<SelectorOptions<GetOperationOptions>> options = SelectorOptions.createCollection( FocusType.F_JPEG_PHOTO, GetOperationOptions.createRetrieve(RetrieveOption.INCLUDE)); List<PrismObject<FocusType>> managers = WebModelServiceUtils.searchObjects(FocusType.class, managersQuery, options, searchManagersResult, getPageBase()); for (PrismObject<FocusType> manager : managers) { ObjectWrapper<FocusType> managerWrapper = ObjectWrapperUtil.createObjectWrapper( WebComponentUtil.getEffectiveName(manager, RoleType.F_DISPLAY_NAME), "", manager, ContainerStatus.MODIFYING, getPageBase()); WebMarkupContainer managerMarkup = new WebMarkupContainer(view.newChildId()); AjaxLink<String> link = new AjaxLink<String>(ID_EDIT_MANAGER) { private static final long serialVersionUID = 1L; @Override/* ww w . j a va 2 s . c o m*/ public void onClick(AjaxRequestTarget target) { FocusSummaryPanel<FocusType> summary = (FocusSummaryPanel<FocusType>) getParent() .get(ID_MANAGER_SUMMARY); detailsPerformed(target, summary.getModelObject()); } }; if (manager.getCompileTimeClass().equals(UserType.class)) { managerMarkup.add(new UserSummaryPanel(ID_MANAGER_SUMMARY, new Model<ObjectWrapper<UserType>>((ObjectWrapper) managerWrapper))); } else if (manager.getCompileTimeClass().equals(RoleType.class)) { managerMarkup.add(new RoleSummaryPanel(ID_MANAGER_SUMMARY, new Model<ObjectWrapper<RoleType>>((ObjectWrapper) managerWrapper))); } else if (manager.getCompileTimeClass().equals(OrgType.class)) { managerMarkup.add(new OrgSummaryPanel(ID_MANAGER_SUMMARY, new Model<ObjectWrapper<OrgType>>((ObjectWrapper) managerWrapper))); } else if (manager.getCompileTimeClass().equals(ServiceType.class)) { managerMarkup.add(new ServiceSummaryPanel(ID_MANAGER_SUMMARY, new Model<ObjectWrapper<ServiceType>>((ObjectWrapper) managerWrapper))); } link.setOutputMarkupId(true); managerMarkup.setOutputMarkupId(true); managerMarkup.add(link); view.add(managerMarkup); AjaxButton removeManager = new AjaxButton(ID_REMOVE_MANAGER) { @Override public void onClick(AjaxRequestTarget target) { FocusSummaryPanel<FocusType> summary = (FocusSummaryPanel<FocusType>) getParent() .get(ID_MANAGER_SUMMARY); removeManagerPerformed(summary.getModelObject(), target); getParent().setVisible(false); target.add(OrgMemberPanel.this); } }; removeManager.setOutputMarkupId(true); managerMarkup.add(removeManager); AjaxButton deleteManager = new AjaxButton(ID_DELETE_MANAGER) { @Override public void onClick(AjaxRequestTarget target) { FocusSummaryPanel<FocusType> summary = (FocusSummaryPanel<FocusType>) getParent() .get(ID_MANAGER_SUMMARY); deleteManagerPerformed(summary.getModelObject(), this, target); } }; deleteManager.setOutputMarkupId(true); managerMarkup.add(deleteManager); } managerContainer.add(view); InlineMenu menupanel = new InlineMenu(ID_MANAGER_MENU, new Model<Serializable>((Serializable) createManagersHeaderInlineMenu())); add(menupanel); menupanel.setOutputMarkupId(true); managerContainer.add(menupanel); return managerContainer; }
From source file:com.evolveum.midpoint.web.page.self.PageSelfConsents.java
License:Apache License
private void initLayout() { RepeatingView consents = new RepeatingView(ID_CONSENTS); consents.setOutputMarkupId(true); for (AssignmentType assignmentType : consentModel.getObject()) { SelfConsentPanel consentPanel = new SelfConsentPanel(consents.newChildId(), Model.of(assignmentType), this); consentPanel.setOutputMarkupId(true); consents.add(consentPanel);//ww w . j a v a 2 s.c o m } add(consents); }
From source file:net.dontdrinkandroot.wicket.bootstrap.component.button.ButtonGroupChoice.java
License:Apache License
public ButtonGroupChoice(String id, IModel<T> model, IModel<List<T>> choicesModel) { super(id, model); this.setOutputMarkupId(true); this.add(new CssClassAppender(BootstrapCssClass.BTN_GROUP)); final RepeatingView choicesView = new RepeatingView("choice"); choicesView.setOutputMarkupId(true); this.add(choicesView); for (final T choice : choicesModel.getObject()) { AjaxLink<Void> choiceLink = new AjaxLink<Void>(choicesView.newChildId()) { @Override/*www.j a va2 s . c om*/ public void onClick(AjaxRequestTarget target) { ButtonGroupChoice.this.onSelectionChanged(choice, target); } }; choiceLink.setBody(this.getDisplayModel(choice)); choiceLink.add(new CssClassAppender(new Model<BootstrapCssClass>() { @Override public BootstrapCssClass getObject() { if (ButtonGroupChoice.this.getModelObject().equals(choice)) { super.getObject(); } return null; } })); choicesView.add(choiceLink); } }
From source file:org.xaloon.wicket.component.comment.CurrentCommentListPanel.java
License:Apache License
public void load() { commentContainer.removeAll();//from ww w.j a v a 2 s. co m if (!providerAll) { // usual case with pages DataView<AbstractComment> dv = new DataView<AbstractComment>("rowContainer", provider, itemsPerPage) { /** * */ private static final long serialVersionUID = 1L; @Override protected void populateItem(Item<AbstractComment> item) { updateItem(item, item.getModelObject()); } }; commentContainer.add(dv); commentContainer.add(new AjaxPagingNavigator("navigator", dv)); } else { // google app engine - special case - issues with DataView, ListView RepeatingView repeating = new RepeatingView("rowContainer"); repeating.setOutputMarkupId(true); Iterator<? extends AbstractComment> result = provider.iterator(0, -1); while (result.hasNext()) { AbstractComment comment = result.next(); WebMarkupContainer wmc = new WebMarkupContainer(repeating.newChildId()); repeating.add(wmc); updateItem(wmc, comment); } commentContainer.add(repeating); commentContainer.add(new WebMarkupContainer("navigator").setVisible(false)); } }