org.apache.wicket.ajax.markup.html.AjaxLink Java Examples
The following examples show how to use
org.apache.wicket.ajax.markup.html.AjaxLink.
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: DeleteClusterModalPanel.java From etcd-viewer with Apache License 2.0 | 6 votes |
public DeleteClusterModalPanel(String id, IModel<String> model) { super(id, model); add(name = new Label("name", getModel())); name.setOutputMarkupId(true); add(new AjaxLink<String>("delete", getModel()) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { clusterManager.removeCluster(getModelObject()); onClusterDeleted(target); modalHide(target); } }); }
Example #2
Source File: TabbedPanel.java From Orienteer with Apache License 2.0 | 6 votes |
@Override protected WebMarkupContainer newLink(String linkId, final int index) { return new AjaxLink<Void>(linkId) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { setSelectedTab(index); target.add(TabbedPanel.this); onLinkClick(target); } @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); String cssClass = tag.getAttribute("class"); if (getSelectedTab() == index) { cssClass += " active"; } else cssClass = "nav-link"; tag.put("class", cssClass.trim()); } }; }
Example #3
Source File: AjaxIconLinkPanel.java From projectforge-webapp with GNU General Public License v3.0 | 6 votes |
/** * @param id * @param type * @param tooltip */ @SuppressWarnings("serial") public AjaxIconLinkPanel(final String id, final IconType type, final IModel<String> tooltip) { super(id, type, tooltip); setLink(new AjaxLink<Void>(IconLinkPanel.LINK_ID) { /** * @see org.apache.wicket.ajax.markup.html.AjaxLink#onClick(org.apache.wicket.ajax.AjaxRequestTarget) */ @Override public void onClick(final AjaxRequestTarget target) { AjaxIconLinkPanel.this.onClick(target); } }); }
Example #4
Source File: GeneralErrorPage.java From onedev with MIT License | 6 votes |
@Override protected void onInitialize() { super.onInitialize(); WebMarkupContainer container = new WebMarkupContainer("error"); container.setOutputMarkupId(true); add(container); container.add(new Label("title", StringUtils.abbreviate(title, MAX_TITLE_LEN))); container.add(new ViewStateAwarePageLink<Void>("home", ProjectListPage.class)); container.add(new AjaxLink<Void>("showDetail") { @Override public void onClick(AjaxRequestTarget target) { Fragment fragment = new Fragment("detail", "detailFrag", GeneralErrorPage.this); fragment.add(new MultilineLabel("body", detailMessage)); container.replace(fragment); target.add(container); setVisible(false); } }); container.add(new WebMarkupContainer("detail")); }
Example #5
Source File: ScriptEditPage.java From projectforge-webapp with GNU General Public License v3.0 | 6 votes |
@SuppressWarnings("serial") public ScriptEditPage(final PageParameters parameters) { super(parameters, "scripting"); init(); if (StringUtils.isNotEmpty(form.getData().getScriptBackupAsString()) == true) { // Show backup script button: final AjaxLink<Void> showBackupScriptButton = new AjaxLink<Void>(ContentMenuEntryPanel.LINK_ID) { @Override public void onClick(final AjaxRequestTarget target) { form.showBackupScriptDialog.open(target); } }; final ContentMenuEntryPanel menu = new ContentMenuEntryPanel(getNewContentMenuChildId(), showBackupScriptButton, getString("scripting.scriptBackup.show")); addContentMenuEntry(menu); } }
Example #6
Source File: WidgetPopupMenuModel.java From nextreports-server with Apache License 2.0 | 6 votes |
private AjaxLink createEmbedCodeLink(final IModel<Widget> model) { AjaxLink<Void> link = new AjaxLink<Void>(MenuPanel.LINK_ID) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { final Widget widget = model.getObject(); ModalWindow dialog = findParent(BasePage.class).getDialog(); dialog.setTitle(new StringResourceModel("WidgetPopupMenu.embeddedCode", null).getString()); dialog.setInitialWidth(550); dialog.setUseInitialHeight(false); dialog.setContent(new WidgetEmbedCodePanel(dialog.getContentId(), widget.getId())); dialog.show(target); } }; return link; }
Example #7
Source File: AnalysisRuntimePanel.java From nextreports-server with Apache License 2.0 | 6 votes |
public AnalysisRuntimePanel(String id, ReportRuntimeModel model) { super(id); Label label = new Label("analysisLabel", getString("Analysis.run.name")); add(label); TextField<String> analysisText = new TextField<String>("analysisText", new PropertyModel(model, "analysisName")); add(analysisText); AjaxLink analysisLink = new AjaxLink("analysisLink") { @Override public void onClick(AjaxRequestTarget target) { // TODO Auto-generated method stub } }; add(analysisLink); }
Example #8
Source File: SideInfoPanel.java From onedev with MIT License | 6 votes |
@Override protected void onInitialize() { super.onInitialize(); add(newContent("content")); add(new AjaxLink<Void>("close") { @Override public void onClick(AjaxRequestTarget target) { String script = String.format("$('#%s').hide('slide', {direction: 'right', duration: 200});", SideInfoPanel.this.getMarkupId()); target.appendJavaScript(script); send(getPage(), Broadcast.BREADTH, new SideInfoClosed(target)); } }); add(AttributeAppender.append("class", "side-info closed")); }
Example #9
Source File: AjaxActionTab.java From onedev with MIT License | 6 votes |
@Override public Component render(String componentId) { return new ActionTabLink(componentId, this) { @Override protected WebMarkupContainer newLink(String id, ActionTab tab) { return new AjaxLink<Void>("link") { @Override protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { super.updateAjaxAttributes(attributes); AjaxActionTab.this.updateAjaxAttributes(attributes); } @Override public void onClick(AjaxRequestTarget target) { selectTab(this); } }; } }; }
Example #10
Source File: InvitationDetails.java From openmeetings with Apache License 2.0 | 6 votes |
@Override protected void onInitialize() { super.onInitialize(); add(new Label("id")); add(valid); add(invitee); add(from); add(to); // add a cancel button that can be used to submit the form via ajax delBtn = new AjaxLink<>("ajax-cancel-button") { private static final long serialVersionUID = 1L; public void onClick(AjaxRequestTarget target) { inviteDao.delete(InvitationDetails.this.getModelObject(), getUserId()); InvitationDetails.this.setModelObject(new Invitation()); target.add(list, InvitationDetails.this); } }; delBtn.add(newOkCancelDangerConfirm(this, getString("833"))); add(delBtn.setOutputMarkupId(true).setEnabled(false)); }
Example #11
Source File: CodeCommentPanel.java From onedev with MIT License | 6 votes |
private WebMarkupContainer newAddReplyContainer() { WebMarkupContainer addReplyContainer = new Fragment("addReply", "addReplyFrag", this) { @Override protected void onConfigure() { super.onConfigure(); setVisible(SecurityUtils.getUser() != null); } }; addReplyContainer.setOutputMarkupId(true); addReplyContainer.add(new AjaxLink<Void>("reply") { @Override public void onClick(AjaxRequestTarget target) { onAddReply(target); } }); return addReplyContainer; }
Example #12
Source File: AnalysisPanel.java From nextreports-server with Apache License 2.0 | 6 votes |
private AjaxLink<Analysis> getPaginateLink() { return new ToolbarLink<Analysis>("paginate", "PaginatePanel.title", 200) { @Override protected FormContentPanel<Analysis> createPanel() { return new PaginatePanel(AnalysisPanel.this.getModel()) { private static final long serialVersionUID = 1L; @Override public void onOk(AjaxRequestTarget target) { ModalWindow.closeCurrent(target); changeDataProvider(AnalysisPanel.this.getModel(), target); } }; } }; }
Example #13
Source File: AjaxComponentFeedbackPanelTest.java From pm-wicket-utils with GNU Lesser General Public License v3.0 | 6 votes |
public TestPanel(String id) { super(id); message = null; link = new AjaxLink<String>("link") { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { Session.get().getFeedbackMessages().add(new FeedbackMessage(label, msg, 0)); target.add(TestPanel.this); } }; label = new Label("label"); }
Example #14
Source File: MultilevelPanel.java From syncope with Apache License 2.0 | 6 votes |
public MultilevelPanel(final String id) { super(id); firstLevelContainer = new WebMarkupContainer("firstLevelContainer"); firstLevelContainer.setOutputMarkupPlaceholderTag(true); firstLevelContainer.setVisible(true); add(firstLevelContainer); secondLevelContainer = new WebMarkupContainer("secondLevelContainer"); secondLevelContainer.setOutputMarkupPlaceholderTag(true); secondLevelContainer.setVisible(false); add(secondLevelContainer); secondLevelContainer.add(new AjaxLink<String>("back") { private static final long serialVersionUID = -7978723352517770644L; @Override public void onClick(final AjaxRequestTarget target) { onClickBackInternal(target); prev(target); } }); }
Example #15
Source File: AccessSpecificSettingsPanel.java From inception with Apache License 2.0 | 5 votes |
private void setUpLocalSpecificSettings(WebMarkupContainer wmc) { wmc.add(uploadForm("uploadForm", "uploadField")); // add link for clearing the knowledge base contents, enabled only, if there is // something to clear AjaxLink<Void> clearLink = clearLink("clear"); wmc.add(clearLink); wmc.add(fileExtensionsExportList("exportButtons")); List<KnowledgeBaseProfile> localKBs = knowledgeBaseProfiles.values().stream() .filter(kb -> RepositoryType.LOCAL.equals(kb.getType())) .collect(Collectors.toList()); listViewContainer = new WebMarkupContainer("listViewContainer"); ListView<KnowledgeBaseProfile> suggestions = localSuggestionsList("localKBs", localKBs); listViewContainer.add(suggestions); listViewContainer.setOutputMarkupPlaceholderTag(true); LambdaAjaxLink addKbButton = new LambdaAjaxLink("addKbButton", this::actionDownloadKbAndSetIRIs); addKbButton.add(new Label("addKbLabel", new ResourceModel("kb.wizard.steps.local.addKb"))); listViewContainer.add(addKbButton); infoContainerLocal = createKbInfoContainer("infoContainer"); infoContainerLocal.setOutputMarkupId(true); wmc.add(infoContainerLocal); wmc.add(listViewContainer); }
Example #16
Source File: ViewInfoPanel.java From nextreports-server with Apache License 2.0 | 5 votes |
public ViewInfoPanel(String id, final Chart chart, final Chart original, String versionName) { super(id, new Model<Chart>(chart)); String name = chart.getName(); if (versionName != null) { name += " (" + getString("ActionContributor.Info.version") + ": " + versionName + ")"; } add(new Label("legend", getString("ActionContributor.Info.chartInfo"))); add(new Label("entityId", getString("ActionContributor.Info.id"))); add(new Label("reportId", chart.getId())); add(new Label("entityName", getString("ActionContributor.Info.entityName"))); add(new Label("reportName", name)); add(new Label("descLabel", getString("ActionContributor.Info.description"))); add(new TextArea<String>("description", new Model<String>(chart.getDescription()))); addParametersTable(chart); String sql = ReportUtil.getSql(NextUtil.getNextReport(settings.getSettings(), chart)); add(new MultiLineLabel("sql", new Model<String>(sql))); add(new AjaxLink<Void>("cancel") { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { EntityBrowserPanel panel = findParent(EntityBrowserPanel.class); panel.backwardWorkspace(target); } }); }
Example #17
Source File: LocationPanel.java From nextreports-server with Apache License 2.0 | 5 votes |
public LocationPanel(String id, final String sectionId) { super(id); this.sectionId = sectionId; add(new ListView<String>("location", new LocationModel()) { private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem<String> item) { final String path = item.getModelObject(); AjaxLink<String> link = new AjaxLink<String>("link", new Model<String>(path)) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { Entity entity; try { entity = storageService.getEntity(path); } catch (NotFoundException e) { entity = getRoot(); } onEntityClicked(entity, target); } }; link.add(new Label("text", StorageUtil.getName(path))); item.add(link); if (SectionContextUtil.getCurrentPath(sectionId).equals(path)) { // is last item.add(AttributeAppender.append("class", "bread-current")); } } }); add(new Label("lookFor", new LookForModel())); }
Example #18
Source File: ViewInfoPanel.java From nextreports-server with Apache License 2.0 | 5 votes |
public ViewInfoPanel(String id, final Report report, final Report original, String versionName) { super(id, new Model<Report>(report)); String name = report.getName(); if (versionName != null) { name += " (" + getString("ActionContributor.Info.version") + ": " + versionName + ")"; } add(new Label("legend", getString("ActionContributor.Info.reportInfo"))); add(new Label("entityId", getString("ActionContributor.Info.id"))); add(new Label("reportId", report.getId())); add(new Label("entityName", getString("ActionContributor.Info.entityName"))); add(new Label("reportName", name)); add(new Label("descLabel", getString("ActionContributor.Info.description"))); add(new TextArea<String>("description", new Model<String>(report.getDescription()))); addParametersTable(report); String sql = "NA"; if (ReportConstants.NEXT.equals(report.getType())) { sql = ReportUtil.getSql(NextUtil.getNextReport(settings.getSettings(), report)); } else if (ReportConstants.JASPER.equals(report.getType())) { sql = JasperReportsUtil.getMasterQuery(report); } add(new MultiLineLabel("sql", new Model<String>(sql))); add(new AjaxLink<Void>("cancel") { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { EntityBrowserPanel panel = findParent(EntityBrowserPanel.class); panel.backwardWorkspace(target); } }); }
Example #19
Source File: FormPanel.java From nextreports-server with Apache License 2.0 | 5 votes |
private AjaxLink<Void> createCancelButton() { return new AjaxLink<Void>("cancel") { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { onCancel(target); } }; }
Example #20
Source File: ErrorPanel.java From nextreports-server with Apache License 2.0 | 5 votes |
public ErrorPanel(String id, String message) { super(id); add(new Label("message", "Error: " + message)); add(new AjaxLink<Void>("cancel") { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { back(target); } }); }
Example #21
Source File: ItemTransformerWidget.java From syncope with Apache License 2.0 | 5 votes |
@Override protected AbstractLink getEventsLink(final String linkid) { return new AjaxLink<String>(linkid) { private static final long serialVersionUID = -7978723352517770644L; @Override public void onClick(final AjaxRequestTarget target) { transformers.setItem(target, ItemTransformerWidget.this.item); transformers.toggle(target, true); } }; }
Example #22
Source File: UnregistredPropertyEditPanel.java From Orienteer with Apache License 2.0 | 5 votes |
protected Component makeRealizeButton() { return new AjaxLink<OProperty>("realize") { @Override public void onClick(AjaxRequestTarget target) { setResponsePage(new OPropertyPage(UnregistredPropertyEditPanel.this.getModel()).setModeObject(DisplayMode.EDIT)); } }; }
Example #23
Source File: RestorePasswordPanel.java From Orienteer with Apache License 2.0 | 5 votes |
private AjaxLink<Void> createLoginLink(String id) { return new AjaxLink<Void>(id) { @Override public void onClick(AjaxRequestTarget target) { emailModel.setObject(null); send(getParent(), Broadcast.BUBBLE, new RestorePasswordEventPayload(target, false)); } }; }
Example #24
Source File: OUsersLoginButtonsPanel.java From Orienteer with Apache License 2.0 | 5 votes |
private AjaxLink<Void> createForgotPasswordLink(String id) { return new AjaxLink<Void>(id) { @Override public void onClick(AjaxRequestTarget target) { send(this, Broadcast.BUBBLE, new RestorePasswordEventPayload(target, true)); } @Override protected void onConfigure() { super.onConfigure(); setVisible(OrienteerUserModuleRepository.isRestorePassword()); } }; }
Example #25
Source File: ShoppingEditBulkPage.java From sakai with Educational Community License v2.0 | 5 votes |
public LinkPanel(String id, final IModel labelModel) { super(id); AjaxLink link = new AjaxLink("link") { @Override public void onClick(AjaxRequestTarget target) { clicked(target); } }; link.add(new Label("linkLabel", labelModel)); add(link); }
Example #26
Source File: BaseTreePage.java From sakai with Educational Community License v2.0 | 5 votes |
protected AjaxLink getExpandCollapseLink(){ //Expand Collapse Link: final Label expandCollapse = new Label("expandCollapse", new StringResourceModel("exapndNodes", null)); expandCollapse.setOutputMarkupId(true); AjaxLink expandLink = new AjaxLink("expandAll") { boolean expand = true; @Override public void onClick(AjaxRequestTarget target) { if(expand){ getTree().getTreeState().expandAll(); expandCollapse.setDefaultModel(new StringResourceModel("collapseNodes", null)); collapseEmptyFolders(); }else{ getTree().getTreeState().collapseAll(); expandCollapse.setDefaultModel(new StringResourceModel("exapndNodes", null)); } target.add(expandCollapse); getTree().updateTree(target); expand = !expand; } @Override public boolean isVisible() { return getTree().getDefaultModelObject() != null; } }; expandLink.add(expandCollapse); return expandLink; }
Example #27
Source File: SCIMConfPanel.java From syncope with Apache License 2.0 | 5 votes |
public SCIMConfPanel( final String id, final SCIMConf scimConfTO, final PageReference pageRef) { super(id, true); this.scimConfTO = scimConfTO; this.pageRef = pageRef; setPageRef(pageRef); AjaxBootstrapTabbedPanel<ITab> tabbedPanel = new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList()); tabbedPanel.setSelectedTab(0); addInnerObject(tabbedPanel); AjaxLink<String> saveButton = new AjaxLink<String>("saveButton") { private static final long serialVersionUID = -7978723352517770644L; @Override public void onClick(final AjaxRequestTarget target) { SCIMConfRestClient.set(SCIMConfPanel.this.scimConfTO); } }; addInnerObject(saveButton); setShowResultPage(true); modal.size(Modal.Size.Large); setWindowClosedReloadCallback(modal); }
Example #28
Source File: SRARouteDirectoryPanel.java From syncope with Apache License 2.0 | 5 votes |
public SRARouteDirectoryPanel(final String id, final PageReference pageRef) { super(id, pageRef); disableCheckBoxes(); modal.size(Modal.Size.Large); modal.addSubmitButton(); modal.setWindowClosedCallback(target -> { updateResultTable(target); modal.show(false); }); restClient = new SRARouteRestClient(); addNewItemPanelBuilder(new SRARouteWizardBuilder(new SRARouteTO(), pageRef), true); initResultTable(); utilityAjaxLink = new AjaxLink<SRARouteTO>("utility") { private static final long serialVersionUID = -7978723352517770644L; @Override public void onClick(final AjaxRequestTarget target) { try { SRARouteRestClient.push(); SyncopeConsoleSession.get().success(getString(Constants.OPERATION_SUCCEEDED)); target.add(container); } catch (Exception e) { LOG.error("While pushing to SRA", e); SyncopeConsoleSession.get().onException(e); } ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target); } }; initialFragment.addOrReplace(utilityAjaxLink); utilityAjaxLink.add(utilityIcon); utilityIcon.add(new AttributeModifier("class", "fa fa-fast-forward")); enableUtilityButton(); }
Example #29
Source File: TopologyTogglePanel.java From syncope with Apache License 2.0 | 5 votes |
private Fragment getLocationFragment(final TopologyNode node, final PageReference pageRef) { Fragment fragment = new Fragment("actions", "locationActions", this); AjaxLink<String> create = new IndicatingAjaxLink<String>("create") { private static final long serialVersionUID = 3776750333491622263L; @Override public void onClick(final AjaxRequestTarget target) { final ConnInstanceTO modelObject = new ConnInstanceTO(); modelObject.setLocation(node.getKey()); final IModel<ConnInstanceTO> model = new CompoundPropertyModel<>(modelObject); modal.setFormModel(model); target.add(modal.setContent(new ConnectorWizardBuilder(modelObject, pageRef). build(BaseModal.CONTENT_ID, AjaxWizard.Mode.CREATE))); modal.header(new Model<>(MessageFormat.format(getString("connector.new"), node.getKey()))); modal.show(true); } @Override public String getAjaxIndicatorMarkupId() { return Constants.VEIL_INDICATOR_MARKUP_ID; } }; fragment.add(create); MetaDataRoleAuthorizationStrategy.authorize(create, RENDER, IdMEntitlement.CONNECTOR_CREATE); return fragment; }
Example #30
Source File: InnerReportsPanel.java From nextreports-server with Apache License 2.0 | 5 votes |
private AjaxLink<String> createLink(String id, final IModel<InnerReport> model) { AjaxLink<String> link = new AjaxLink<String>(id) { @Override public void onClick(AjaxRequestTarget target) { click(model.getObject(), target); } }; link.add(new Label("label", getString("Section.Audit.innerReports." + model.getObject().toString()))); link.add(new Label("description", getString("Section.Audit.innerReports." + model.getObject().getDescription() + ".desc"))); link.add(AttributeModifier.append("class", "section-" + model.getObject().toString().toLowerCase())); return link; }