List of usage examples for org.apache.wicket.extensions.ajax.markup.html.modal ModalWindow setCloseButtonCallback
public ModalWindow setCloseButtonCallback(final CloseButtonCallback callback)
CloseButtonCallback
instance. From source file:org.devgateway.eudevfin.projects.module.components.tabs.TransactionsTab.java
private ModalWindow AddModalWindow(PageParameters parameters) { final ModalWindow modal = new ModalWindow("modal"); modal.setCookieName("modal-1"); final PageParameters myParams = parameters; modal.setPageCreator(new ModalWindow.PageCreator() { @Override//from w ww. j av a 2 s . c o m public org.apache.wicket.Page createPage() { //ResultsTab.this.getPage().getPageReference() return new TransactionsTableModal(myParams, TransactionsTab.this.getPage().getPageReference(), modal); } }); modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { public void onClose(AjaxRequestTarget target) { TransactionTableListPanel newComp = new TransactionTableListPanel(WICKETID_LIST_PANEL, new ProjectTransactionsListGenerator(NewProjectPage.project.getProjectTransactions())); newComp.add(new AttributeAppender("class", "budget-table")); replace(newComp); target.add(newComp); } }); modal.setCloseButtonCallback(new ModalWindow.CloseButtonCallback() { public boolean onCloseButtonClicked(AjaxRequestTarget target) { // Change the passValue variable when modal window is closed. //setPassValue("Modal window is closed by user."); return true; } }); return modal; }
From source file:org.jnotary.service.web.CRLPanel.java
License:Open Source License
private ModalWindow createModalWindow(final String windowName, final Long crlUrlId) { final ModalWindow modalWindow = new ModalWindow(windowName); modalWindow.setCookieName(windowName); modalWindow.setPageCreator(new ModalWindow.PageCreator() { private static final long serialVersionUID = 1L; public Page createPage() { return new AddEditCrlUrlPage(crlUrlId, modalWindow); }//from w w w.j a va 2 s . c o m }); modalWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { private static final long serialVersionUID = 1L; public void onClose(AjaxRequestTarget target) { wmc.setOutputMarkupId(true); initListData(); target.add(wmc); } }); modalWindow.setCloseButtonCallback(new ModalWindow.CloseButtonCallback() { private static final long serialVersionUID = 1L; public boolean onCloseButtonClicked(AjaxRequestTarget target) { return true; } }); return modalWindow; }
From source file:org.obiba.onyx.quartz.core.wicket.layout.impl.simplified.QuestionCategoryOpenAnswerDefinitionPanel.java
License:Open Source License
private ModalWindow createPadModalWindow(String padId) { ModalWindow newPadWindow = new ModalWindow(padId); DataType type = getOpenAnswerDefinition().getDataType(); if (type.equals(DataType.INTEGER) || type.equals(DataType.DECIMAL)) { pad = new NumericPad(newPadWindow.getContentId(), getQuestionModel(), getQuestionCategoryModel(), getOpenAnswerDefinitionModel()) { /**// ww w.j a va 2 s . c om * */ private static final long serialVersionUID = 1L; @Override public boolean isRequired() { // is never required because in a array the pad allows deselecting the category when setting a null value return false; } }; newPadWindow.setTitle(new StringResourceModel("NumericPadTitle", pad, null)); newPadWindow.setContent(pad); newPadWindow.setCssClassName("onyx"); newPadWindow.setInitialWidth(288); newPadWindow.setInitialHeight(365); newPadWindow.setResizable(false); // same as cancel newPadWindow.setCloseButtonCallback(new ModalWindow.CloseButtonCallback() { private static final long serialVersionUID = 1L; public boolean onCloseButtonClicked(AjaxRequestTarget target) { return true; } }); return newPadWindow; } throw new UnsupportedOperationException("Pad for type " + type + " not supported yet."); }
From source file:org.obiba.onyx.webapp.participant.panel.CommentsModalPanel.java
License:Open Source License
public CommentsModalPanel(String id, final ModalWindow commentsWindow, String stage) { super(id);/*from ww w. ja v a 2 s . co m*/ this.commentsWindow = commentsWindow; commentList = activeInterviewService.getInterviewComments(); this.stageName = stage; filterOut(); setOutputMarkupId(true); add(new ParticipantPanel("participant", new DetachableEntityModel(queryService, activeInterviewService.getParticipant()), true)); add(new CommentForm("commentForm")); add(feedback = new FeedbackWindow("feedback")); feedback.setOutputMarkupId(true); // The WebMarkupContainer is needed to allow the DataView update through Ajax. The DataView cannot be update // directly. add(previousComments = new WebMarkupContainer("previousComments")); previousComments.add(new CommentsDataView("comment-list", new CommentsDataProvider())); previousComments.setOutputMarkupId(true); // No comment message is only visible when there is no comment for the current interview. previousComments.add(new Label("noComments", new StringResourceModel("NoComments", this, null)) { private static final long serialVersionUID = 1L; @Override public boolean isVisible() { if (commentList.size() == 0) { return true; } return false; } }); commentsWindow.setCloseButtonCallback(new ModalWindow.CloseButtonCallback() { private static final long serialVersionUID = 1L; public boolean onCloseButtonClicked(AjaxRequestTarget target) { return true; } }); }