THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
Note: this code has not been tested. It is only intended to show the concepts. SearchPage extends WebPage { String criteria; List results; //getters and setters public SearchPage() { ListView view = new ListView ( "list", new PropertyModel(this, "results")) { protected void populateItem( ListItem item ) { String result = (String) item.getModelObject(); item.add( new Label( "item", result ) ); } }; Form form = new SearchForm(....); form.add( new TextField( "idtextField", new PropertyModel(this, "criteria" ) ); form.add ( new Button("button") { public void onSubmit() { results = getResultsFromCriteria(criteria); } } ); } } |
...