# Component scripting don't run in preview mode

**URL:** <https://forum.inductiveautomation.com/t/component-scripting-dont-run-in-preview-mode/27835>\
**Category:** Ignition\
**Created:** [August 28, 2019, 1:50pm UTC](https://forum.inductiveautomation.com/t/component-scripting-dont-run-in-preview-mode/27835 "2019-08-28T13:50:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![GeraGarcia](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/geragarcia/32/18471_2.png) [@GeraGarcia](https://forum.inductiveautomation.com/u/GeraGarcia)\
**Post date:** [August 28, 2019, 1:50pm UTC](https://forum.inductiveautomation.com/t/component-scripting-dont-run-in-preview-mode/27835/1 "2019-08-28T13:50:42Z")

</div>

I have in the Window a button that supossed to launch a messageBox, the detail is when it run in preview mode, the button no react, a text in simple quotes and double quotes and not run the code or display the message. the ignition version is 7.9.

In the next archives display the window with the button “Enviar” and the Component Scripting

```auto
system.gui.messageBox("Gondola registrada exitosamente en la via 1")

```

also try with:

```auto
system.gui.messageBox('Gondola registrada exitosamente en la via 1')

```

 ![Imagen1](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/2651c64d490c69c44ca9bafab4137c22a1a104fd.png) ![Imagen2](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/8a27ca130d50c4e174759aadda1a559f9c5589af.png) ![Imagen3](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/d120eaf3c7cc47a27b79464cdac21a5fdaccdde7.png)

I have also reviewed the option in the section Project and it mark the option “read and write”

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 28, 2019, 1:55pm UTC](https://forum.inductiveautomation.com/t/component-scripting-dont-run-in-preview-mode/27835/2 "2019-08-28T13:55:33Z")

</div>

Your screenshot suggests that you’ve attached this script to “Group 15” instead of the pushbutton. The group won’t get clicks that land on the components within. Also, for buttons, you should use the `actionPerformed` event, instead of the `mouseClicked` event.
