Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Consuming Rest Webservices in Oracle Jet

Laure YottiAug 24 2017 — edited Aug 24 2017

i am new in Oracle Jet. What i want to achieve, is to Consuming Rest Webservices in Oracle Jet Table.

That is my ViewModell

function CustomerViewModel() {

     var self = this;

    self.DeptCol = ko.observable();

    self.datasource = ko.observable();

    self.serviceURL = '/hr/employees/';

    self.parseDept = function(response) {

        return {empno: response['empno'],

            DepartmentName: response['ename'],

            LocationId: response['job'],

            ManagerId: response['hiredate'],

            mgr: response['mgr'],

            sal: response['sal'],

            comm: response['comm'],

            deptno: response['deptno']};

    };

    self.Department = oj.Model.extend({

        urlRoot: self.serviceURL,

        parse: self.parseDept,

        idAttribute: 'empno'

    });

    self.myDept = new self.Department();

    self.DeptCollection = oj.Collection.extend({

        url: self.serviceURL,

        model: self.myDept

    });

    self.DeptCol(new self.DeptCollection());

}

That is my View

    <table id="table" summary="Department List" aria-label="Departments Table"

           data-bind="ojComponent:{

       component:'ojTable',

       data:datasource,

       columns:[

          {

             headerText:'empno',

             field:'empno'

          },

          {

             headerText:'ename',

             field:'DepartmentName'

          },

          {

             headerText:'job',

             field:'LocationId'

          },

          {

             headerText:'hiredate',

             field:'ManagerId'

          },

          {

             headerText:'mgr',

             field:'mgr'

          },

          {

             headerText:'sal',

             field:'sal'

          },

          {

             headerText:'comm',

             field:'comm'

          },

          {

             headerText:'deptno',

             field:'deptno'

          }

       ]

    }">

    </table>

When i test my Page, it don't show any Errors and the Page is blank. Somebody can help please?

Thank

This post has been answered by Ben Moroze-Oracle on Aug 24 2017
Jump to Answer

Comments

Post Details

Added on Aug 24 2017
8 comments
397 views