myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <mkien...@gmail.com>
Subject Re: Skipping date conversion validation
Date Thu, 03 Nov 2005 15:57:23 GMT
Are you sure you blanked it out?

If you take a look at javax.faces.component.UIInput.validate(), you'll see

        if (submittedValue == null) return;
        Object convertedValue = getConvertedValue(context, submittedValue);

It seems to me that you'd never trigger the converter if the value was
not specified.   I don't think http sends back form data for empty
inputs, but maybe I'm wrong.

You could try setting a breakpoint on the code above and examine the
contents of submittedValue to see what it holds.

On 11/3/05, Virtudazo, Dennis (Exchange) <dvirtudazo@bear.com> wrote:
> I have an inputText that is not required, that uses the
> f:convertDateTime tag. If I blank out the inputText it causes a dateTime
> conversion error. How can I skip the conversion when the input is blank?
>
> Below is the code:
>
> <h:inputText id="startTime" value="#{bean.startTime}" required="false">
>   <f:convertDateTime type="time" timeStyle="short"/>
> </h:inputText>
>
>
>
> ***********************************************************************
> Bear Stearns is not responsible for any recommendation, solicitation,
> offer or agreement or any information about any transaction, customer
> account or account activity contained in this communication.
> ***********************************************************************
>
>

Mime
View raw message