Hi,

>This is getting empty when it is loaded with default values.

You mean you have values in your model but they don't show up on a re-submit?

Please take a look at ListMultipleChoicePage in wicket-examples. If I add a validator there, everything works as expected:

        listChoice.add(new IValidator<Collection<String>>()
        {
            @Override
public void validate(IValidatable<Collection<String>> validatable)
            {
                Collection<String> value = validatable.getValue();
                // value is filled with the now selected choices
            }
        });

Check what's different to your usage.

Sven

On 12/28/2012 11:10 AM, wicket_new_user wrote:
thanks Sven for your reply. the syntax issue worked.

But i'm, getting another probelm is

final Collection<Attribute> selectedFields = validatable.getValue();

This is getting empty when it is loaded with default values. Not sure if i'm
missing anything to add here.



Able to get the values only when the values or added to the list (i.e, the
component gets modified)



Also, I have observed that, in onSubmit(), the "updateModel()" iof
ListMultipleChoice() s getting called to set the actual property values, and
so the values are being displayed in in on submit when storing them in
domain objects :-(.
But it is not the case in Validating it :-(

Thanks
WN







--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Issue-while-adding-Custom-Validator-to-ListMultipleChoice-component-tp4655091p4655093.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
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]

Reply via email to