this line: textRequired = (Boolean) checkBox.getModelObject(); should not work
you are inside a validator, that means models haven not been updated
yet. models are only updated once all type conversion/validation
succeeds.
inside validators you should use formcomponent.getconvertedinput() to
read the value that will be put into the model if validators succeed.
-igor
On Wed, Feb 20, 2008 at 3:30 PM, Martin Makundi
<[EMAIL PROTECTED]> wrote:
> > a proper solution would be to use a validator or a formvalidator to do
> > this. generally you never iterate over components to do validation in
> > wicket. we have good plugin points for you in the form workflow.
>
> Judging from the performance of the checkbox, I have a wrong plugin
> point for the validator. How would you put it?
>
>
> > you didnt show the part of code that generates the list...
> > > it is just a dummy list of new todo items.
> > they are unique but you are using a listview? so what you have is not
> > a list at all, it is a collection of random items.
> > perhaps listview is not what you want. if you keep regenerating items
> every request
>
> They are not random. Here is the code generating the items:
> List<Todo> linkedTodos = new LinkedList<Todo>();
> {
> Todo todo = new Todo();
> todo.setDescription("Dummy");
> todo.setSelected(true);
> todo.setTodoDate(Convert.toDate("1.1.2008");
> linkedTodos.add(todo);
> }
> // ... and I have repeated a number of these ... say 7 pcs
> return linkedTodos;
>
> The page uses a linkedTodos "singleton" in the sence that the list is
> generated only the first time the page is loaded. So they are not
> random.
>
>
> > > Is there a bug with the checkbox?
> > doubt it
>
> Well.. the validator fails to receive the submitted checkbox state.
> Did I attach the validator improperly? Or should I read the checkbox
> value in some other way? The checkbox state submitted from the browser
> is not received by the validator using the code I posted before. The
> textfields function properly, but the checkboxes seem to somehow be
> disconnected... they sometimes change state according to the selection
> in the browser window, sometimes not. Mostly not ;) Odd times? Very
> strange.
>
>
>
> **
> Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]