return;
}
if (!supportsMultiple && (values.length > 1))
{
throw new WicketRuntimeException(
"The model of Select component [" +
getPath() +
"] is not of type java.util.Collection, but more then one SelectOption component has been selected. Either remove the multiple attribute from the select tag or make the model of the Select component a collection");
}
List<Object> converted = new ArrayList<>(values.length);
/*
* if the input is null we do not need to do anything since the model collection has already
* been cleared
*/
for (int i = 0; i < values.length; i++)
{
final String value = values[i];
if (!Strings.isEmpty(value))
{
SelectOption<T> option = visitChildren(SelectOption.class,
new IVisitor<SelectOption<T>, SelectOption<T>>()
{
@Override
public void component(SelectOption<T> option, IVisit<SelectOption<T>> visit)
{
if (String.valueOf(option.getValue()).equals(value))
{
visit.stop(option);
}
}
});
if (option == null)
{
throw new WicketRuntimeException(
"submitted http post value [" +
Arrays.toString(values) +
"] for SelectOption component [" +
getPath() +
"] contains an illegal value [" +