You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "david.li" <lx...@hotmail.com> on 2013/04/07 12:04:49 UTC
can't get the TextField's Model
Hi,the code like this:
form.add(new TextField("aaa",new PropertyModel(this, "aaa")));
form.add(new Button("btnaaa") {
@Override
public void onSubmit() {
info(aaa);
}
}.setDefaultFormProcessing(false));
html:
<form wicket:id="form">
<input type="text" wicket:id="aaa"/>
<input type="text" wicket:id="bbb"/>
<input type="submit" wicket:id="btnaaa"/>
</form>
If i add setDefaultFormProcessing(false),i can't get the aaa in onSubmit().
How can i get this value?
-----
david
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/can-t-get-the-TextField-s-Model-tp4657797.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: can't get the TextField's Model
Posted by Sven Meier <sv...@meiers.net>.
Hi David,
so you want to process a single form component only when a button is
pressed?
Then use #setDefaultFormProcessing(false) and process the specific form
component by yourself.
See AjaxFormComponentUpdatingBehavior#onEvent() on how to process a
single component only.
Hope this helps
Sven
On 04/07/2013 03:54 PM, david.li wrote:
> Hi,Sven Meier,I want to achieve the function like this:there are some
> TextFields in the page.Some of TextFields need to check via the event
> whether the value entered. so when user enter the value,then click the
> button to verify the value.
>
> how to resolve it?
>
>
>
> -----
> david
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/can-t-get-the-TextField-s-Model-tp4657797p4657802.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: can't get the TextField's Model
Posted by "david.li" <lx...@hotmail.com>.
Hi,Sven Meier,I want to achieve the function like this:there are some
TextFields in the page.Some of TextFields need to check via the event
whether the value entered. so when user enter the value,then click the
button to verify the value.
how to resolve it?
-----
david
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/can-t-get-the-TextField-s-Model-tp4657797p4657802.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: can't get the TextField's Model
Posted by Sven Meier <sv...@meiers.net>.
Hi David,
the idea of #setDefaultFormProcessing(false) is to skip form processing,
thus textField doesn't write into its model.
What are you trying to accomplish?
Sven
On 04/07/2013 12:04 PM, david.li wrote:
> Hi,the code like this:
> form.add(new TextField("aaa",new PropertyModel(this, "aaa")));
> form.add(new Button("btnaaa") {
> @Override
> public void onSubmit() {
> info(aaa);
> }
> }.setDefaultFormProcessing(false));
>
> html:
> <form wicket:id="form">
> <input type="text" wicket:id="aaa"/>
> <input type="text" wicket:id="bbb"/>
> <input type="submit" wicket:id="btnaaa"/>
> </form>
>
> If i add setDefaultFormProcessing(false),i can't get the aaa in onSubmit().
> How can i get this value?
>
>
>
> -----
> david
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/can-t-get-the-TextField-s-Model-tp4657797.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org