# Syntax for Component Property in Client Event Script

**URL:** <https://forum.inductiveautomation.com/t/syntax-for-component-property-in-client-event-script/23505>\
**Category:** Ignition\
**Created:** [March 21, 2019, 1:02pm UTC](https://forum.inductiveautomation.com/t/syntax-for-component-property-in-client-event-script/23505 "2019-03-21T13:02:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [March 21, 2019, 1:02pm UTC](https://forum.inductiveautomation.com/t/syntax-for-component-property-in-client-event-script/23505/1 "2019-03-21T13:02:34Z")

</div>

I tried using event.source.parent.getComponent in a client event script, but I get an error message that says ‘event’ is not defined.

---

<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:** [March 21, 2019, 1:36pm UTC](https://forum.inductiveautomation.com/t/syntax-for-component-property-in-client-event-script/23505/2 "2019-03-21T13:36:19Z")

</div>

Which event? And for those that do have `event`, you can’t expect an `event.source` to be there, as they don’t occur in any window context.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [March 21, 2019, 1:57pm UTC](https://forum.inductiveautomation.com/t/syntax-for-component-property-in-client-event-script/23505/3 "2019-03-21T13:57:54Z")

</div>

I’m using the keystroke client event. If F3 is pressed, for instance, it would set a component property.

---

<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:** [March 21, 2019, 2:23pm UTC](https://forum.inductiveautomation.com/t/syntax-for-component-property-in-client-event-script/23505/4 "2019-03-21T14:23:57Z")

</div>

You’ll have to use `system.gui.getWindow()` or `.findWindows()` to obtain the relevant window (handling the window-not-open case) and drilling down into its components via its `rootContainer`. Client events don’t happen in a window or a component. They happen in the application at a global level.

If you want F3 to mean different things in different windows, you’ll have to code that into the one script.
