You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by infiniter <in...@gmail.com> on 2011/11/01 16:21:23 UTC

value set in form control by Javascript to model object

Hi,
I have wicket TextField. The input is read only and its text is changed by a
Javascript component... 
So my question is: how can I set the model object to its new value set by
JS?

The problem as you know is that when trying to submit I get an error because
the object is null:
java.lang.IllegalStateException: Attempt to set model object on null model
of component

Carlos P.


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/value-set-in-form-control-by-Javascript-to-model-object-tp3963955p3963955.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: value set in form control by Javascript to model object

Posted by Martin Grigorov <mg...@apache.org>.
On Tue, Nov 1, 2011 at 5:21 PM, infiniter <in...@gmail.com> wrote:
> Hi,
> I have wicket TextField. The input is read only and its text is changed by a
> Javascript component...
> So my question is: how can I set the model object to its new value set by
> JS?
>
> The problem as you know is that when trying to submit I get an error because
> the object is null:
> java.lang.IllegalStateException: Attempt to set model object on null model
> of component

This sounds like you didn't provide an empty model.
Just use Model.of("")

>
> Carlos P.
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/value-set-in-form-control-by-Javascript-to-model-object-tp3963955p3963955.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
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org