# openView callback called twice in the InstallationNodeContribution

**URL:** <https://forum.universal-robots.com/t/openview-callback-called-twice-in-the-installationnodecontribution/182>\
**Category:** URCap Development\
**Tags:** java-error\
**Created:** [August 18, 2016, 2:01pm UTC](https://forum.universal-robots.com/t/openview-callback-called-twice-in-the-installationnodecontribution/182 "2016-08-18T14:01:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon93510157](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@anon93510157](https://forum.universal-robots.com/u/anon93510157)\
**Post date:** [August 18, 2016, 2:01pm UTC](https://forum.universal-robots.com/t/openview-callback-called-twice-in-the-installationnodecontribution/182/1 "2016-08-18T14:01:00Z")

</div>

When I click on the installation tab and that my installation node was already selected, the callback openView() is called twice. To reproduce it:

1. Add some console trace in the openView method
2. Select the installation node
3. Press on the tab Program
4. Press on the tab Installation
5. You should se the trace printed twice.

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [August 19, 2016, 9:32am UTC](https://forum.universal-robots.com/t/openview-callback-called-twice-in-the-installationnodecontribution/182/2 "2016-08-19T09:32:30Z")

</div>

You are correct, that `openView()` is called twice when toggling from Program to an open Installation node.  
However `closeView()` is called twice as well, so the math should add up, and you will end up with the `openView()`.

![](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/1X/05a35c77096301a0de809393e4cc60cebcbd9779.png)

Normally, toggling between two different installation- or program nodes will only yield 1 `closeView()`and `openView()`

For the ProgramNode the behaviour is:  
 ![](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/1X/f11f3af5516ea2ebca42b976027573b6a85e580b.png)

Generally, the `@Override` methods, such as `openView()`, `closeView()`, `isDefined()` etc. should be designed in a way, so they are lean and not very resource consuming, as this might affect the responsiveness of the GUI.

E.g. the `isDefined()`method is called every time a change is made in the program.  
Hence, you should not have any remote calls or methods with slow response time in `isDefined()`

 ![](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/1X/b4419ce8d01477e11caa7499769ed96e1cc6a61a.png)

(Valid for SDK 1.0.0.7)

---

<div class="post-metadata">

**Author:** ![anon93510157](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@anon93510157](https://forum.universal-robots.com/u/anon93510157)\
**Post date:** [August 19, 2016, 11:49am UTC](https://forum.universal-robots.com/t/openview-callback-called-twice-in-the-installationnodecontribution/182/3 "2016-08-19T11:49:48Z")

</div>

The problem we have with the openView/closeView called twice is that we set  
the visibility of a widget from those callbacks so it flickers on the  
screen. That is not a major issue but it looks strange.

2016-08-19 5:42 GMT-04:00 Jacob Bom Madsen \<  
[universal\_robots@discoursemail.com](mailto:universal_robots@discoursemail.com)\>:

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/system/32/1_2.png) [@system](https://forum.universal-robots.com/u/system)\
**Post date:** [January 19, 2021, 6:58pm UTC](https://forum.universal-robots.com/t/openview-callback-called-twice-in-the-installationnodecontribution/182/4 "2021-01-19T18:58:07Z")

</div>

Closed on January 19, 2021, 6:58pm UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
