I think ImageButton is the component that makes it stateful. To be sure use wicket-devutils, annotate the page with @StatelessComponent and add StatelessChecker as IComponentOnBeforeRenderListener in your application.
On Tue, Jul 12, 2011 at 2:14 PM, Mike Mander <wicket-m...@gmx.de> wrote: > Hi, > > i use a page with a border. I add a panel with a stateless form to the > border and the page gets stateful. Why? > The symtoms are - NotSerializableExceptions and RuntimeException if i click > the submit. > Form action: > ../../../../Overview.html/gdw_exact/Party/of/47/wicket:interface/:0:ambiance:search:searchSlot::IFormSubmitListener:: > > I'm definitly doing something stupid, but i can't see what. Maybe someone > can point me to a doc or something. > > Thanks > Mike > > ShopBorder.java > <code> > public class ShopBorder extends Border { > > public ShopBorder(String id) { > super(id); > add(searchSlot()); > } > > private Component searchSlot() { > return new SearchSlot("search") { > @Override > protected void setSearchterm(String searchterm) { > getPage().getPageParameters().put("sTerm", searchterm); > setResponsePage(getPage().getClass(), > getPage().getPageParameters()); > }; > }; > } > } > </code> > > SearchSlot.java > <code> > public abstract class SearchSlot extends Panel { > > public SearchSlot(String id) { > super(id); > IModel<String> term = new Model<String>(); > StatelessForm<String> form = new StatelessForm<String>("searchSlot", > term) { > @Override > protected void onSubmit() { > setSearchterm(getModelObject()); > super.onSubmit(); > } > }; > form.add(new TextField<String>("searchTerm", term)); > form.add(new ImageButton("doSearch", new > CompressedResourceReference(WicketApplication.class, "res/img/go.png"))); > add(form); > } > > protected abstract void setSearchterm(String searchterm); > } > </code> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org