In an ftl file we can access a property/xml file value as follows
${uiLabelMap.CommonFollowingErrorsOccurred}

Is there a way to do something similar in a javascript function? In a separate thread Rishi pointed me to [0], but that only does a show/hide of a div that already has a message.

I am doing this

   function showAjaxError(data) {
       var errorMessageList = data['errorMessageList'];
       if (errorMessageList != null){
           var buffer = ['The Following Errors Occurred:'];
           for ( var i = 0; i < errorMessageList.size(); i ++){
               buffer.push(errorMessageList[i]);
           }
           var errorDiv = dojo.query('.ajaxErrorBox');
           errorDiv[0].innerHTML = buffer.join("<br/>");
           errorDiv.style('display', 'block');
       }
       else
       {
           var errorDiv = dojo.query('.ajaxErrorBox');
           errorDiv.style('display', 'none');
       }
   }

I wanted to replace the hard coded value of "The Following Errors Occurred:" with the ${uiLabelMap.CommonFollowingErrorsOccurred} from messages.ftl. Not sure how I could ever get that value since I realize its on the server side of things and I want the value in the client side javascript.

[0]https://demo.ofbiz.org/accounting/control/CostCenters

Reply via email to