Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
1580 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
wrz 25
297
2
kwi 25
3432
Free Sing Up ?? Rozwiązane
2
sie 24
4423
1
lip 24
1856
0
lip 24
1911