Servoy 6 warning

Questions, tips and tricks and techniques for scripting in Servoy

Servoy 6 warning

Postby Juan Etec » Thu Sep 08, 2011 7:13 pm

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.show(source);

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
Un Saludo

Juan Ramírez
Juan Etec
 
Posts: 64
Joined: Mon Apr 20, 2009 8:23 pm
Location: Gran Canaria - Spain

Re: Servoy 6 warning

Postby jasantana » Thu Sep 08, 2011 7:50 pm

I
Juan Etec wrote: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.show(source);

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.
User avatar
jasantana
 
Posts: 555
Joined: Tue Aug 10, 2010 11:40 am
Location: Leeds - West Yorkshire - United Kingdom

Re: Servoy 6 warning

Postby Juan Etec » Fri Sep 09, 2011 9:32 am

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
Un Saludo

Juan Ramírez
Juan Etec
 
Posts: 64
Joined: Mon Apr 20, 2009 8:23 pm
Location: Gran Canaria - Spain

Re: Servoy 6 warning

Postby jasantana » Fri Sep 09, 2011 10:12 am

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.


Code: Select all
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);   
Best regards,
Juan Antonio Santana Medina
jasantana@nephos-solutions.co.uk
Servoy MVP 2015
Servoy 6.x - Servoy 7.x - Servoy 8.x - MySQL - PostgreSQL - Visual Foxpro 9
User avatar
jasantana
 
Posts: 555
Joined: Tue Aug 10, 2010 11:40 am
Location: Leeds - West Yorkshire - United Kingdom


Return to Methods

Who is online

Users browsing this forum: No registered users and 12 guests

cron