You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by Hasan Turksoy <ht...@gmail.com> on 2007/03/16 14:56:55 UTC

[validator] conversion error while validating listbox component's value

hi,

i have a problem about using commons-validator(CV) with selectmanylistbox of
my JSF pages'.. the problem is; CV trying to convert my listboxes' value(an
Array of objects) to string to make a required validation... And it throws
below exception;

javax.faces.ServletException: "You have requested a conversion for type [
Lmy.app.CarType;, but there is no by-type converter registered for this
type"

as you can understand from exception, it's trying to find a converter for
the "array of my.app.CarType".. and couldn't find as expected...

however, instead of looking directly for a converter of the coming value's
type, ConverterHelper class should control the coming value's being
array/list condition and if so; traverse that array/list and convert each
element of it separately... In JSF RI, MenuRenderer class(
com.sun.faces.renderkit.html_basic.MenuRenderer) is working as this way
while converting coming array/list values to string or object...

what do you think about this issue... i think this is an issue (and may be i
should enter it on shale-JIRA)... But is there any other solution? or
anybody used required validator with h:selectManyListBox component?

my usage is as below;
<h:selectManyListbox value="#{myPageCode.selectedCarTypesArray}" ...>
  <f:selectItems value="#{myPageCode.carTypesList}"></f:selectItems>
  <s:commonsvalidator type="required" ... />
</h:selectManyListbox>


regards,

hasan...