controller.find() results in set property error

Questions, tips and tricks and techniques for scripting in Servoy

Re: controller.find() results in set property error

Postby Foobrother » Thu Jul 09, 2009 11:21 am

I already made the test to know what is returned by
Code: Select all
forms[v_filter_form]['v_f_' + forms[v_rf_form].fld_field_name]

it returns <null> because 'v_f_' + forms[v_rf_form].fld_field_name doesn't exist.
I get the same result on Developer and Sever

The weird think is that it still work on Developer but not on Server. Don't know why.
The other problem is that I don't really know what this non-existing variable represents exactly as it's not me but my colleague who developed it. And he is on holiday until the 20th :(
Current configuration: Servoy 5.2.6 Build 1011, Java 6u24, PostgreSQL 8.3, Windows Server 2003

Servoy / Java Developer
http://www.assetguardian.com
User avatar
Foobrother
 
Posts: 530
Joined: Tue Jan 13, 2009 5:46 pm

Re: controller.find() results in set property error

Postby Andrei Costescu » Thu Jul 09, 2009 11:28 am

If this is the problem indeed, then it might happen because that code can invoke more of your code in onLoad hooks for example and you do somplace else something to terminate the find mode.
2 other forms may be loading right then for the first time and trigger those hooks.

And maybe while running in developer these forms are already loaded when you test.
So you can pin-point the cause much easier by breaking down that line even more and seing what triggers the findmode to terminate.
If you cannot find any such event handlers/hooks you registered being triggered by that code then it may be a bug and you can add it to the support system without a sample solution for further investigation (but please mention this thread in the case).
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: controller.find() results in set property error

Postby Andrei Costescu » Thu Jul 09, 2009 11:30 am

Foobrother wrote:I already made the test to know what is returned by
Code: Select all
forms[v_filter_form]['v_f_' + forms[v_rf_form].fld_field_name]

it returns <null> because 'v_f_' + forms[v_rf_form].fld_field_name doesn't exist.


I meant you should check to see that after you execute this find mode is still true, wasn't interested in the result.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: controller.find() results in set property error

Postby Foobrother » Mon Jul 13, 2009 11:46 am

I have broken down the list causing the problem and have detected the exact bit causing the find to return false:
I did:
Code: Select all
var a = 'v_f_';
//Test1
var b = forms[v_rf_form].fld_field_name;
//Test2
var c = forms[v_filter_form][a+b];
//Test3

At Test3 it returns false. Also As I said before, 'a+b' doesn't exist, so c == <null>. Apparently that's what causing the problem?! Do you think it can be that? Or it's more likely that it was another "concurrent" bit of code which does that?
But if it was another bit of code which does that, it would go to false a random moments and not exactly at this instruction each time?! :roll:
Current configuration: Servoy 5.2.6 Build 1011, Java 6u24, PostgreSQL 8.3, Windows Server 2003

Servoy / Java Developer
http://www.assetguardian.com
User avatar
Foobrother
 
Posts: 530
Joined: Tue Jan 13, 2009 5:46 pm

Re: controller.find() results in set property error

Postby Andrei Costescu » Mon Jul 13, 2009 1:01 pm

"forms[v_filter_form][a+b]" could trigger a load of the form "v_filter_form".
Have a look at form events attached to this form. Do any of those get executed when this line of code is reached?
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: controller.find() results in set property error

Postby Foobrother » Mon Jul 13, 2009 2:18 pm

Done the test: it returns False just after
Code: Select all
var x = forms[v_filter_form]['v_f_' + forms[v_rf_form].fld_field_name];


EDIT: checked if "v_filter_form" was calling other methods but in fact the form in the variable doesn't exist. I know, there is a problem with the forms names apparently but I don't think it's the cause of the find to be OFF :roll:
Last edited by Foobrother on Mon Jul 13, 2009 2:29 pm, edited 1 time in total.
Current configuration: Servoy 5.2.6 Build 1011, Java 6u24, PostgreSQL 8.3, Windows Server 2003

Servoy / Java Developer
http://www.assetguardian.com
User avatar
Foobrother
 
Posts: 530
Joined: Tue Jan 13, 2009 5:46 pm

Re: controller.find() results in set property error

Postby Andrei Costescu » Mon Jul 13, 2009 2:24 pm

Foobrother wrote:Done the test: it returns False just after...

I don't understand. What test did you do? Did you check the method you have registered for onLoad method of form represented by "v_filter_form" to see if it gets called?
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: controller.find() results in set property error

Postby Foobrother » Mon Jul 13, 2009 2:31 pm

Andrei Costescu wrote:I don't understand. What test did you do? Did you check the method you have registered for onLoad method of form represented by "v_filter_form" to see if it gets called?

In the post you have edited you told me to verify with the following line
Code: Select all
var x = forms[v_filter_form]['v_f_' + forms[v_rf_form].fld_field_name];
to make sure it was the culprit

Btw I have replied to your new post by editing my old one

EDIT: Ooops sorry my mistake! Was reading your post in page 1 (the last post of the page)! :oops:
Current configuration: Servoy 5.2.6 Build 1011, Java 6u24, PostgreSQL 8.3, Windows Server 2003

Servoy / Java Developer
http://www.assetguardian.com
User avatar
Foobrother
 
Posts: 530
Joined: Tue Jan 13, 2009 5:46 pm

Re: controller.find() results in set property error

Postby Andrei Costescu » Mon Jul 13, 2009 2:35 pm

Ok. And what about "v_rf_form" form? Could it trigger an onLoad method?
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: controller.find() results in set property error

Postby Foobrother » Mon Jul 13, 2009 2:37 pm

Andrei Costescu wrote:Ok. And what about "v_rf_form" form? Could it trigger an onLoad method?

For v_rf_form all Events are at "none"
Current configuration: Servoy 5.2.6 Build 1011, Java 6u24, PostgreSQL 8.3, Windows Server 2003

Servoy / Java Developer
http://www.assetguardian.com
User avatar
Foobrother
 
Posts: 530
Joined: Tue Jan 13, 2009 5:46 pm

Re: controller.find() results in set property error

Postby Andrei Costescu » Mon Jul 13, 2009 2:48 pm

Is "v_rf_form" based on the same table as "v_form"?
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: controller.find() results in set property error

Postby Foobrother » Mon Jul 13, 2009 2:51 pm

I have checked again the whole solution. I have made another discovery now and I really don't understand why it's working on Developer!
In fact some "family" of forms have "_copy" added to their name. I don't know if it's Servoy which changed their name or my colleague who changed it. But in the program apparently it still do as if it wasn't change. And indeed, v_form that I'm testing from the start doesn't exist.

But I don't have any error when I run it on Developer :shock:

Andrei Costescu wrote:Is "v_rf_form" based on the same table as "v_form"?

No
Current configuration: Servoy 5.2.6 Build 1011, Java 6u24, PostgreSQL 8.3, Windows Server 2003

Servoy / Java Developer
http://www.assetguardian.com
User avatar
Foobrother
 
Posts: 530
Joined: Tue Jan 13, 2009 5:46 pm

Re: controller.find() results in set property error

Postby Andrei Costescu » Mon Jul 13, 2009 3:02 pm

Hmm, maybe the problem is more basic then. You should see what all the code is doing and what's the matter with those forms first. Maybe correct the wrong accesses to forms and fields... Debug some more.

Also check that you committed all the changes from developer into the application server. Don't know how you are developing... for example if you are using the Servoy team provider with "localhost" to commit to your server, doing a team-synchronize should show any differences between your workspace based repository and app. server repository.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: controller.find() results in set property error

Postby Foobrother » Mon Jul 13, 2009 3:15 pm

Andrei Costescu wrote:Hmm, maybe the problem is more basic then. You should see what all the code is doing and what's the matter with those forms first. Maybe correct the wrong accesses to forms and fields... Debug some more.

Yeah probably.

Andrei Costescu wrote:Also check that you committed all the changes from developer into the application server. Don't know how you are developing... for example if you are using the Servoy team provider with "localhost" to commit to your server, doing a team-synchronize should show any differences between your workspace based repository and app. server repository.

Actually I never touched this solution (its code) before. The guy, who developed it, is on holiday, as I said, and gave me the .servoy file to install it on our test server and then test it. He was the only person who worked on it. But I know that the forms were not called like that (with "_copy") in the previous versions.

Anyway, will try to find and let you know if I have something new.
Current configuration: Servoy 5.2.6 Build 1011, Java 6u24, PostgreSQL 8.3, Windows Server 2003

Servoy / Java Developer
http://www.assetguardian.com
User avatar
Foobrother
 
Posts: 530
Joined: Tue Jan 13, 2009 5:46 pm

Re: controller.find() results in set property error

Postby Foobrother » Mon Jul 13, 2009 5:11 pm

Another funny one :?

When I call the method "application.getMethodTriggerFormName();" from a form which has "_copy" at the end it returns the name of the without "_copy".
I double-checked: I don't have any form in developer called like what is output by the solution! Only "formNameReturned+_copy".
Current configuration: Servoy 5.2.6 Build 1011, Java 6u24, PostgreSQL 8.3, Windows Server 2003

Servoy / Java Developer
http://www.assetguardian.com
User avatar
Foobrother
 
Posts: 530
Joined: Tue Jan 13, 2009 5:46 pm

PreviousNext

Return to Methods

Who is online

Users browsing this forum: No registered users and 41 guests