How to utilize bundle in VBCS JS section?
Summary
How to utilize bundle in VBCS JS section?Content
Hi Everyone,
I have created a basic web application with form validation.
I want display error messages coming from bundle instead of I hard-coding in the JS section of the page.
You can see from the code snippet that I've hard-coded the error detail.
Also, suggest how to import bundle in the JS page module declaration?
I've created my bundle in the path - flows/resources/strings/validationgroupbundle/nls/bundle.json
Regards,
Karthick.R
Version
19.4.3.2Code Snippet
define(['ojs/ojasyncvalidator-regexp'], function(AsyncRegExpValidator) {
....
PageModule.prototype._performCustomCrossFieldValidation = function(
firstFieldValue, secondFieldValue, thirdFieldValue, translations) {
if ((!firstFieldValue) &&
(!secondFieldValue) &&
(!thirdFieldValue)) {
throw {
summary: "Error",
detail:"You have to enter at least one field before you can submit."
//bundle.validationgroupbundle['YOU_MUST_ENTER_LOCATION']
};
}
}
...
}
Tagged:
0