# How to disable and enable the button of the main view from popup view button

**URL:** <https://forum.inductiveautomation.com/t/how-to-disable-and-enable-the-button-of-the-main-view-from-popup-view-button/83299>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 19, 2023, 9:07am UTC](https://forum.inductiveautomation.com/t/how-to-disable-and-enable-the-button-of-the-main-view-from-popup-view-button/83299 "2023-12-19T09:07:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kavya\_shree](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kavya\_shree](https://forum.inductiveautomation.com/u/kavya_shree)\
**Post date:** [December 19, 2023, 9:07am UTC](https://forum.inductiveautomation.com/t/how-to-disable-and-enable-the-button-of-the-main-view-from-popup-view-button/83299/1 "2023-12-19T09:07:16Z")

</div>

Hi Team,  
Please find the screenshot below:  
When we click on button 1 in the Main view, this popup will open, then clicking on OK button, Button 1 from the Main View should be disable and Button 2 should be enable.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/f/0f75eb710fc8bc26988febaea7b96d4035359948.png)

I referred the previous links in the forum this can done by using session/message handler  
but I am not able to achieve, please help by the steps.

Thank you

---

<div class="post-metadata">

**Author:** ![Learner\_Ignition](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@Learner\_Ignition](https://forum.inductiveautomation.com/u/Learner_Ignition)\
**Post date:** [December 19, 2023, 10:23am UTC](https://forum.inductiveautomation.com/t/how-to-disable-and-enable-the-button-of-the-main-view-from-popup-view-button/83299/2 "2023-12-19T10:23:06Z")

</div>

Hi,

- Create a Parameter in Main view as **status**
- Create a event on Popup Ok button with a script as

`system.perspective.sendMessage("test", payload = {"status" : False}, scope = "page")`

- Create a script on Main view and add a Message Handlers type as **test** and write script as

```auto
status = payload["status"]
self.view.params.status = status

```

- Bind the parameter to the enable property of the button 1.

\*\*Change the name, scope and payload according to your need.

Thanks

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [December 19, 2023, 6:32pm UTC](https://forum.inductiveautomation.com/t/how-to-disable-and-enable-the-button-of-the-main-view-from-popup-view-button/83299/3 "2023-12-19T18:32:12Z")

</div>

Tip: you've posted this in **General Discussion** but it belongs to the **Ignition** category. Also, you need to tag it as **Perspective** so that you attract the right experts.

---

<div class="post-metadata">

**Author:** ![kavya\_shree](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kavya\_shree](https://forum.inductiveautomation.com/u/kavya_shree)\
**Post date:** [December 28, 2023, 8:56am UTC](https://forum.inductiveautomation.com/t/how-to-disable-and-enable-the-button-of-the-main-view-from-popup-view-button/83299/4 "2023-12-28T08:56:53Z")

</div>

Thank you. I got it.
