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
1328 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
kwi 25
3054
Free Sing Up ?? Rozwiązane
2
sie 24
3944
1
lip 24
1629
0
lip 24
1704
2
maj 24
4589