knockout.jsoracle-jet

Uncaught (in promise) ReferenceError: ValidationBase is not defined


I am trying to run this example : https://www.oracle.com/webfolder/technetwork/jet/jetCookbook.html?component=listView&demo=filterSortListView

I downloaded JET-Template-Web-NavBar and in dashboard.html and js replaced code given in example but it throws error saying

dashboard.js:73 Uncaught (in promise) ReferenceError: ValidationBase is not defined
    at new DashboardViewModel (dashboard.js:73)

js file

define(['ojs/ojcore', 'knockout','appController','ojs/ojmodel',   'ojs/ojvalidation-base', 'ojs/ojknockout', 
    'ojs/ojlistview', 'ojs/ojgauge', 'ojs/ojbutton', 'ojs/ojcheckboxset', 'ojs/ojselectcombobox', 'ojs/ojpagingcontrol'],
 function( oj,ko,  data ,  app ,  Model) {


    function DashboardViewModel() {
      var self = this;

rest is complete example copy paste and did not make any change to default main.js that comes with application. All modules seems available (all are 200 ok on debugger)


Solution

  • You need to pass the modules as the correct parameters to your function.

    define(['ojs/ojcore', 'knockout','appController','ojs/ojmodel',   'ojs/ojvalidation-base', 'ojs/ojknockout', 
        'ojs/ojlistview', 'ojs/ojgauge', 'ojs/ojbutton', 'ojs/ojcheckboxset', 'ojs/ojselectcombobox', 'ojs/ojpagingcontrol'],
     function(oj, ko, app, Model, ValidationBase) {
    
    
        function DashboardViewModel() {
          var self = this;