Some more code:

public class SearchPage extends BasePage {

        private String  name = "";

        public SearchPage(PageParameters parameters) {
                super(parameters);
                // TODO Auto-generated constructor stub
                init();
                
        }

        private void init() {
                Form form = new SearchForm("searchForm");
                getContentContainer().addOrReplace(form);       
                getContentContainer().addOrReplace(new
Label("result","").setVisible(false));
       }

        class SearchForm extends Form{
                        
                public SearchForm(String id){
                  super(id);
                  TextField Name = new TextField("search.tf.name", new
PropertyModel(SearchPage.this, "name"));

                  add(Name);    
                  Button searchButton = new Button("searchButton"){
                        @Override
                        public void onSubmit() {                                
        
                                super.onSubmit();
                                System.out.println("in searchButton");
                                SearchPage.this.updateList();
                        }                               
                  };
                  add( searchButton );
             }
                
            public void onSubmit(){                     
                        //do nothing extra                                      
        
            }


            @Override
            public boolean isVersioned() {
                return false;
            }   
        }             

ยด       public String getPageTitleKey() {
                return "searchpage.pagetitle";
        }

        
        public String getPageContextKey() {
                return "searchpage";
        }

        @Override
        public String getContentWidth() {               
                return "850px";
        }

        public String getname() {
                return name;
        }

        public void setname(String name) {
                this.name = name;
        }

}



Michael Sparer wrote:
> 
> the page reloading itself is expected behaviour as the form gets
> submitted, the onSubmit() method should however be called. if you provided
> us some more code (and the wicket version you're using)?
> 
> regards,
> Michael
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Button-onSubmit-not-called%2C-instead-page-reloads-tp22350921p22351547.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to