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
1211 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
2781
Free Sing Up ?? Rozwiązane
2
sie 24
3561
1
lip 24
1532
0
lip 24
1554
2
maj 24
4295