Working on CVS-head, I can't reproduce your problem. It just works for me:

22:36:49.334 EVENT  Started [EMAIL PROTECTED]
22:36:58.317 EVENT  Started HttpContext[/]
----------------------------------
TEST1
----------------------------------

Can you provide some information on which version you are working with?

Martijn


On 9/11/05, Fred Astaire <[EMAIL PROTECTED]> wrote:
Hello!
I am very new to Wicket, Can someone tell me what i am doing wrong:
I am playing around with Forms to see how it works, but my input field
returns null!
My Code is listed below.
Any help is appreciated.
Greetz
          Sebastian


Java Code:

public class TestPage extends WebPage {
    class Person implements Serializable {
        private String name = "TEST";

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

        public String getName() {
            return name;
        }
    }

    public TestPage() {
        Person person = new Person();
        add(new TestForm("testForm", new Model(person)));
    }

    class TestForm extends Form {



        public TestForm(String id, IModel model) {
            super(id, model, null);
            add(new TextField("name", new PropertyModel(
                    model, "name")));
        }

        public void onSubmit() {
                System.out.println("----------------------------------");
            System.out.println(((Person) getModelObject()).getName());
            System.out.println("----------------------------------");
        }
    }
}



My html Code:

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My Wicket Example</title>
</head>
<body>
<form wicket:id="testForm" method="get">
Name: <input type="text" wicket:id="name"/>
<input type="submit" value="save" />
</form>
</body>
</html>

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to