Typical UIInput behavior: Decode phase -> Is there a value in the POST values with the current component's client ID? If so, set the submitted value to that
Validate phase -> If there is a submitted value, get the converter If there is a converter, convert the submitted value using getAsObject Validate the submitted value If valid, set the local value Update phase -> If there is a local value, update the value binding property Render phase -> If there is a submitted value, render that Otherwise, get the value from the component If there is a converter, convert the value using getAsString Render the value So as you can see, as long as a UIInput control has a submitted value, it will never render the value from the value attribute of the component. Typically submitted values are only cleared in the validate method of UIInput (if the converted value is valid) On 7/6/07, Toppac <[EMAIL PROTECTED]> wrote:
I don't think I follow what you are saying exactly. Can you elaborate? Andrew Robinson-5 wrote: > > Converter will only be called if there is no submitted value. > Submitted values are already technically converted as they came from > the client, so there is no need to use the converter. > > On 7/6/07, Toppac <[EMAIL PROTECTED]> wrote: >> >> Just for a small background. I am trying to find a way to fail validation >> and/or conversion without dumping out of the JSF lifecycle to render >> response. I'd like to inject a custom converter that when it fails to >> convert it saves the submitted value to a session scoped Map and then >> during >> render response, when it tries to render the component that failed >> conversion, the getAsString method would see that the incoming value is >> null >> and would go to the session map to grab the last submitted value. >> >> Sounds easy enough and should work. But when I tried it, it appears that >> during render response, if the value on the domain model is null (or if >> the >> component value is null, not sure) it does not call the >> converter.getAsString method. I am not sure why. If someone can tell me >> why >> and where it makes this decision that would be great. If this is a bug >> then >> great also. But if it is not a bug then can anyone suggest a way to do >> what >> I am trying to do? >> -- >> View this message in context: >> http://www.nabble.com/Converter.getAsString-not-called--tf4038047.html#a11472287 >> Sent from the MyFaces - Users mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Converter.getAsString-not-called--tf4038047.html#a11472464 Sent from the MyFaces - Users mailing list archive at Nabble.com.

