本文整理汇总了Java中org.apache.wicket.markup.html.form.StatelessForm类的典型用法代码示例。如果您正苦于以下问题:Java StatelessForm类的具体用法?Java StatelessForm怎么用?Java StatelessForm使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StatelessForm类属于org.apache.wicket.markup.html.form包,在下文中一共展示了StatelessForm类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ProjectSearchPanel
import org.apache.wicket.markup.html.form.StatelessForm; //导入依赖的package包/类
public ProjectSearchPanel(String id, IPageable pageable, IModel<String> searchTermModel) {
super(id);
this.pageable = pageable;
this.searchTermModel = searchTermModel;
Form<Void> form = new StatelessForm<Void>("form") {
private static final long serialVersionUID = -584576228542906811L;
@Override
protected void onSubmit() {
// Lors de la soumission d'un formulaire de recherche, on retourne sur la première page
ProjectSearchPanel.this.pageable.setCurrentPage(0);
setResponsePage(getPage().getClass(),
LinkUtils.getSearchPageParameters(ProjectSearchPanel.this.searchTermModel));
}
};
TextField<String> searchInput = new TextField<String>("searchInput", this.searchTermModel);
form.add(searchInput);
form.add(new SubmitLink("submit"));
add(form);
}
示例2: handleSearch
import org.apache.wicket.markup.html.form.StatelessForm; //导入依赖的package包/类
protected void handleSearch() {
StatelessForm<Void> form = new StatelessForm<Void>("searchForm"){
@Override
protected void onSubmit() {
PageParameters parameters = new PageParameters();
parameters.add("search", search);
setResponsePage(SearchPage.class, parameters);
}
};
form.add(new TextField<Void>("search"));
add(form.setDefaultModel(new CompoundPropertyModel<ApplicationPageBase>(this)));
}
示例3: onInitialize
import org.apache.wicket.markup.html.form.StatelessForm; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
Form<Void> form = new StatelessForm<Void>("form"){
private EmailTextField email = new EmailTextField("email", Model.of(""));
private PasswordTextField password = new PasswordTextField("password", Model.of(""));
{
add(new BootstrapFeedbackPanel("feedbackError", FeedbackMessage.ERROR));
add(email.setRequired(true));
add(password);
}
protected void onSubmit() {
if(((WebApplication)getWebApplication()).authenticate(email.getModelObject(), password.getModelObject())){
continueToOriginalDestination();
throw new RestartResponseException(getApplication().getHomePage());
} else {
error(getString("login.invalid"));
}
}
};
add(form);
}
示例4: ArtifactSearchPanel
import org.apache.wicket.markup.html.form.StatelessForm; //导入依赖的package包/类
public ArtifactSearchPanel(String id, final IPageable pageable, IModel<String> globalSearchModel,
IModel<String> searchGroupModel, IModel<String> searchArtifactModel) {
super(id);
this.globalSearchModel = globalSearchModel;
this.searchGroupModel = searchGroupModel;
this.searchArtifactModel = searchArtifactModel;
Form<Void> keywordSearchForm = new StatelessForm<Void>("keywordSearchForm") {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit() {
ArtifactSearchPanel.this.searchGroupModel.setObject("");
ArtifactSearchPanel.this.searchArtifactModel.setObject("");
setResponsePage(getPage().getClass(),
LinkUtils.getSearchPageParameters(ArtifactSearchPanel.this.globalSearchModel));
}
};
keywordSearchForm.add(new TextField<String>("globalSearchInput", this.globalSearchModel));
keywordSearchForm.add(new SubmitLink("submit"));
add(keywordSearchForm);
// NOTE: If this search pattern is going to be reused, it will need to pass its groupId and
// artifactId terms through the page parameters
Form<Void> advancedSearchForm = new StatelessForm<Void>("advancedSearchForm") {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit() {
// Lors de la soumission d'un formulaire de recherche, on retourne sur la première page
pageable.setCurrentPage(0);
ArtifactSearchPanel.this.globalSearchModel.setObject("");
super.onSubmit();
}
};
advancedSearchForm.add(new TextField<String>("searchGroupInput", this.searchGroupModel));
advancedSearchForm.add(new TextField<String>("searchArtifactInput", this.searchArtifactModel));
advancedSearchForm.add(new SubmitLink("submit"));
advancedSearchForm.setVisible(false);
add(advancedSearchForm);
}