本文整理汇总了Java中org.apache.wicket.ajax.markup.html.form.AjaxButton类的典型用法代码示例。如果您正苦于以下问题:Java AjaxButton类的具体用法?Java AjaxButton怎么用?Java AjaxButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AjaxButton类属于org.apache.wicket.ajax.markup.html.form包,在下文中一共展示了AjaxButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onInitialize
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
add(new AjaxButton("runAllJobs") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
try {
adminFacade.runAllJobs();
new SingularToastrHelper(this).
addToastrMessage(ToastrType.SUCCESS, "All jobs runned!");
} catch (SchedulerException e) {
getLogger().error(e.getMessage(), e);
}
}
});
}
示例2: construirCloseModal
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
protected BSModalBorder construirCloseModal() {
BSModalBorder closeModal = new BSModalBorder("close-modal", getMessage("label.title.close.draft"));
closeModal.addButton(BSModalBorder.ButtonStyle.CANCEL, "label.button.cancel", new AjaxButton("cancel-close-btn") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
closeModal.hide(target);
}
});
closeModal.addButton(BSModalBorder.ButtonStyle.CONFIRM, "label.button.confirm", new AjaxButton("close-btn") {
@Override
protected String getOnClickScript() {
return " Singular.atualizarContentWorklist();"
+ "window.close();";
}
});
return closeModal;
}
示例3: appendViewNotificationsButton
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
private void appendViewNotificationsButton(final BSContainer<?> container) {
final String markup =
button("notificacoes", new HTMLParameters().add("type", "button").add("class", "btn"),
span("notificacoesLabel"), span("notificacoesBadge", new HTMLParameters().add("class", "badge").add("style", "margin-left:5px;top:-2px;"))
);
final TemplatePanel buttonPanel = container.newTemplateTag(tt -> markup);
final AjaxButton viewButton = new AjaxButton("notificacoes") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
super.onSubmit(target, form);
notificacoesModal.show(target);
}
};
viewButton.add(new Label("notificacoesLabel", "Visualizar Notificações"));
viewButton.add($b.visibleIf(() -> !getNotificacoes().getObject().isEmpty()));
viewButton.add(new Label("notificacoesBadge", $m.get(() -> getNotificacoes().getObject().size())));
buttonPanel.add(viewButton);
}
示例4: addExportButton
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
/**
* Add a button for exporting the dependencies of the given event type.
*/
private void addExportButton() {
final AjaxButton exportButton = new AjaxButton("exportButton") {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit(final AjaxRequestTarget target, final Form form) {
final AJAXDownload jsonDownload = new AJAXDownload() {
@Override
protected IResourceStream getResourceStream() {
final File csv = JsonExporter.generateExportFileWithDependencies(selectedEventType);
return new FileResourceStream(new org.apache.wicket.util.file.File(csv));
}
@Override
protected String getFileName() {
return selectedEventType.getTypeName() + "-dependencies.json";
}
};
ExportImportDependenciesPanel.this.add(jsonDownload);
jsonDownload.initiate(target);
ExportImportDependenciesPanel.this.page.getFeedbackPanel().success("Json created.");
target.add(ExportImportDependenciesPanel.this.page.getFeedbackPanel());
}
};
exportForm.add(exportButton);
}
示例5: buildUseExternalKnowledgeButton
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
private void buildUseExternalKnowledgeButton() {
final AjaxButton useExternalKnowledgeButton = new AjaxButton("useExternalKnowledgeButton", this.layoutForm) {
private static final long serialVersionUID = -2611608162033482853L;
@Override
public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
final ExternalKnowledgeModal modal = AttributeSelectionPanel.this.patternBuilderPanel.getAdvancedRuleEditorPanel().getTransformationPage().getExternalKnowledgeModal();
modal.getPanel().setAttributeIdentifiersAndExpressions(AttributeSelectionPanel.this.attributeIdentifiersAndExpressions);
modal.getPanel().setAttributeIdentifiersWithExternalKnowledge(AttributeSelectionPanel.this.attributeIdentifiersWithExternalKnowledge);
modal.getPanel().setPatternTree(AttributeSelectionPanel.this.patternBuilderPanel.getPatternTree());
modal.getPanel().setAttributeToFill(AttributeSelectionPanel.this.attributeToFill);
modal.getPanel().setParentPanel(AttributeSelectionPanel.this.panel);
modal.getPanel().detach();
modal.getPanel().update(target);
target.add(modal.getPanel());
modal.show(target);
// eventRepository.getEventViewModal().getPanel().setEvent(rowModel.getObject());
// eventRepository.getEventViewModal().getPanel().detach();
// target.add(eventRepository.getEventViewModal().getPanel());
// eventRepository.getEventViewModal().show(target);
}
};
this.layoutForm.add(useExternalKnowledgeButton);
}
示例6: buildAddFilterExpressionButton
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
private void buildAddFilterExpressionButton() {
final AjaxButton addFilterExpressionButton = new AjaxButton("addFilterExpressionButton", this.layoutForm) {
private static final long serialVersionUID = -2611608162033482853L;
@Override
public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
final FilterExpressionElement newFilterExpressionElement = new FilterExpressionElement(((TreeTableProvider<Serializable>) EventTypeElementOptionsPanel.this.table.getProvider()).getNextID(), FilterExpressionOperatorEnum.EQUALS);
newFilterExpressionElement.setParent(EventTypeElementOptionsPanel.this.element);
EventTypeElementOptionsPanel.this.tree.addElement(newFilterExpressionElement);
EventTypeElementOptionsPanel.this.provider.setRootElements(EventTypeElementOptionsPanel.this.tree.getRoots());
EventTypeElementOptionsPanel.this.table.getSelectedElements().clear();
target.add(EventTypeElementOptionsPanel.this.table);
EventTypeElementOptionsPanel.this.panel.updateOnTreeElementSelection(target);
}
};
this.layoutForm.add(addFilterExpressionButton);
}
示例7: buildHeader
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
private void buildHeader() {
final Label attributeToFillLabel = new Label("attributeToFillLabel", "Attribute: " + this.attributeToFill.getAttributeExpression() + " (" + this.attributeToFill.getType() + ")");
this.layoutForm.addOrReplace(attributeToFillLabel);
final AjaxButton addCriteriaAttributesAndValuesButton = new AjaxButton("addCriteriaAttributesAndValuesButton", this.layoutForm) {
private static final long serialVersionUID = 6456362459418575615L;
@Override
public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
ExternalKnowledgePanel.this.coalesceExpressions.add(new ExternalKnowledgeExpression());
ExternalKnowledgePanel.this.criteriaAttributesAndValuesListView.setList(ExternalKnowledgePanel.this.coalesceExpressions);
target.add(ExternalKnowledgePanel.this.container);
}
};
this.layoutForm.addOrReplace(addCriteriaAttributesAndValuesButton);
}
示例8: LoginForm
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
public LoginForm(String markupId) {
super(markupId);
this.setDefaultModel(new CompoundPropertyModel<Object>(this));
this.add(new TextField("username").setRequired(true));
this.add(new PasswordTextField("password").setRequired(true));
Button submitBtn = new AjaxButton("loginBtn", Model.of("Sign In")) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
if (AuthenticatedWebSession.get().signIn(username, password))
setResponsePage(DiscoverItemsPage.class);
else {
target.add(ComponentUtils.displayBlock(alert));
}
}
};
this.add(submitBtn);
this.setDefaultButton(submitBtn);
}
示例9: addBackButton
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
public void addBackButton(final AjaxAction ajaxAction) {
addLeftButton(new AjaxButton(newButtonId(), Model.of("Back")) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
ajaxAction.invoke(target);
}
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.setChannel(new AjaxChannel("PopupButton", AjaxChannel.Type.ACTIVE));
};
}.setDefaultFormProcessing(false));
}
示例10: addCloseButton
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
public void addCloseButton(IModel<String> label) {
addButton(new AjaxButton(newButtonId(), label) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
hide(target);
}
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.setChannel(new AjaxChannel("PopupButton", AjaxChannel.Type.ACTIVE));
};
}.setDefaultFormProcessing(false));
}
示例11: addRow
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
private WebMarkupContainer addRow(final RepeatingView rows, Serializable element) {
final WebMarkupContainer row = new WebMarkupContainer(rows.newChildId());
row.setOutputMarkupId(true);
rows.add(row);
RepeatingView columns = new RepeatingView("properties");
row.add(columns);
for (PropertyContext<Serializable> propertyContext: propertyContexts) {
WebMarkupContainer column = new WebMarkupContainer(columns.newChildId());
column.add(AttributeAppender.append("class", " " + propertyContext.getPropertyName()));
columns.add(column);
Serializable propertyValue = (Serializable) propertyContext.getPropertyValue(element);
PropertyEditor<?> propertyEditor = propertyContext.renderForEdit("propertyEditor", Model.of(propertyValue));
column.add(propertyEditor);
column.add(new FencedFeedbackPanel("feedback", propertyEditor));
}
row.add(new AjaxButton("deleteElement") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
super.onSubmit(target, form);
target.appendJavaScript($(row).chain("remove").get());
rows.remove(row);
if (rows.size() == 0) {
WebMarkupContainer table = (WebMarkupContainer) ConcreteListPropertyEditor.this.get("listEditor");
target.add(table.get("noElementsRow"));
}
send(ConcreteListPropertyEditor.this, Broadcast.BUBBLE, new EditorChanged(target));
}
}.setDefaultFormProcessing(false));
return row;
}
示例12: onInitialize
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
add(new AjaxButton("clearAllCaches") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
adminFacade.clearCaches();
new SingularToastrHelper(this).
addToastrMessage(ToastrType.SUCCESS, "Caches cleaned!");
}
});
}
示例13: addCloseButton
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
private void addCloseButton(BSModalBorder modal) {
modal.addButton(
BSModalBorder.ButtonStyle.CANCEL,
Model.of("Fechar"),
new AjaxButton("cancel-btn") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
modal.hide(target);
}
}.setDefaultFormProcessing(false)
);
}
示例14: addDefaultCancelButton
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
protected void addDefaultCancelButton(final BSModalBorder modal) {
modal.addButton(
BSModalBorder.ButtonStyle.CANCEL,
"label.button.cancel",
new AjaxButton("cancel-btn") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
modal.hide(target);
}
}
);
}
示例15: buildNotificacoesModal
import org.apache.wicket.ajax.markup.html.form.AjaxButton; //导入依赖的package包/类
private Component buildNotificacoesModal(String id) {
final String modalPanelMarkup = div("modal-panel", null, div("list-view", null, div("notificacao")));
final TemplatePanel modalPanel = new TemplatePanel(id, modalPanelMarkup);
final ListView<Pair<String, String>> listView = new ListView<Pair<String, String>>("list-view", getNotificacoes()) {
@Override
protected void populateItem(ListItem<Pair<String, String>> item) {
item.add(new NotificationPanel("notificacao", item.getModel(), getRequirementModel()));
}
};
final AjaxButton closeButton = new AjaxButton("close-button") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
super.onSubmit(target, form);
notificacoesModal.hide(target);
}
};
notificacoesModal = new BSModalBorder("modal-panel");
notificacoesModal.setTitleText(Model.of("Notificações"));
notificacoesModal.addButton(BSModalBorder.ButtonStyle.DEFAULT, Shortcuts.$m.ofValue("Fechar"), closeButton);
notificacoesModal.setSize(BSModalBorder.Size.NORMAL);
return modalPanel.add(notificacoesModal.add(listView));
}