3 Replies Latest reply on Apr 6, 2012 2:29 AM by sunilchaurha

    Conversion Error setting value '' for 'null Converter'.  Error

    sunilchaurha

      Hi All,

       

      I am getting Conversion Error setting value '' for 'null Converter' 

      So I am not able to submit my form.

      If I put immediate="true" on the commandbutton, then this error is resolved but all the values are lost from the form bean.

       

      Please help me, I am in some criticle situation.

       

      Please see the attached code.

        • 1. Conversion Error setting value '' for 'null Converter'.  Error
          sunilchaurha

          Hi All,

           

          Now I am able to resolve this issue by writing my own converter.

          I have written one converter and given mapping of this converter into faces-config.xml. and putting converter with the given id for the attribute for which I was getting error.

           

          In the converter I have overridden getAsObject and getAsString methods according to my need.

           

          • 2. Conversion Error setting value '' for 'null Converter'.  Error
            ilya_shaikovsky

            strange.. according to the code

                public static final String CONVERTER_ID = "javax.faces.Integer";

             

            you specified right id..

             

            b.t.w. you could use f:convertNumber configuret to validate integer numbers instead of just  f:converter

            • 3. Re: Conversion Error setting value '' for 'null Converter'.  Error
              sunilchaurha

              Hi,

              The problem is about the difference between list of select item, which has been rendered to the user interface and which is available during validate request phase.

              This problem comes most frequently when we user <h:selectItem itemLabel="" ItemValue="" />.

              So when we submit the form then this empty selection option is not available in the formbean's list of selectItem.

               

              The better approach to have an empty select item in the list, to add this empty item in form bean itself either in getter method of whereever suitable for you.

               

              --

              Sunil Chauraha