Java Code Examples for org.apache.wicket.markup.html.WebMarkupContainer#setMarkupId()

The following examples show how to use org.apache.wicket.markup.html.WebMarkupContainer#setMarkupId() . 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: BaseModal.java    From syncope with Apache License 2.0 6 votes vote down vote up
@Override
protected void onInitialize() {
    super.onInitialize();

    final WebMarkupContainer dialog = (WebMarkupContainer) this.get("dialog");
    dialog.setMarkupId(this.getId());

    footer = (WebMarkupContainer) this.get("dialog:footer");
    footer.addOrReplace(new ListView<Component>("inputs", components) {

        private static final long serialVersionUID = 4949588177564901031L;

        @Override
        protected void populateItem(final ListItem<Component> item) {
            item.add(item.getModelObject());
        }
    }.setOutputMarkupId(true)).setOutputMarkupId(true);
}
 
Example 2
Source File: ChartPanel.java    From inception with Apache License 2.0 5 votes vote down vote up
public ChartPanel(String aId, IModel<LearningCurve> aModel)
{
    super(aId, aModel);

    chart = new WebMarkupContainer(MID_CHART_CONTAINER);
    chart.setMarkupId(OUTPUT_MARKUP_ID_CHART);
    add(chart);

    chartAjaxBejavior = new ChartAjaxBejavior();
    add(chartAjaxBejavior);
}
 
Example 3
Source File: IssueActivitiesPanel.java    From onedev with MIT License 5 votes vote down vote up
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 4
Source File: PullRequestActivitiesPage.java    From onedev with MIT License 5 votes vote down vote up
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 5
Source File: Implementations.java    From syncope with Apache License 2.0 5 votes vote down vote up
public Implementations(final PageParameters parameters) {
    super(parameters);

    body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));

    WebMarkupContainer content = new WebMarkupContainer("content");
    content.setOutputMarkupId(true);
    content.setMarkupId("implementations");
    content.add(new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList()));
    body.add(content);
}
 
Example 6
Source File: Domains.java    From syncope with Apache License 2.0 5 votes vote down vote up
public Domains(final PageParameters parameters) {
    super(parameters);

    body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));

    WebMarkupContainer content = new WebMarkupContainer("content");
    content.setOutputMarkupId(true);
    content.setMarkupId("domains");
    content.add(new DomainDirectoryPanel("domainPanel", getPageReference()));
    body.add(content);
}
 
Example 7
Source File: Security.java    From syncope with Apache License 2.0 5 votes vote down vote up
public Security(final PageParameters parameters) {
    super(parameters);

    body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));
    WebMarkupContainer content = new WebMarkupContainer("content");
    content.setOutputMarkupId(true);
    content.setMarkupId("security");
    content.add(new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList()));
    body.add(content);
}
 
Example 8
Source File: Policies.java    From syncope with Apache License 2.0 5 votes vote down vote up
public Policies(final PageParameters parameters) {
    super(parameters);

    body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));

    WebMarkupContainer content = new WebMarkupContainer("content");
    content.setOutputMarkupId(true);
    content.setMarkupId("policies");
    content.add(new AjaxBootstrapTabbedPanel<>(
            "tabbedPanel", SyncopeWebApplication.get().getPolicyTabProvider().buildTabList(getPageReference())));
    body.add(content);
}
 
Example 9
Source File: NetworkServices.java    From syncope with Apache License 2.0 5 votes vote down vote up
public NetworkServices(final PageParameters parameters) {
    super(parameters);

    body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));

    WebMarkupContainer content = new WebMarkupContainer("content");
    content.setOutputMarkupId(true);
    content.setMarkupId("networkservices");
    content.add(new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList()));
    body.add(content);
}
 
Example 10
Source File: Notifications.java    From syncope with Apache License 2.0 5 votes vote down vote up
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 11
Source File: Reports.java    From syncope with Apache License 2.0 5 votes vote down vote up
public Reports(final PageParameters parameters) {
    super(parameters);

    body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));

    WebMarkupContainer content = new WebMarkupContainer("content");
    content.setOutputMarkupId(true);
    content.setMarkupId("reports");
    content.add(new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList()));
    body.add(content);
}
 
Example 12
Source File: UserRequests.java    From syncope with Apache License 2.0 5 votes vote down vote up
public UserRequests(final PageParameters parameters) {
    super(parameters);

    body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));

    WebMarkupContainer content = new WebMarkupContainer("content");
    content.setOutputMarkupId(true);
    content.setMarkupId("userRequests");
    content.add(new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList()));
    body.add(content);
}
 
Example 13
Source File: DashboardColumnPanel.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
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 14
Source File: PivotAreaPanel.java    From nextreports-server with Apache License 2.0 4 votes vote down vote up
public PivotAreaPanel(String id, PivotField.Area area) {
		super(id);

		this.area = area;
		
		add(new Label("name", getString("pivot." + area.getName()).toUpperCase()));

		final ModalWindow modal = new ModalWindow("modal");
		modal.setTitle(getString("pivot.aggregator"));		
		add(modal);
		
		WebMarkupContainer fieldsContainer = new WebMarkupContainer("fieldsContainer");
		fieldsContainer.setOutputMarkupId(true);
		fieldsContainer.setMarkupId("area-" + area.getName() + "-" + getSession().nextSequenceValue());
		add(fieldsContainer);
		
		values = new ListView<PivotField>("values") {

			private static final long serialVersionUID = 1L;

			@Override
			protected void populateItem(ListItem<PivotField> item) {
				final IModel<PivotField> itemModel = item.getModel();
				PivotField pivotField = itemModel.getObject();
				String title = pivotField.getTitle();
				if (pivotField.getArea().equals(PivotField.Area.DATA)) {
					title += " (" + pivotField.getAggregator().getFunction().toUpperCase() + ")"; 
				}
				Label valueLabel = new Label("value", title);
				if (pivotField.isNumber()) {
					valueLabel.add(AttributeModifier.append("class", "aggregator"));
//				} else {
//					valueLabel.add(AttributeModifier.append("class", "label-important"));
				}
				if (item.getModelObject().getArea().equals(PivotField.Area.DATA)) {
					valueLabel.add(new AjaxEventBehavior("onclick") {
	
						private static final long serialVersionUID = 1L;
	
						protected void onEvent(AjaxRequestTarget target) {
							final AggregatorPanel panel = new AggregatorPanel(modal.getContentId(), itemModel);
							modal.setUseInitialHeight(false);
							modal.setInitialWidth(200);							
							modal.setContent(panel);							
							/*
							modal.setWindowClosedCallback(new WindowClosedCallback() {
								
								private static final long serialVersionUID = 1L;

								public void onClose(AjaxRequestTarget target) {
									if (panel.isOkPressed()) {
										System.out.println(">>> " + itemModel.getObject().getAggregator());
									}
								}
								
							});
							*/
							modal.show(target);
						}
						
					});
					valueLabel.add(AttributeModifier.append("style", "cursor: pointer;"));
				}
				item.add(valueLabel);				
				item.setOutputMarkupId(true);
				item.setMarkupId("field-" + pivotField.getIndex());
			}
		};
		values.setOutputMarkupPlaceholderTag(true);
		fieldsContainer.add(values);

		// add dnd support
//		addSortableBehavior();
		
		setOutputMarkupId(true);
	}