Question

Hide element on page based on condition

Hi all,

I've been trying to hide a gauge if a certain date is not inserted following the instructions on this post:

https://community.bpmonline.com/questions/how-add-custom-style-control-…

I've created custom CSS  with this code (the custom CSS works if I remove the condition):

    #ProfileContainer-item-Gauge326add2d-7cb8-4a80-bb89-d89ed714f625[indicadorCalculado="false"]{

        display: none;

    }

 

On my Custom Case page I've done 3 steps which I believe are the ones necessary:

1) created method to give the signal do display or not:

indicadorCalculado: function() {

    var result=true;

    if(this.get("imdPedidoDataParticipacaoPrevia") == null ){

        result=false;

    }

    return result;

},

2) initiated the method:

                 onEntityInitialized: function() {this.indicadorCalculado ();

},

3) passed the domAtributes to the gauge element:

            {

                "operation": "insert",

                "name": "Gauge326add2d-7cb8-4a80-bb89-d89ed714f625",

                "values": {

                    "domAttributes": {

                        "bindTo": "indicadorCalculado"

                    },

                    "layout": {

                        "colSpan": 24,

                        "rowSpan": 4,

                        "column": 0,

                        "row": 14,

                        "layoutName": "ProfileContainer",

                        "useFixedColumnHeight": true

                    },

                    "itemType": 4,

                    "classes": {

                        "wrapClassName": [

                            "card-widget-grid-layout-item"

                        ]

                    }

                },

                "parentName": "ProfileContainer",

                "propertyName": "items",

                "index": 11

            },

 

What am I missing to get this to work?

Thanks

Like 0

Like

1 comments

Please debug the functionality step by step. Find if "indicadorCalculado" appears in html, debug if the "indicadorCalculado" method returns correct value. 

https://academy.bpmonline.com/documents/technic-sdk/7-13/client-code-debugging

Show all comments