Re: Why I cannot receive default value in Textfield?
Hi, thanks for the replay. I checked onsubmit() and the value has not been transferred if I don't delete the default value. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Why-I-cannot-receive-default-value-in-Textfield-tp4483603p4486021.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Why I cannot receive default value in Textfield?
Check the value of the ContactPerson1 field in your onSubmit() method. It should contain what gets submitted. The merchant object is unrelated to your text field. On Mar 18, 2012 9:38 PM, "xiaowang" wrote: > Hi, > Now I am using: > > html - > > > > Java - > public class MerchantEditPanel extends Panel { > private String ContactPerson1 = "some text"; > > public MerchantEditPanel{ > TextField ContactPerson1 = new > TextField("ContactPerson1",new > PropertyModel(this,"ContactPerson1")); > xxform. add(ContactPerson1); > > frmEdit.add(new AjaxSubmitLink("submit") { > @Override >protected void onSubmit(AjaxRequestTarget ajaxRequestTarget, > Form components) { > Merchant m = > (Merchant)components.getModelObject(); > .. > Here I find "m" cannot get the default value from ContactPerson textfield, > or even I just add some words after "some text", > components.getModelObject() > cannot get the value from this textfield. > Ps:It can show default value "some text" in ContactPerson textfield. > > > And, if I try to use the code from > > http://wicketstuff.org/wicket14/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.TextFieldPage > , > there is no default value in Textfield... > > Can anyone help me? Thanks in advanced. > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Why-I-cannot-receive-default-value-in-Textfield-tp4483603p4483603.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Why I cannot receive default value in Textfield?
Hi, Now I am using: html - Java - public class MerchantEditPanel extends Panel { private String ContactPerson1 = "some text"; public MerchantEditPanel{ TextField ContactPerson1 = new TextField("ContactPerson1",new PropertyModel(this,"ContactPerson1")); xxform. add(ContactPerson1); frmEdit.add(new AjaxSubmitLink("submit") { @Override protected void onSubmit(AjaxRequestTarget ajaxRequestTarget, Form components) { Merchant m = (Merchant)components.getModelObject(); .. Here I find "m" cannot get the default value from ContactPerson textfield, or even I just add some words after "some text", components.getModelObject() cannot get the value from this textfield. Ps:It can show default value "some text" in ContactPerson textfield. And, if I try to use the code from http://wicketstuff.org/wicket14/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.TextFieldPage, there is no default value in Textfield... Can anyone help me? Thanks in advanced. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Why-I-cannot-receive-default-value-in-Textfield-tp4483603p4483603.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org