- 3,723,265 Users
- 2,244,521 Discussions
- 7,850,383 Comments
Forum Stats
Discussions
Categories
- 16 Data
- 362.2K Big Data Appliance
- 7 Data Science
- 2.1K Databases
- 607 General Database Discussions
- 3.7K Java and JavaScript in the Database
- 32 Multilingual Engine
- 497 MySQL Community Space
- 7 NoSQL Database
- 7.7K Oracle Database Express Edition (XE)
- 2.8K ORDS, SODA & JSON in the Database
- 421 SQLcl
- 61 SQL Developer Data Modeler
- 185.1K SQL & PL/SQL
- 21.1K SQL Developer
- 2.4K Development
- 3 Developer Projects
- 32 Programming Languages
- 135.6K Development Tools
- 12 DevOps
- 3K QA/Testing
- 334 Java
- 10 Java Learning Subscription
- 12 Database Connectivity
- 71 Java Community Process
- 2 Java 25
- 11 Java APIs
- 141.2K Java Development Tools
- 8 Java EE (Java Enterprise Edition)
- 153K Java Essentials
- 135 Java 8 Questions
- 86.2K Java Programming
- 270 Java Lambda MOOC
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 16 Java SE
- 13.8K Java Security
- 4 Java User Groups
- 22 JavaScript - Nashorn
- 18 Programs
- 147 LiveLabs
- 34 Workshops
- 10 Software
- 4 Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 4 Deutsche Oracle Community
- 16 Español
- 1.9K Japanese
- 3 Portuguese
Not able to populate data from REST using Oracle JET Common Model

Hello Everyone
I am trying to populate a JET table using Common Model and I have followed the approach suggested in JET MOOC Course but my table shows 'Initializing' and there is no error on browser console.
Here goes the code of EmpFactory.js file
define(['ojs/ojcore','ojs/ojmodel'], function (oj) { var EmpFactory = { resourceUrl : 'https://codepen.io/cliffsanchez/pen/pbKmEy.html', // Single Employee Model createEmpModel : function () { var emp = oj.Model.extend( { urlRoot : this.resourceUrl, idAttribute : "DepartmentId" }); return new emp(); }, // Employees Collection createEmployeesCollection : function () { var employees = oj.Collection.extend( { url : this.resourceUrl, model : this.createEmpModel() }); return new employees(); } }; return EmpFactory;});
dashboard.js
/* * Your dashboard ViewModel code goes here */define(['ojs/ojcore', 'knockout', 'EmpFactory', 'ojs/ojtable','ojs/ojcollectiontabledatasource'], function (oj, ko, EmpFactory) { var DashboardViewModel = { empCollection : EmpFactory.createEmployeesCollection(), datasource : ko.observable(), // Called each time the view is shown to the user: initialize : function () { this.datasource(new oj.CollectionTableDataSource(this.empCollection)); this.empCollection.fetch(); } }; return DashboardViewModel;});
and dashboard.html
<div class="oj-hybrid-padding"> <h1>Dashboard Content Area</h1> <div id="div1"> <oj-table id="table" summary="Department List" aria-label="Departments Table" data='[[datasource]]' columns='[{"headerText": "Department Id", "field": "DepartmentId"}, {"headerText": "Department Name", "field": "DepartmentName"}, {"headerText": "Location Id", "field": "LocationId"}, {"headerText": "Manager Id", "field": "ManagerId"}]'> </oj-table> </div></div>
Please let me know where I am doing wrong.
Thanks
Best Answer
-
This has been handled in a different thread. The 'initialize' function is not being called (it used to be called in earlier releases of JET) and here is a different way of solving the problem:
https://github.com/geertjanw/OJETCourse4.x/blob/master/lesson2/lesson2-part04.md
Answers
-
@John Please suggest something
Thanks
-
This has been handled in a different thread. The 'initialize' function is not being called (it used to be called in earlier releases of JET) and here is a different way of solving the problem:
https://github.com/geertjanw/OJETCourse4.x/blob/master/lesson2/lesson2-part04.md
-
@Geertjan-Oracle Thank you so much for your response It is solved
PS.- I am curious to know that how can you mark my thread as answered? Are you the admin of the JET community that has special rights than other community users?
Ashish