Project

General

Profile

Defect #229

keyListener() Not Releasing Other Methods

Added by Kim Premuda about 13 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Start date:
02/10/2011
Due date:
% Done:

0%

Estimated time:
Browser (if web client):

Description

Patrick - it was great meeting you at Servoy World! You asked me to remind you about this problem by posting it on ServoyForge. I use the keyListener(event) method mnay times in different modules within the same solution. In each keyListener(event) instance, I want to call another method called quickSearch() which is unique to each module. However, repeatedly using the same method name 'quickSearch' causes an error, and I have to resort to uniquely naming all 'quickSearch()' methods by appending a suffix to them (e.g. quickSearch_1(), quickSearch_2(), quickSearch_3(), etc.).

You thought the problem had to do with improper clean-up of some list in Java and that the method name was not being deleted...or, something to that effect. I hope this helps you to recall the issue.

function keyListener( event ) {
quickSearch_1( searchText )
}


Files

keyListenersExample.servoy (6.25 KB) keyListenersExample.servoy Patrick Talbot, 02/15/2011 06:30 PM

History

#1

Updated by Patrick Talbot about 13 years ago

Hi Kim, nice meeting you indeed!

I will have another look at this asap. Can you remind me the Servoy version and OS you have used for these results?

Thanks!

#2

Updated by Kim Premuda about 13 years ago

Currently, I am using Servoy v5.2.5 running on Windows 7 Utlimate v 6.1 build 7600. Although the problem is currently present in Servoy v5.2.5, it was present in previous versions of Servoy 5.2.x running on Windows 7. I believe the problem was also happening on my old laptop computer which was running Vista.

Thanks for looking into this!

#3

Updated by Patrick Talbot about 13 years ago

Hi Kim,

I just did a quick test, duplicating a form and keeping the names of methods and elements the same on both form and adding an output to see which callback method was called and I couldn't reproduce your issue. Clearly you are doing something somewhere which is triggering this...

Have a look at the sample attached (import in 5.2.5) and tell me how it goes for you.
Also make sure you are using the v1.2 jar from the Files section

If it is working in this sample but still not working for you, could you make a sample solution were I can see the behavior you have?

Thanks in advance.

#4

Updated by Kim Premuda about 13 years ago

Hi, Patrick.

I downloaded and successfully ran your keyListenersExample.servoy solution (I think it is the same one you sent to me last August). Since I patterned my code after your examples, I still could not see why your code worked and my code did not (they are similar in construct). In frustration, I was going to send you my form's .js file for you to peruse. The .js file contained other superfluous methods and variables, so I decided to delete the non-germane code when I came across an unused form variable nanmed 'quickSearch' which matched the 'quickSearch()' method name. I deleted the variable and 'voila' (sorry, my French is limited), the quickSearch() method executed without throwing an error!

To confirm that the same-named variable caused the problem, I attempted to re-create it, but Servoy would not allow it and emitted the message 'The method with the name quickSearch already exists'. I am perplexed as to how I was able to create 20 different forms containing the same-named variable and method. Perhaps, I started working with the keyListener plug-in in an earlier version of Servoy that did not trap this condition.

Regardless, the problem is on my end and the keyListener plug-in works fine. Thanks for all your hard work and dedication...I really appreciate your efforts!

#5

Updated by Patrick Talbot about 13 years ago

  • Status changed from In Progress to Closed

I would have never thought of that, but it's true that the callback is done from the name of the function, so I guess Rhino was confused about it.
Maybe if you do the opposite (create a variable then create a function with the same name) you will end up with the same problem.
Anyway, I'm glad to know it works in the end! Bravo!

Also available in: Atom PDF