1 Reply Latest reply on Oct 30, 2009 11:17 PM by cash1981

    resolving el messages in a js file.

    scphantm.scphantm.gmail.com

      i have a jquery plugin for field validation.  my problem is i need multilingual support.  all the messages (about a hundred or so) are currently coded as variables in the validation.js file that i wrote.  is there a way that i can use seam remoting or anything else to change the


      err="first name";



      to


      err="#{messages.firstname}";



      inside the js file so that i can get multilingual support in my validation?

        • 1. Re: resolving el messages in a js file.
          cash1981

          I am not sure I understand your problem. However this is how we do things:


          To get messages from message bundle in javascript:



          var err = '#{messages['my.message']}';



          If I have some kind of validation going on inside the webremote, I usually handle that in the callback function from the webremote.




          Component.getInstance("myComponent").someMethod('param1','param2',callBack);
          
          function callBack(objectReturnedFromSomeMethod) {
            if(objectReturnedFromSomeMethod=='success') {
              alert('#{messages['okMessage'}');
            }
          }
          



          DISCLAIMER: I just wrote this code from my mind, so don't expect copy paste to work :-)