You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to utilize bundle in VBCS JS section?

edited Jun 9, 2020 9:35AM in Visual Builder 2 comments

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.2

Code 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']
      };
    }
  }

...

}

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!