コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
1204 ビュー

  _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.

アバター
破棄
最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
2
4月 25
2774
2
8月 24
3556
1
7月 24
1528
0
7月 24
1550
2
5月 24
4288