本文整理匯總了Java中org.apache.wicket.markup.html.form.Form類的典型用法代碼示例。如果您正苦於以下問題:Java Form類的具體用法?Java Form怎麽用?Java Form使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Form類屬於org.apache.wicket.markup.html.form包,在下文中一共展示了Form類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addUrlForm
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private void addUrlForm() {
urlForm = new Form<SeedUrl>("urlForm", CompoundPropertyModel.of(Model
.of(new SeedUrl())));
urlForm.setOutputMarkupId(true);
urlForm.add(new TextField<String>("url"));
urlForm.add(new AjaxSubmitLink("addUrl", urlForm) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
addSeedUrl();
urlForm.setModelObject(new SeedUrl());
target.add(urlForm);
target.add(seedUrlsTable);
}
});
add(urlForm);
}
示例2: NotificationPage
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
public NotificationPage() {
super();
// Create the modal window.
this.addNotificationModal = new AddNotificationModal("addNotificationModal", this);
this.add(this.addNotificationModal);
// add notificationList
if (((AuthenticatedSession) Session.get()).getUser() != null) {
// logged in users see their notifications
final NotificationList notificationList = new NotificationList("notificationList", this);
notificationList.setOutputMarkupId(true);
this.add(notificationList);
} else {
final Label notificationListLabel = new Label("notificationList", "Log in to check your notifications.");
notificationListLabel.setOutputMarkupId(true);
this.add(notificationListLabel);
}
this.form = new Form<Void>("form");
this.form.add(this.addAddButton());
this.form.add(this.addDeleteAllButton());
this.add(this.form);
this.addNotificationRules();
}
示例3: buildMainLayout
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private void buildMainLayout() {
this.loginForm = new WarnOnExitForm("loginForm");
this.emailInput = new TextField<String>("emailInput", Model.of(""));
this.loginForm.add(this.emailInput);
this.passwordInput = new PasswordTextField("passwordInput", Model.of(""));
this.loginForm.add(this.passwordInput);
this.addLoginButton();
this.addRegisterLink();
this.add(this.loginForm);
this.logoutForm = new Form<Object>("logoutForm");
this.addLogoutButton();
this.add(this.logoutForm);
if (((AuthenticatedSession) Session.get()).getUser() != null) {
this.loginForm.setVisible(false);
} else {
this.logoutForm.setVisible(false);
}
}
示例4: PostmanConvertPanel
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
public PostmanConvertPanel(String id) {
super(id);
setDefaultModel(new CompoundPropertyModel(this));
Form form = new Form("form") {
@Override
protected void onSubmit() {
logger.debug("text is: {}", text);
List<PostmanRequest> requests = ConvertUtils.readPostmanJson(text);
String feature = ConvertUtils.toKarateFeature(requests);
KarateSession session = service.createSession("dev", feature);
setResponsePage(new FeaturePage(session.getId()));
}
};
form.add(new TextArea("text"));
add(form);
add(new FeedbackPanel("feedback"));
text = "Paste your postman collection here.";
}
示例5: onInitialize
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
SystemSetting systemSetting = GitPlex.getInstance(ConfigManager.class).getSystemSetting();
Form<?> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
super.onSubmit();
GitPlex.getInstance(ConfigManager.class).saveSystemSetting(systemSetting);
getSession().success("System setting has been updated");
setResponsePage(SystemSettingPage.class);
}
};
form.add(BeanContext.editBean("editor", systemSetting));
add(form);
}
示例6: onInitialize
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
SecuritySetting securitySetting = GitPlex.getInstance(ConfigManager.class).getSecuritySetting();
Form<?> form = new Form<Void>("securitySetting") {
@Override
protected void onSubmit() {
super.onSubmit();
GitPlex.getInstance(ConfigManager.class).saveSecuritySetting(securitySetting);
getSession().success("Security setting has been updated");
setResponsePage(SecuritySettingPage.class);
}
};
form.add(BeanContext.editBean("editor", securitySetting));
add(form);
}
示例7: createFilterForm
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
/**
* Creates a form with an input bound to the filter model
*
* @param id component id
* @return filter form
*/
private Form createFilterForm(String id) {
final Form filterForm = new Form(id);
final TextField<String> filterField = new TextField<>("filterText",
new PropertyModel<String>(filterModel, "name"));
// make field update
filterField.add(new AjaxFormComponentUpdatingBehavior("keyup") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
//update values
target.add(valuesContainer);
}
});
filterForm.add(filterField);
return filterForm;
}
示例8: createHeader
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
protected Component createHeader(String id, final IModel<ObjectWrapper<O>> model, final Form<ObjectWrapper<O>> form) {
PrismHeaderPanel header = new PrismHeaderPanel(ID_HEADER, model) {
private static final long serialVersionUID = 1L;
@Override
protected void onButtonClick(AjaxRequestTarget target) {
addOrReplaceContainers(model, form, true);
target.add(PrismObjectPanel.this);
}
@Override
public boolean isButtonsVisible() {
return true;
}
};
return header;
}
示例9: addOrReplaceContainers
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private void addOrReplaceContainers(IModel<ObjectWrapper<O>> model, final Form form, boolean isToBeReplaced){
ListView<ContainerWrapper> containers = new ListView<ContainerWrapper>(ID_CONTAINERS,
createContainerModel(model)) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<ContainerWrapper> item) {
PrismContainerPanel containerPanel = createContainerPanel(item, form);
createMetadataPanel(model, item, containerPanel);
}
};
containers.setReuseItems(true);
if (isToBeReplaced) {
replace(containers);
} else {
add(containers);
}
}
示例10: buildSaveButton
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private Component buildSaveButton() {
final Component button = new SingularButton("save-btn", getFormInstance()) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
super.onSubmit(target, form);
try {
saveForm(getFormInstance());
addToastrSuccessMessage("message.success");
atualizarContentWorklist(target);
} catch (HibernateOptimisticLockingFailureException e) {
getLogger().debug(e.getMessage(), e);
addToastrErrorMessage("message.save.concurrent_error");
}
}
};
return button.add(visibleOnlyInEditionBehaviour());
}
示例11: updateConfigurationTabs
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private void updateConfigurationTabs() {
final com.evolveum.midpoint.web.component.form.Form form = getForm();
TabbedPanel<ITab> tabbedPanel = getConfigurationTabbedPanel();
List<ITab> tabs = tabbedPanel.getTabs().getObject();
tabs.clear();
List<ContainerWrapper> wrappers = configurationPropertiesModel.getObject();
for (final ContainerWrapper wrapper : wrappers) {
String tabName = getString(wrapper.getDisplayName(), null, wrapper.getDisplayName());
tabs.add(new AbstractTab(new Model<>(tabName)) {
@Override
public WebMarkupContainer getPanel(String panelId) {
return new PrismContainerPanel(panelId, new Model<>(wrapper), true, form, parentPage);
}
});
}
int i = tabbedPanel.getSelectedTab();
if (i < 0 || i > tabs.size()) {
i = 0;
}
tabbedPanel.setSelectedTab(i);
}
示例12: RepeatPatternOperatorRangePanel
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
public RepeatPatternOperatorRangePanel(final String id, final PatternOperatorElement element, final AdvancedTransformationRuleEditorPanel panel) {
super(id);
this.layoutForm = new Form<Void>("layoutForm");
final RangeElement rangeElement = element.getRangeElement();
this.matchCount = rangeElement.getLeftEndpoint();
this.matchCountInput = new TextField<Integer>("matchCountInput", new PropertyModel<Integer>(this, "matchCount"));
final OnChangeAjaxBehavior onChangeAjaxBehavior = new OnChangeAjaxBehavior() {
private static final long serialVersionUID = 2251803290291534439L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
rangeElement.setLeftEndpoint(RepeatPatternOperatorRangePanel.this.matchCount);
target.add(panel.getAttributeTreePanel().getAttributeTreeTable());
}
};
this.matchCountInput.add(onChangeAjaxBehavior);
this.matchCountInput.setOutputMarkupId(true);
this.layoutForm.add(this.matchCountInput);
this.add(this.layoutForm);
}
示例13: addEventsCheckBoxMultipleChoice
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private void addEventsCheckBoxMultipleChoice(final Form<Void> layoutForm) {
this.eventsCheckBoxMultipleChoice = new CheckBoxMultipleChoice<ReplayFileBean>("eventsCheckBoxMultipleChoice", new PropertyModel<List<ReplayFileBean>>(this, "selectedFiles"), beans);
this.eventsCheckBoxMultipleChoice.setOutputMarkupId(true);
layoutForm.add(this.eventsCheckBoxMultipleChoice);
// this.eventsCheckGroup = new
// CheckGroup<ReplayFileBean>("eventsCheckGroup",
// new PropertyModel<List<ReplayFileBean>>(this, "selectedFiles"));
// this.eventsCheckGroup.add(new CheckGroupSelector("groupSelector"));
//
// ListView<ReplayFileBean> files = new
// ListView<ReplayFileBean>("beans", beans) {
// @Override
// protected void populateItem(ListItem<ReplayFileBean> item) {
// item.add(new Label("name", item.getModelObject().toString()));
// }
// };
// files.setReuseItems(true);
// this.eventsCheckGroup.add(files);
// this.eventsCheckGroup.setOutputMarkupId(true);
// layoutForm.add(this.eventsCheckGroup);
}
示例14: addDeleteAllButton
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private Component addDeleteAllButton() {
this.deleteAllButton = new BlockingAjaxButton("deleteAllNotificationsButton", this.form) {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit(final AjaxRequestTarget target, final Form form) {
super.onSubmit(target, form);
final List<NotificationRule> rules = new ArrayList<NotificationRule>(NotificationPage.this.notificationRulesListView.notificationRuleProvider.getEntities());
for (final NotificationRule rule : rules) {
rule.remove();
NotificationPage.this.notificationRulesListView.notificationRuleProvider.removeItem(rule);
NotificationPage.this.notificationRulesListView.notificationRuleTable.detach();
target.add(NotificationPage.this.notificationRulesListView.notificationRuleTable);
}
}
};
this.deleteAllButton.setOutputMarkupId(true);
return this.deleteAllButton;
}
示例15: initLayout
import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private void initLayout() {
Form mainForm = new Form("mainForm");
mainForm.setMultiPart(true);
add(mainForm);
WebMarkupContainer protectedMessage = new WebMarkupContainer(ID_PROTECTED_MESSAGE);
protectedMessage.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
ObjectWrapper wrapper = accountModel.getObject();
return wrapper.isProtectedAccount();
}
});
mainForm.add(protectedMessage);
PrismObjectPanel<ShadowType> userForm = new PrismObjectPanel<ShadowType>("account", accountModel, new PackageResourceReference(
ImgResources.class, ImgResources.HDD_PRISM), mainForm, this);
mainForm.add(userForm);
initButtons(mainForm);
}