当前位置: 首页>>代码示例>>Java>>正文


Java StatelessForm类代码示例

本文整理汇总了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);
}
 
开发者ID:openwide-java,项目名称:artifact-listener,代码行数:26,代码来源:ProjectSearchPanel.java

示例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)));
}
 
开发者ID:UKPLab,项目名称:coling2016-marketing-blunders,代码行数:13,代码来源:HomePage.java

示例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);
}
 
开发者ID:premium-minds,项目名称:pm-wicket-archetype,代码行数:28,代码来源:LoginPage.java

示例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);
}
 
开发者ID:openwide-java,项目名称:artifact-listener,代码行数:51,代码来源:ArtifactSearchPanel.java


注:本文中的org.apache.wicket.markup.html.form.StatelessForm类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。