Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
1358 Tampilan

  _isRequired(fieldName) {

          const required = this.activeFields[fieldName].required;

          return required ? evaluateBooleanExpr(required,   this.evalContextWithVirtualIds) : false;

    }


Is it possible to patch the protected method, if yes means help me to patch the protected method in owl.

Avatar
Buang
Jawaban Terbai

Hi,

We can also patch the protected method. You can try this approach.


import { patch } from "@web/core/utils/patch";

import { ComponentToPath } from "@/path/to/your/component";


patch(ComponentToPath.prototype, {


    _isRequired(fieldName) {


        super()._isRequired(); // if needed old functionality


        // Your custom logic here



     }


});


Hope it helps

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Apr 25
3077
Free Sing Up ?? Diselesaikan
2
Agu 24
3991
1
Jul 24
1650
0
Jul 24
1718
2
Mei 24
4652