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!

checkbox labels not updating

Rahamtulla InamdarMay 2 2019 — edited Jul 23 2019

Below is the code which is creating duplicate labels in checkbox set.

checkbox issue.png

i used below cookbook demo to reproduce issue

https://www.oracle.com/webfolder/technetwork/jet/jetCookbook.html?component=dialog&demo=modal

require(['ojs/ojcore', 'knockout', 'jquery', 'ojs/ojknockout', 'ojs/ojbutton', 'ojs/ojdialog','ojs/ojcheckboxset'],

function (oj, ko, $) {

  function viewModel() {

    var self = this;

self.pinkDCount = ko.observableArray();

     self.agree = ko.observableArray(\['agree'\]);

  var rrr = {};

  rrr\['name'\] = 'demo';

self.pinkDCount(rrr);

    self.close = function (event) {

      document.getElementById('modalDialog1').close();

    }

    self.open = function (event) {

      self.pinkDCount(\[\]);

      var aa = {};

  aa\['name'\] = 'demochanged';

self.pinkDCount(aa);

      document.getElementById('modalDialog1').open();

    }

  }

  ko.applyBindings(new viewModel, document.getElementById('dialogWrapper'));

});

<html lang="en-us" style="height:100%;" dir="ltr">

<body class="demo-disable-bg-image">

\<div id="sampleDemo" style="" class="demo-padding demo-container">

  \<div id="componentDemoContent" style="width: 1px; min-width: 100%;">

    \<div id="dialogWrapper">

      \<oj-dialog style="display:none" id="modalDialog1" dialog-title="Modal Dialog">

        \<div slot="body">

          The dialog window can be moved, resized and closed with the 'x' icon.

          Arbitrary content can be added to the the body and footer sections.

          \<oj-checkboxset id="checkboxSetAgreeId" labelled-by="agreeId"

                value="\[\[agree\]\]"

                required >

            \<oj-option id="agree" value="agree">

            \<!-- ko with : pinkDCount  -->

              \<!-- ko text : name -->\<!-- /ko -->

              \<!-- /ko -->

            \</oj-option>

          \</oj-checkboxset>

        \</div>

        \<div slot="footer">

          \<oj-button id="okButton" on-oj-action="\[\[close\]\]">OK

          \</oj-button>

        \</div>

      \</oj-dialog>

      \<oj-button id="buttonOpener" on-oj-action="\[\[open\]\]">

        Open Modal Dialog

      \</oj-button>

    \</div>

  \</div>

\</div>

</body>

</html>

This post has been answered by Andrew Bennett on May 8 2019
Jump to Answer
Comments
Post Details
Added on May 2 2019
4 comments
589 views