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!

Editable input text in OJET detail table shows old value.

3891423Feb 18 2019 — edited Feb 18 2019

Hi ,

I am facing an issue with oracle JET detail table. Here I have a field in the OJET detail table which has editable value. I tried to create oj input text inside a <td> as shown below

var EditableCell = document.createElement('td');

     var input = document.createElement("oj-input-text");

     input.setAttribute('value',context.row.Editable text());

I am trying to get the edited value through offset function as shown below but the rowcopy always returns old value.

self.dataprovider.fetchByOffset({offset: index}).then(function (value)

            {

                var row = value['results'][0]['data'];

                var rowCopy = {};

                Object.keys(row).forEach(function (attr) {

                    rowCopy[attr] = row[attr]();

                });

                console.log('rowcopy'+JSON.stringify(rowCopy));

In order to make the fields editable i have made each attribute of dataprovider array as knockout observable.

deptArrayObservable = self.deptArray.map(function (row) {

                        Object.keys(row).forEach(function (attr) {

                            row[attr] = ko.observable(row[attr]);

                        });

                        return row;

                    });

Approach works fine while using a simple editable table but doesn't work with the detail table.

I just tried various ways to set the value attribute like mentioned below but nothing worked

input.setAttribute('value','{{$context.row.BID_AMOUNT}}');

or input.setAttribute('data-bind','value: $context.row.BID_AMOUNT');

please not OJET version is 5.1.0

Appreciate any help on the following.

Thanks & Regards,

Manish Mathew

Comments
Post Details
Added on Feb 18 2019
0 comments
225 views