If you want to access them from a call you need to declare them final final TextField name = new TextField("name");
But i' m missing a Model that should receive the values from the form components? Normally, with wicket you do not access the FormComponets to get the values but let Wicket handle the conversion and validation. Or do you use a CompoundPropertyModel (not shown in the code) ? Bert On Thu, Dec 17, 2009 at 08:45, marioosh.net <marioosh....@gmail.com> wrote: > Is simple possibility to access page components in anonymous onClick > method like in code below ? > > public class NewLinkPanel extends Panel { > public NewLinkPanel(String id) { > super(id); > > TextField name = new TextField("name"); > TextField address = new TextField("address"); > add(name); > add(address); > add(new AjaxLink("ok"){ > public void onClick(AjaxRequestTarget target) { > // how to get name and address values ? > System.out.println("ok"); > } > }); > } > } > > Thanks in advance. > > -- > Greetings, > marioosh > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org