# Servoy 6 warning

**URL:** https://forum.servoy.com/t/servoy-6-warning/14613
**Category:** Classic Servoy
**Created:** [September 8, 2011, 5:13pm UTC](https://forum.servoy.com/t/servoy-6-warning/14613 "2011-09-08T17:13:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Juan\_Etec](https://avatars.discourse-cdn.com/v4/letter/j/b4bc9f/32.png) [@Juan\_Etec](https://forum.servoy.com/u/Juan_Etec)
#### Post date: [September 8, 2011, 5:13pm UTC](https://forum.servoy.com/t/servoy-6-warning/14613/1 "2011-09-08T17:13:29Z")

</div>

I don´t know how to solve this a warning :  
example  
var popupmenu = plugins.window.createPopupMenu()  
var menuitem1 = popupmenu.addMenuItem(‘Print’,imp\_agend\_event\_frm,null)  
var popupmenu = plugins.window.createPopupMenu()  
var source = event.getSource()  
if (source!=null) popupmenu.[u] **show** /u;

Warnig  
The method show(RuntimeComponent,Number,Number) in the type Popup is not applicable for the  
arguments (Object)

How to avoid or suppress this warning:  
I know the Tag @SuppressWarnings but I cannot used for that case.  
example  
**forms[myForm].form\_field**  
Warning  
The property form\_fieldis undefined for the type Form

---

<div class="post-metadata">

### Author: ![jasantana](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@jasantana](https://forum.servoy.com/u/jasantana)
#### Post date: [September 8, 2011, 5:50pm UTC](https://forum.servoy.com/t/servoy-6-warning/14613/2 "2011-09-08T17:50:51Z")

</div>

I

> Juan Etec:  
> I don´t know how to solve this a warning :  
> example  
> var popupmenu = plugins.window.createPopupMenu()  
> var menuitem1 = popupmenu.addMenuItem(‘Print’,imp\_agend\_event\_frm,null)  
> var popupmenu = plugins.window.createPopupMenu()  
> var source = event.getSource()  
> if (source!=null) popupmenu.[u] **show** /u;
> 
> Warnig  
> The method show(RuntimeComponent,Number,Number) in the type Popup is not applicable for the  
> arguments (Object)
> 
> How to avoid or suppress this warning:  
> I know the Tag @SuppressWarnings but I cannot used for that case.  
> example  
> **forms[myForm].form\_field**  
> Warning  
> The property form\_fieldis undefined for the type Form

Hi Juan, create a JSDoc for source.

---

<div class="post-metadata">

### Author: ![Juan\_Etec](https://avatars.discourse-cdn.com/v4/letter/j/b4bc9f/32.png) [@Juan\_Etec](https://forum.servoy.com/u/Juan_Etec)
#### Post date: [September 9, 2011, 7:32am UTC](https://forum.servoy.com/t/servoy-6-warning/14613/3 "2011-09-09T07:32:44Z")

</div>

Hi Juan,  
I don’t understand what do you want to say to me.  
I put for the first example the event in the JSDOC (\* @param {JSEvent} event), but when you declare the variable ‘source’ it take the type Object and not RuntimeComponent.

> example  
> var popupmenu = plugins.window.createPopupMenu()  
> var menuitem1 = popupmenu.addMenuItem(‘Print’,imp\_agend\_event\_frm,null)  
> var popupmenu = plugins.window.createPopupMenu()  
> var source = event.getSource()  
> if (source!=null) popupmenu.show(source,null,null);
> 
> Warnig  
> The method show(RuntimeComponent,Number,Number) in the type Popup is not applicable for the  
> arguments (Object,Number,Number)

and for the second example is difficult to put a proper param because you can pass any form who can have any field.

> example  
> forms[myForm].form\_field  
> Warning  
> The property form\_fieldis undefined for the type Form

Thanks

---

<div class="post-metadata">

### Author: ![jasantana](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@jasantana](https://forum.servoy.com/u/jasantana)
#### Post date: [September 9, 2011, 8:12am UTC](https://forum.servoy.com/t/servoy-6-warning/14613/4 "2011-09-09T08:12:30Z")

</div>

Sorry Juan I did not explain myself because I was answering from my iPhone and it´s not easy to type with my big fingers.

```auto
var popupmenu = plugins.window.createPopupMenu()
var menuitem1 = popupmenu.addMenuItem('Print',imp_agend_event_frm,null)
var popupmenu = plugins.window.createPopupMenu()

// Next line will avoid the warning
/** @type RuntimeComponent */
var source = event.getSource()
if (source!=null) popupmenu.show(source,null,null);

```
