Message: 5
Date: Sun, 11 Sep 2005 22:38:38 +0200
From: Martijn Dashorst <[EMAIL PROTECTED]>
To: [email protected]
Subject: Re: [Wicket-user] Form: Input Field returns null
Reply-To: [email protected]
------=_Part_11643_31578872.1126471118788
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
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:
>=20
> 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
>=20
>=20
> Java Code:
>=20
> public class TestPage extends WebPage {
> class Person implements Serializable {
> private String name =3D "TEST";
>=20
> public void setName(String name) {
> this.name <http://this.name> =3D name;
> }
>=20
> public String getName() {
> return name;
> }
> }
>=20
> public TestPage() {
> Person person =3D new Person();
> add(new TestForm("testForm", new Model(person)));
> }
>=20
> class TestForm extends Form {
>=20
>=20
>=20
> public TestForm(String id, IModel model) {
> super(id, model, null);
> add(new TextField("name", new PropertyModel(
> model, "name")));
> }
>=20
> public void onSubmit() {
> System.out.println("----------------------------------");
> System.out.println(((Person) getModelObject()).getName());
> System.out.println("----------------------------------");
> }
> }
> }
>=20
>=20
>=20
> My html Code:
>=20
> <?xml version=3D"1.0" encoding=3D"UTF-8"?>
> <html xmlns=3D"http://www.w3.org/1999/xhtml">
> <head>
> <title>My Wicket Example</title>
> </head>
> <body>
> <form wicket:id=3D"testForm" method=3D"get">
> Name: <input type=3D"text" wicket:id=3D"name"/>
> <input type=3D"submit" value=3D"save" />
> </form>
> </body>
> </html>
>=20
> _________________________________________________________________
> On the road to retirement? Check out MSN Life Events for advice on how
to
> get there! http://lifeevents.msn.com/category.aspx?cid=3DRetirement
>=20
>=20
>=20
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle=20
> Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing &
Q=
A
> Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
------=_Part_11643_31578872.1126471118788
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Working on CVS-head, I can't reproduce your problem. It just works for
me:<=
br>
<br>
22:36:49.334 EVENT Started [EMAIL PROTECTED]<br>
22:36:58.317 EVENT Started HttpContext[/]<br>
----------------------------------<br>
TEST1<br>
----------------------------------<br>
<br>
Can you provide some information on which version you are working with?<br>
<br>
Martijn<br>
<br><br><div><span class=3D"gmail_quote">On 9/11/05, <b
class=3D"gmail_send=
ername">Fred Astaire</b> <<a
href=3D"mailto:[EMAIL PROTECTED]">to=
[EMAIL PROTECTED]</a>> wrote:</span><blockquote
class=3D"gmail_quot=
e" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt
=
0.8ex; padding-left: 1ex;">
Hello!<br>I am very new to Wicket, Can someone tell me what i am doing
wron=
g:<br>I am playing around with Forms to see how it works, but my input
fiel=
d<br>returns null!<br>My Code is listed below.<br>Any help is appreciated.
<br>Greetz<br> S=
ebastian<br><br><br>Java Code:<br><br>public class TestPage extends
WebPage=
{<br> class Person implements Serializable
{<br>&nb=
sp; private String name =3D
"=
TEST";<br><br> public
v=
oid setName(String name) {
<br>  =
;<a href=3D"http://this.name">this.name</a> =3D
name;<br> =
}<br><br> =
public String getName()
{<br> &nbs=
p; return
name;<br> &nb=
sp; }<br> }<br><br> &nbs=
p; public TestPage()
{<br> &n=
bsp; Person person =3D new Person();
<br> add(new
TestForm("=
testForm", new
Model(person)));<br> }<br><br>&n=
bsp; class TestForm extends Form
{<br><br><br><br> &n=
bsp; public TestForm(String id, IModel
m=
odel)
{<br> &nbs=
p; super(id, model, null);
<br>  =
;add(new TextField("name", new
PropertyModel(<br> &nbs=
p; &=
nbsp; model,
"name")));<br> }<b=
r><br> public void
onSubmit(=
)
{<br> &n=
bsp; System.out.println("----------------------=
------------");<br> &nb=
sp; System.out.println(((Person)
getModelObject()).getName());<br> =
System.out.println("--------------------=
--------------");<br> }=
<br> }<br>}<br><br><br><br>My html
Code:<br><br><=
?xml version=3D"1.0" encoding=3D"UTF-8"?>
<br><html xmlns=3D"<a
href=3D"http://www.w3.org/1999/xhtml">http://=
www.w3.org/1999/xhtml</a>"><br><head><br><title>My
Wick=
et Example</title><br></head><br><body><br><form
wicke=
t:id=3D"testForm" method=3D"get">
<br>Name: <input type=3D"text"
wicket:id=3D"name"/&g=
t;<br><input type=3D"submit" value=3D"save"
/><br=
></form><br></body><br></html><br><br>___________________=
______________________________________________
<br>On the road to retirement? Check out MSN Life Events for advice on how
=
to<br>get there! <a
href=3D"http://lifeevents.msn.com/category.aspx?cid=3DR=
etirement">http://lifeevents.msn.com/category.aspx?cid=3DRetirement</a><br>=
<br>
<br><br>-------------------------------------------------------<br>SF.Net
e=
mail is Sponsored by the Better Software Conference &
EXPO<br>September=
19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices<br>Agile=
& Plan-Driven Development * Managing Projects & Teams * Testing
&a=
mp; QA
<br>Security * Process Improvement & Measurement * <a
href=3D"http://ww=
w.sqe.com/bsce5sf">http://www.sqe.com/bsce5sf</a><br>______________________=
_________________________<br>Wicket-user mailing list<br><a
href=3D"mailto:=
[email protected]">
[email protected]</a><br><a
href=3D"https://lists.sourcefor=
ge.net/lists/listinfo/wicket-user">https://lists.sourceforge.net/lists/list=
info/wicket-user</a><br></blockquote></div><br>
------=_Part_11643_31578872.1126471118788--
--__--__--
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
End of Wicket-user Digest