1 Reply Latest reply on Mar 31, 2008 10:13 AM by elnino

    BackBean Property : Assigning default value from message_xx.prop

    elnino

      Hello,


      I spent my all day on a form....


        I didn't see anything in the documentation or forum that could solve my problem.
      Or I haven't got enough knowledge to find what I'am looking for...


      I have RichFaces SuggestionBox.


      Instead of having a label outside the inputText,
      I would like to get it IN the input text as default value.


      With Javascript, I will erase it when the user goes in the field. (I have found code that do that)


      My problem is that the input value is connected to a back bean as this


      <h:inputText value="#{myCoolBackBean.myProperty}" />



      If I initialize myProperty attribute with a String value : It's working....


      Now....
      How, I want that the default value in the internationalisation files (messagesXX.properties...) ?


      Is there a way to initialize the Java attributes with an external string defined in internationalisation files ?



      Hope so...
      If not .... Any idea to do what I want (pre-filled input with auto-erase value)?


      Thanks for your help.


      Regards,


      Paul


        • 1. Re: BackBean Property : Assigning default value from message_xx.prop
          elnino

          Hello,


          I have found my answer. The night was good. Yesterday, several hours on this. Today : 10 minutes !


          /**
           * Disco time !
           */
           private String daddyCool = ResourceBundle.instance().getString("ShesCrazyLikeAFool");
          



          1 bad thing: If the key is not found, the Bean cannot be created and involve a crash.


          I will put it in the constructor to see if I can catch the exception.


          Thanks for people who have read this topic.


          Regards,


          Paul


          Coding with Boney M playing list....