I have a an object stored in the model called "domain", which has two methods, getDescriptionEn() and getDescriptionFr().
I need the description depending on the current locale.
Here is my problem, I have the following:
var locale = "${currentLocale}"; // This returns either "En" or "Fr"
var method = "{domain.getDescription".concat(locale).concat("}"); // This is "{domain.getDescriptionEn}" or "{domain.getDescriptionFr}"
var expr = "$".concat(method); // This is going to be "${domain.getDescriptionFr}"
now I would like to evaluate this expressoin but it does not seem to work.
I have tried parsing the strings many different ways,
I also tried:
var method = "domain.getDescription".concat(locale); // This is "domain.getDescriptionEn" or "domain.getDescriptionFr"
var expr = "${".concat(method).concat("}");