Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
1191 Visualizações

  _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
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
2
abr. 25
2718
2
ago. 24
3469
1
jul. 24
1498
0
jul. 24
1534
2
mai. 24
4225