On 10/19/06, Jean-Baptiste Quenot <[EMAIL PROTECTED]> wrote:

* Igor Vaynberg:

> i  dont  realy  like  this... converted  input  should  only  be
> available after successful convert() validation step - which you
> are specifically disabling.

I understand your  point, but then what do you  propose to get the
selected values?


there are a couple of options
1) validate the component by calling formcomponent.validate()
2) validate it to the point where you can get the value - by calling
convert()


The  real  problem  is  that  FormComponent.getValue()  returns  a
String, that doesn't make sense for a CheckGroup.  We should maybe
change the signature to Object,  and return a List<Boolean> in the
case of the CheckGroup.  That way  one could have a way to inspect
the selected checkboxes, without calling convertValue().


getValue() returns the request parameter value that is assigned to the
formcomponent - if it was up to me this detail would be encapsulated
(private) - but unfortunately it is not up to just me.

the reason it would be encapsulated is because like you see in this case it
is really an implementation detail. to you its some incomprehensible
garbage, to checkgroup it is something it can decode and produce a list of
selected checkboxes for you. you shouldnt be messing with it directly.

so, imho, calling convert() followed by getConvertedValue() is the only way
you should have access to that data.

BTW  the Javadoc  for FormComponent.getValue()  is far  from being
clear:  «Gets current value for a form component».


i agree. sometimes it is hard to take a point of view of a user who doesnt
understand how wicket works because as committers we have intimate
knowledge. so a patch to the javadoc with your point of view would be most
welcome.

-Igor

Reply via email to