Thanks Stefan :)
On Tue, Sep 16, 2008 at 3:04 PM, Stefan Lindner <[EMAIL PROTECTED]> wrote:
> Your DropDownChoice element has no Model so the submit code does not know
> where to store your selection. Add a
>
> new Model()
>
> to it's constructor.
>
> -Ursprüngliche Nachricht-
> Von: Azzeddine Daddah [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 16. September 2008 15:01
> An: users@wicket.apache.org
> Betreff: "Attempt to set model object on null model of component" when
> submitting a form
>
> Hi,
>
> I've the following code:
>
> private static final List SEARCH_DOMAINS = Arrays.asList("AA",
> "BB");
> ...
> private void addSearchForm() {
>Form searchForm = new Form("searchForm");
>searchForm.add(new DropDownChoice("searchDomain", SEARCH_DOMAINS));
>searchForm.add(new TextField("areaCode", new Model(""),
> Integer.class));
>
>Button submiButton = new Button("submiButton") {
>private static final long serialVersionUID = 1L;
>
>public void onSubmit() {
>info("submiButton executed");
>}
>};
>
>searchForm.add(submiButton);
>add(searchForm);
>}
>
> When I hit the submit button I get this error: Attempt to set model object
> on null model of component.
>
> Could you please tell me what am I doing wrong?
>
> Gr. Azzeddine
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Azzeddine Daddah
www.hbiloo.com