# Perspective Request Focus in Window

**URL:** <https://forum.inductiveautomation.com/t/perspective-request-focus-in-window/26899>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [July 26, 2019, 8:33am UTC](https://forum.inductiveautomation.com/t/perspective-request-focus-in-window/26899 "2019-07-26T08:33:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pawel.kondol](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@pawel.kondol](https://forum.inductiveautomation.com/u/pawel.kondol)\
**Post date:** [July 26, 2019, 8:33am UTC](https://forum.inductiveautomation.com/t/perspective-request-focus-in-window/26899/1 "2019-07-26T08:33:14Z")

</div>

Hello,

I tried to transfer one of my Vision projects to Perspective.  
I have android based scanner and 2 text fields where I want operators to scan Work Order Number and Part Number. In Vision, I just added script RequestFocusInWindow() and it works perfect, however the same script is not working in Perspective module.  
Am I missing something there or it is impossible.

Best regards  
Pawel

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [July 26, 2019, 11:44am UTC](https://forum.inductiveautomation.com/t/perspective-request-focus-in-window/26899/2 "2019-07-26T11:44:56Z")

</div>

The main thing to keep in mind when converting vision to perspective, is all of the scripts are executed at the gateway scope. so depending on what this script is trying to do, the functions may not work or may need additional parameters.

I also haven’t messed with component focus yet in perspective, so there may be some quirks there too.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 26, 2019, 2:03pm UTC](https://forum.inductiveautomation.com/t/perspective-request-focus-in-window/26899/3 "2019-07-26T14:03:09Z")

</div>

As @grietveld said previously, all Perspective scripts execute on the Gateway, so be aware that any scripting you’re doing in Perspective will execute in the Gateway scope - even if the method has multiple scopes available to it.

With that being said, Perspective uses Views/Pages, not Windows (these are a Vision concept), so the `requestFocusInWindow()` method is of no use to you here.

What you could do is directly address the component you’d like to put focus onto and apply focus to it:

**From another component:**

```auto
self.getSibling('TextField').focus()

```

**From the root container:**

```auto
self.view.rootContainer.getChild('TextField').focus()

```

---

<div class="post-metadata">

**Author:** ![pawel.kondol](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@pawel.kondol](https://forum.inductiveautomation.com/u/pawel.kondol)\
**Post date:** [July 29, 2019, 7:06am UTC](https://forum.inductiveautomation.com/t/perspective-request-focus-in-window/26899/4 "2019-07-29T07:06:14Z")

</div>

Thanks a million. This is working.
