# How to hide the action button on the web, confd

**URL:** <https://dmap-community.ductus.global/t/how-to-hide-the-action-button-on-the-web-confd/1148>\
**Category:** YANG\
**Created:** [April 6, 2017, 3:45pm UTC](https://dmap-community.ductus.global/t/how-to-hide-the-action-button-on-the-web-confd/1148 "2017-04-06T15:45:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![weixiong100](https://avatars.discourse-cdn.com/v4/letter/w/71c47a/32.png) [@weixiong100](https://dmap-community.ductus.global/u/weixiong100)\
**Post date:** [April 6, 2017, 3:45pm UTC](https://dmap-community.ductus.global/t/how-to-hide-the-action-button-on-the-web-confd/1148/1 "2017-04-06T15:45:18Z")

</div>

hi, in the web UI, there is a action button. Once clicked, it will trigger some actions. However, in the UI, we would like to display or hide the button from the users, depending on the configuration/operating status. How do I do that?

our yang model:

```
container enodebMgr
{
    leaf runningMode
    {
        type enodebRunningMode;
        default Manual;
    }

    leaf isEnodebActive
    {
        config false;
        tailf:info "enodeb process is active";
        type boolean;
        default false;
    }

    tailf:action start 
    {
        tailf:actionpoint enodeb-start-point;
        input 
        {
        }
        output 
        {
            leaf response 
            {
                type string;
            }
        }
    }   
    
} 

```

for example, if runningMode is manual, we want to display action. If it is auto, we want to hide/disable action. thank you

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [April 10, 2017, 2:06pm UTC](https://dmap-community.ductus.global/t/how-to-hide-the-action-button-on-the-web-confd/1148/2 "2017-04-10T14:06:42Z")

</div>

Hi,  
You can for example use a YANG “when” statement, the tailf:hidden yang extension, or a ConfD NACM rule depending on your use case.

---

<div class="post-metadata">

**Author:** ![weixiong100](https://avatars.discourse-cdn.com/v4/letter/w/71c47a/32.png) [@weixiong100](https://dmap-community.ductus.global/u/weixiong100)\
**Post date:** [April 11, 2017, 1:33pm UTC](https://dmap-community.ductus.global/t/how-to-hide-the-action-button-on-the-web-confd/1148/3 "2017-04-11T13:33:41Z")

</div>

hi cohult,

thank you for your reply. I tried the “when” statement. however, when cannot be used inside the action. I have to put the action inside a container first, and use the “when” on the container. However, this is not what I want as it will force the user to click on the container, then can see the action button.

As for the NACM rule, I do not know enough about it. please point me to more detail about that.

For my user case, I want the same behavior for all users/groups. The “start” button will appear when the system mode is in manual, and disappear/disabled once the user click on the “start” button (meaning started already, cannot be clicked again) or if the user change the system mode to auto mode.

thank you

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [April 11, 2017, 2:22pm UTC](https://dmap-community.ductus.global/t/how-to-hide-the-action-button-on-the-web-confd/1148/4 "2017-04-11T14:22:25Z")

</div>

From what I understand, you likely want to use a tailf:hidden statement on your “tailf:action start” node. A tailf:set-hook can be used to hide and unhide the action. See UG for details on hidden and set-hook statements.  
Then of course, your javascript code for your button can check the values you want to determine if the button should be displayed/disabled.

---

<div class="post-metadata">

**Author:** ![weixiong100](https://avatars.discourse-cdn.com/v4/letter/w/71c47a/32.png) [@weixiong100](https://dmap-community.ductus.global/u/weixiong100)\
**Post date:** [April 11, 2017, 5:46pm UTC](https://dmap-community.ductus.global/t/how-to-hide-the-action-button-on-the-web-confd/1148/5 "2017-04-11T17:46:43Z")

</div>

thank you… will check
