Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
1239 Visninger

  _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
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
2
apr. 25
2812
2
aug. 24
3604
1
jul. 24
1557
0
jul. 24
1566
2
maj 24
4324