Java Code Examples for org.apache.wicket.markup.html.WebMarkupContainer#setOutputMarkupId()
The following examples show how to use
org.apache.wicket.markup.html.WebMarkupContainer#setOutputMarkupId() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ImportExportPage.java From sakai with Educational Community License v2.0 | 6 votes |
public ImportExportPage() { defaultRoleChecksForInstructorOnlyPage(); disableLink(this.importExportPageLink); container = new WebMarkupContainer("gradebookImportExportContainer"); container.setOutputMarkupId(true); container.add(new GradeImportUploadStep("wizard")); add(container); // hide BasePage's feedback panel and use the error/nonError filtered feedback panels feedbackPanel.setVisibilityAllowed(false); add(nonErrorFeedbackPanel); add(errorFeedbackPanel); }
Example 2
Source File: DefaultTreeTablePanel.java From projectforge-webapp with GNU General Public License v3.0 | 6 votes |
private WebMarkupContainer createTreeRow(final T node) { final WebMarkupContainer row = new WebMarkupContainer(rowRepeater.newChildId(), new Model<TreeTableNode>(node)); row.setOutputMarkupId(true); row.add(AttributeModifier.replace("class", "even")); if (clickRows == true) { WicketUtils.addRowClick(row); } rowRepeater.add(row); final RepeatingView colBodyRepeater = new RepeatingView("cols"); row.add(colBodyRepeater); final String cssStyle = getCssStyle(node); // Column: browse icons final TreeIconsActionPanel< ? extends TreeTableNode> treeIconsActionPanel = createTreeIconsActionPanel(node); addColumn(row, treeIconsActionPanel, cssStyle); treeIconsActionPanel.init(this, node); treeIconsActionPanel.add(AttributeModifier.append("style", new Model<String>("white-space: nowrap;"))); addColumns(colBodyRepeater, cssStyle, node); return row; }
Example 3
Source File: CodeEditorPanel.java From Orienteer with Apache License 2.0 | 6 votes |
@Override protected void onInitialize() { super.onInitialize(); setOutputMarkupPlaceholderTag(true); handle = new WebMarkupContainer("handle"); handle.setOutputMarkupId(true); WebMarkupContainer container = new WebMarkupContainer("container") { @Override public IMarkupFragment getMarkup(Component child) { if (child != null && child.getId().equals(handle.getId())) return super.getMarkup(child); return createMarkup(displayModel.getObject()); } }; container.add(handle); container.add(editorArea = createTextArea("editor")); add(container); }
Example 4
Source File: DisplayHTML5Panel.java From nextreports-server with Apache License 2.0 | 5 votes |
public DisplayHTML5Panel(String id, String width, String height, IModel<DisplayData> model) { super(id, model); WebMarkupContainer container = new WebMarkupContainer("displayCanvas"); container.setOutputMarkupId(true); container.add(new AttributeAppender("width", width)); container.add(new AttributeAppender("height", height)); zoom = "100%".equals(width) || "100%".equals(height); add(container); }
Example 5
Source File: Remediations.java From syncope with Apache License 2.0 | 5 votes |
public Remediations(final PageParameters parameters) { super(parameters); body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class)); WebMarkupContainer content = new WebMarkupContainer("content"); content.setOutputMarkupId(true); body.add(content); content.add(new RemediationDirectoryPanel("remediations", getPageReference())); }
Example 6
Source File: WidgetTabTemplate.java From sakai with Educational Community License v2.0 | 5 votes |
private void renderChart() { WebMarkupContainer chartTd = new WebMarkupContainer("chartTd"); chartTd.setOutputMarkupId(true); chart = new AjaxLazyLoadImage("chart", OverviewPage.class) { private static final long serialVersionUID = 1L; @Override public byte[] getImageData() { return getChartImage(chartWidth, 200); } @Override public byte[] getImageData(int width, int height) { return getChartImage(width, height); } private byte[] getChartImage(int width, int height) { PrefsData prefsData = Locator.getFacade().getStatsManager().getPreferences(siteId, false); int _width = (width <= 0) ? 350 : width; int _height = (height <= 0) ? 200: height; return Locator.getFacade().getChartService().generateChart( chartDataProvider.getReport(), _width, _height, prefsData.isChartIn3D(), prefsData.getChartTransparency(), prefsData.isItemLabelsVisible() ); } }; chart.setAutoDetermineChartSizeByAjax("#"+chartTd.getMarkupId()); chart.setOutputMarkupId(true); chartTd.add(chart); if(!renderChart) { chartTd.setVisible(false); }else if(renderChart && !renderTable) { chartTd.add(AttributeModifier.replace("colspan", "2")); } add(chartTd); }
Example 7
Source File: IssueActivitiesPanel.java From onedev with MIT License | 5 votes |
private Component newActivityRow(String id, IssueActivity activity) { WebMarkupContainer row = new WebMarkupContainer(id, Model.of(activity)); row.setOutputMarkupId(true); String anchor = activity.getAnchor(); if (anchor != null) row.setMarkupId(anchor); if (activity.getUser() != null) { row.add(new UserIdentPanel("avatar", activity.getUser(), Mode.AVATAR)); row.add(AttributeAppender.append("class", "with-avatar")); } else { row.add(new WebMarkupContainer("avatar").setVisible(false)); } row.add(activity.render("content", new DeleteCallback() { @Override public void onDelete(AjaxRequestTarget target) { row.remove(); target.appendJavaScript(String.format("$('#%s').remove();", row.getMarkupId())); } })); row.add(AttributeAppender.append("class", activity.getClass().getSimpleName())); return row; }
Example 8
Source File: DashboardColumnPanel.java From nextreports-server with Apache License 2.0 | 5 votes |
public DashboardColumnPanel(String id, IModel<DashboardColumn> model) { super(id, model); setOutputMarkupId(true); final int columnIndex = getDashboardColumn().getIndex(); columnContainer = new WebMarkupContainer("columnContainer"); columnContainer.setOutputMarkupId(true); columnContainer.setMarkupId("column-" + columnIndex); ListView<Widget> listView = new ListView<Widget>("widgetList", new WidgetsModel()) { private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem<Widget> item) { final Widget widget = item.getModelObject(); if (widget.isCollapsed()) { WidgetPanel widgetPanel = createWidgetPanel("widget", widget, new WidgetModel(widget.getId())); item.add(widgetPanel); } else { // item.add(new WidgetLoadingPanel("widget", new WidgetModel(widget.getId()))); item.add(createWidgetPanel("widget", widget, new WidgetModel(widget.getId()))); } item.setOutputMarkupId(true); item.setMarkupId("widget-" + widget.getId()); } }; columnContainer.add(listView); add(columnContainer); stopSortableAjaxBehavior = addSortableBehavior(columnContainer); }
Example 9
Source File: Notifications.java From syncope with Apache License 2.0 | 5 votes |
public Notifications(final PageParameters parameters) { super(parameters); body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class)); WebMarkupContainer content = new WebMarkupContainer("content"); content.setOutputMarkupId(true); content.setMarkupId("notifications"); content.add(new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList())); body.add(content); }
Example 10
Source File: AbstractMultiPanel.java From syncope with Apache License 2.0 | 5 votes |
public AbstractMultiPanel( final String id, final String name, final IModel<List<INNER>> model) { super(id, name, model); // ----------------------- // Object container definition // ----------------------- container = new WebMarkupContainer("multiValueContainer"); container.setOutputMarkupId(true); add(container); form = new Form<>("innerForm"); form.setDefaultButton(null); container.add(form); // ----------------------- view = new InnerView("view", name, model); final List<INNER> obj = model.getObject(); if (obj == null || obj.isEmpty()) { form.addOrReplace(getNoDataFragment(model, name)); } else { form.addOrReplace(getDataFragment()); } }
Example 11
Source File: SearchPage.java From inception with Apache License 2.0 | 5 votes |
public SearchPage() { project = Session.get().getMetaData(SessionMetaData.CURRENT_PROJECT); if (project == null) { abort(); } add(new SearchForm("searchForm")); List<IColumn<ExternalSearchResult, String>> columns = new ArrayList<>(); columns.add(new AbstractColumn<ExternalSearchResult, String>(new Model<>("Results")) { private static final long serialVersionUID = 3795885786416467291L; @Override public void populateItem(Item<ICellPopulator<ExternalSearchResult>> cellItem, String componentId, IModel<ExternalSearchResult> model) { @SuppressWarnings("rawtypes") Item rowItem = cellItem.findParent( Item.class ); int rowIndex = rowItem.getIndex(); ResultRowView rowView = new ResultRowView(componentId, rowIndex + 1, model); cellItem.add(rowView); } }); dataProvider = new ExternalResultDataProvider(externalSearchService, userRepository.getCurrentUser()); dataTableContainer = new WebMarkupContainer("dataTableContainer"); dataTableContainer.setOutputMarkupId(true); add(dataTableContainer); dataTableContainer.add(new DefaultDataTable<>("resultsTable", columns, dataProvider, 10)); }
Example 12
Source File: ParametersWizardAttrStep.java From syncope with Apache License 2.0 | 5 votes |
public ParametersWizardAttrStep(final ParametersWizardPanel.ParametersForm modelObject) { this.setOutputMarkupId(true); WebMarkupContainer content = new WebMarkupContainer("content"); content.setOutputMarkupId(true); add(content); schema = new AjaxTextFieldPanel( "schema", getString("schema"), new PropertyModel<>(modelObject.getParam(), "schema")); schema.setRequired(true); content.add(schema); LoadableDetachableModel<List<PlainSchemaTO>> loadableDetachableModel = new LoadableDetachableModel<List<PlainSchemaTO>>() { private static final long serialVersionUID = 7172461137064525667L; @Override protected List<PlainSchemaTO> load() { return List.of(modelObject.getSchema()); } }; ListView<PlainSchemaTO> listView = new ListView<PlainSchemaTO>("attrs", loadableDetachableModel) { private static final long serialVersionUID = 9101744072914090143L; @Override protected void populateItem(final ListItem<PlainSchemaTO> item) { final Panel panel = getFieldPanel("panel", modelObject.getParam(), item.getModelObject()); item.add(panel); } }; content.add(listView); }
Example 13
Source File: PullRequestActivitiesPage.java From onedev with MIT License | 5 votes |
private Component newActivityRow(String id, PullRequestActivity activity) { WebMarkupContainer row = new WebMarkupContainer(id, Model.of(activity)); row.setOutputMarkupId(true); String anchor = activity.getAnchor(); if (anchor != null) row.setMarkupId(anchor); if (activity.getUser() != null) row.add(new UserIdentPanel("avatar", activity.getUser(), Mode.AVATAR)); else row.add(new WebMarkupContainer("avatar")); Component content = activity.render("content", new DeleteCallback() { @Override public void onDelete(AjaxRequestTarget target) { row.remove(); target.appendJavaScript(String.format("$('#%s').remove();", row.getMarkupId())); } }); row.add(content); row.add(AttributeAppender.append("class", activity.getClass().getSimpleName())); return row; }
Example 14
Source File: Flowable.java From syncope with Apache License 2.0 | 4 votes |
public Flowable(final PageParameters parameters) { super(parameters); body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class)); WebMarkupContainer content = new WebMarkupContainer("content"); content.setOutputMarkupId(true); body.add(content); WizardMgtPanel<BpmnProcess> bpmnProcessesPanel = new BpmnProcessDirectoryPanel.Builder(getPageReference()) { private static final long serialVersionUID = -5960765294082359003L; }.disableCheckBoxes().build("bpmnProcessesPanel"); bpmnProcessesPanel.setOutputMarkupPlaceholderTag(true); MetaDataRoleAuthorizationStrategy.authorize(bpmnProcessesPanel, ENABLE, FlowableEntitlement.BPMN_PROCESS_GET); content.add(bpmnProcessesPanel); }
Example 15
Source File: RealmDetails.java From syncope with Apache License 2.0 | 4 votes |
public RealmDetails( final String id, final RealmTO realmTO, final ActionsPanel<?> actionsPanel, final boolean unwrapped) { super(id); container = new WebMarkupContainer("container"); container.setOutputMarkupId(true); container.setRenderBodyOnly(unwrapped); add(container); final WebMarkupContainer generics = new WebMarkupContainer("generics"); container.add(generics.setVisible(unwrapped)); FieldPanel<String> name = new AjaxTextFieldPanel( "name", "name", new PropertyModel<>(realmTO, "name"), false); name.addRequiredLabel(); generics.add(name); FieldPanel<String> fullPath = new AjaxTextFieldPanel( "fullPath", "fullPath", new PropertyModel<>(realmTO, "fullPath"), false); fullPath.setEnabled(false); generics.add(fullPath); AjaxDropDownChoicePanel<String> accountPolicy = new AjaxDropDownChoicePanel<>( "accountPolicy", new ResourceModel("accountPolicy", "accountPolicy").getObject(), new PropertyModel<>(realmTO, "accountPolicy"), false); accountPolicy.setChoiceRenderer(new PolicyRenderer(accountPolicies)); accountPolicy.setChoices(new ArrayList<>(accountPolicies.getObject().keySet())); ((DropDownChoice<?>) accountPolicy.getField()).setNullValid(true); container.add(accountPolicy); AjaxDropDownChoicePanel<String> passwordPolicy = new AjaxDropDownChoicePanel<>( "passwordPolicy", new ResourceModel("passwordPolicy", "passwordPolicy").getObject(), new PropertyModel<>(realmTO, "passwordPolicy"), false); passwordPolicy.setChoiceRenderer(new PolicyRenderer(passwordPolicies)); passwordPolicy.setChoices(new ArrayList<>(passwordPolicies.getObject().keySet())); ((DropDownChoice<?>) passwordPolicy.getField()).setNullValid(true); container.add(passwordPolicy); AjaxPalettePanel<String> actions = new AjaxPalettePanel.Builder<String>(). setAllowMoveAll(true).setAllowOrder(true). build("actions", new PropertyModel<>(realmTO, "actions"), new ListModel<>(logicActions.getObject())); actions.setOutputMarkupId(true); container.add(actions); container.add(new AjaxPalettePanel.Builder<String>().build("resources", new PropertyModel<>(realmTO, "resources"), new ListModel<>(resources.getObject())). setOutputMarkupId(true). setEnabled(!SyncopeConstants.ROOT_REALM.equals(realmTO.getName())). setVisible(!SyncopeConstants.ROOT_REALM.equals(realmTO.getName()))); if (actionsPanel == null) { add(new Fragment("actions", "emptyFragment", this).setRenderBodyOnly(true)); } else { Fragment fragment = new Fragment("actions", "actionsFragment", this); fragment.add(actionsPanel); add(fragment.setRenderBodyOnly(true)); } }
Example 16
Source File: CorrectionPage.java From webanno with Apache License 2.0 | 4 votes |
private void commonInit() { setVersioned(false); setModel(Model.of(new AnnotatorStateImpl(Mode.CORRECTION))); WebMarkupContainer rightSidebar = new WebMarkupContainer("rightSidebar"); // Override sidebar width from preferences rightSidebar.add(new AttributeModifier("style", LambdaModel.of(() -> String .format("flex-basis: %d%%;", getModelObject().getPreferences().getSidebarSize())))); rightSidebar.setOutputMarkupId(true); add(rightSidebar); rightSidebar.add(detailEditor = createDetailEditor()); centerArea = new WebMarkupContainer("centerArea"); centerArea.add(visibleWhen(() -> getModelObject().getDocument() != null)); centerArea.setOutputMarkupPlaceholderTag(true); centerArea.add(createDocumentInfoLabel()); actionBar = new ActionBar("actionBar"); centerArea.add(actionBar); annotationEditor = new BratAnnotationEditor("mergeView", getModel(), detailEditor, this::getEditorCas); centerArea.add(annotationEditor); add(centerArea); getModelObject().setPagingStrategy(new SentenceOrientedPagingStrategy()); centerArea.add(getModelObject().getPagingStrategy() .createPositionLabel(MID_NUMBER_OF_PAGES, getModel()) .add(visibleWhen(() -> getModelObject().getDocument() != null)) .add(LambdaBehavior.onEvent(RenderAnnotationsEvent.class, (c, e) -> e.getRequestHandler().add(c)))); List<UserAnnotationSegment> segments = new LinkedList<>(); UserAnnotationSegment userAnnotationSegment = new UserAnnotationSegment(); if (getModelObject().getDocument() != null) { userAnnotationSegment .setSelectionByUsernameAndAddress(annotationSelectionByUsernameAndAddress); userAnnotationSegment.setAnnotatorState(getModelObject()); segments.add(userAnnotationSegment); } suggestionView = new SuggestionViewPanel("correctionView", new ListModel<>(segments)) { private static final long serialVersionUID = 2583509126979792202L; @Override public void onChange(AjaxRequestTarget aTarget) { AnnotatorState state = CorrectionPage.this.getModelObject(); aTarget.addChildren(getPage(), IFeedback.class); try { // update begin/end of the curation segment based on bratAnnotatorModel changes // (like sentence change in auto-scroll mode,.... curationContainer.setState(state); CAS editorCas = getEditorCas(); setCurationSegmentBeginEnd(editorCas); suggestionView.updatePanel(aTarget, curationContainer, annotationSelectionByUsernameAndAddress, curationSegment); annotationEditor.requestRender(aTarget); update(aTarget); } catch (UIMAException e) { LOG.error("Error: " + e.getMessage(), e); error("Error: " + ExceptionUtils.getRootCauseMessage(e)); } catch (Exception e) { LOG.error("Error: " + e.getMessage(), e); error("Error: " + e.getMessage()); } } }; centerArea.add(suggestionView); curationContainer = new CurationContainer(); curationContainer.setState(getModelObject()); }
Example 17
Source File: ChartRendererPanel.java From nextreports-server with Apache License 2.0 | 4 votes |
private ChartRendererPanel(String id, final IModel<Chart> model, ChartWidget widget, final DrillEntityContext drillContext, boolean zoom, String width, String height, Map<String,Object> urlQueryParameters) { super(id, model); this.drillContext = drillContext; this.urlQueryParameters = urlQueryParameters; this.model = model; this.widget = widget; this.zoom = zoom; this.width = width; this.height = height; if ((drillContext != null) && !drillContext.isLast()) { onClickChartAjaxBehavior = new OnClickChartAjaxBehavior() { private static final long serialVersionUID = 1L; @Override public void onClickChart(AjaxRequestTarget target, String value) { try { // x values pattern String pattern = NextUtil.getNextChart(model.getObject()).getXPattern(); ChartRendererPanel.this.onClickChart(target, value, pattern); } catch (Exception e) { LOG.error(e.getMessage(), e); } } }; add(onClickChartAjaxBehavior); } container = new WebMarkupContainer("chartContainer"); container.setOutputMarkupId(true); container.add(new EmptyPanel("chart")); // add this class to have the same height when we drill inside a chart // remove it when an error occurs (see below) container.add(AttributeAppender.append("class", "dragbox-content-chart zoom")); add(container); error = new WebMarkupContainer("errorContainer"); error.setOutputMarkupId(true); error.add(new EmptyPanel("error")); add(error); add(new HTML5Behavior()); }
Example 18
Source File: AbstractBasePage.java From AppStash with Apache License 2.0 | 4 votes |
private Component headerContainer() { header = new WebMarkupContainer("header"); header.add(navigation()); return header.setOutputMarkupId(true); }
Example 19
Source File: StatementGroupPanel.java From inception with Apache License 2.0 | 4 votes |
public ExistingStatementGroupFragment(String aId) { super(aId, "existingStatementGroup", StatementGroupPanel.this, groupModel); StatementGroupBean statementGroupBean = groupModel.getObject(); Form<StatementGroupBean> form = new Form<StatementGroupBean>("form"); LambdaAjaxLink propertyLink = new LambdaAjaxLink("propertyLink", this::actionPropertyLinkClicked); propertyLink.add(new Label("property", groupModel.bind("property.uiLabel"))); form.add(propertyLink); // TODO what about handling type intersection when multiple range statements are // present? // obtain IRI of property range, if existent IModel<KBProperty> propertyModel = Model.of(statementGroupBean.getProperty()); form.add(new IriInfoBadge("statementIdtext", groupModel.bind("property.identifier"))); RefreshingView<KBStatement> statementList = new RefreshingView<KBStatement>( "statementList") { private static final long serialVersionUID = 5811425707843441458L; @Override protected Iterator<IModel<KBStatement>> getItemModels() { return new ModelIteratorAdapter<KBStatement>( statementGroupBean.getStatements()) { @Override protected IModel<KBStatement> model(KBStatement object) { return LambdaModel.of(() -> object); } }; } @Override protected void populateItem(Item<KBStatement> aItem) { StatementEditor editor = new StatementEditor("statement", groupModel.bind("kb"), aItem.getModel(), propertyModel); aItem.add(editor); aItem.setOutputMarkupId(true); } }; statementList.setItemReuseStrategy(new ReuseIfModelsEqualStrategy()); // wrap the RefreshingView in a WMC, otherwise we can't redraw it with AJAX (see // https://cwiki.apache.org/confluence/display/WICKET/How+to+repaint+a+ListView+via+Ajax) statementListWrapper = new WebMarkupContainer("statementListWrapper"); statementListWrapper.setOutputMarkupId(true); statementListWrapper.add(statementList); form.add(statementListWrapper); WebMarkupContainer statementGroupFooter = new WebMarkupContainer("statementGroupFooter"); LambdaAjaxLink addLink = new LambdaAjaxLink("add", this::actionAddValue); addLink.add(new Label("label", new ResourceModel("statement.value.add"))); addLink.add(new WriteProtectionBehavior(groupModel.bind("kb"))); statementGroupFooter.add(addLink); AttributeAppender framehighlightAppender = new AttributeAppender("style", LoadableDetachableModel.of(() -> "background-color:#" + getColoringStrategy().getFrameColor() )); statementGroupFooter.add(framehighlightAppender); form.add(framehighlightAppender); AttributeAppender highlightAppender = new AttributeAppender("style", LoadableDetachableModel.of(() -> { StatementColoringStrategy coloringStrategy = getColoringStrategy(); return "background-color:#" + coloringStrategy.getBackgroundColor() + ";color:#" + coloringStrategy.getTextColor(); })); statementListWrapper.add(highlightAppender); form.add(statementGroupFooter); add(form); }
Example 20
Source File: OArchitectEditorWidget.java From Orienteer with Apache License 2.0 | 4 votes |
private WebMarkupContainer newContainer(String id) { WebMarkupContainer container = new WebMarkupContainer(id); container.setOutputMarkupId(true); return container; }