Solution model and call for a method on a form

Questions and answers for designing and implementing forms in Servoy

Solution model and call for a method on a form

Postby IT2Be » Tue Sep 15, 2015 10:03 am

Hi,

On my main form (opened on startup) I create a table view in solution model that is placed in a tables panel on that same main form.

The table shows data in a label with an on double click event method attached.

In that method I make a call to a method on the main form (basically its parent).

For some uses this works well, others get a message 'TypeError: Cannot call method 'getDetails' of undefined.
And it even happens random.

I tried calling the method like this:

forms.main.getDetails();

And, because I can, like this:

forms["main"];
forms["main"]["getDetails"]();

Both with the same result.

I can't think of this as being a loading issue but it sure looks like it :(

Any suggestions?
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4763
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Re: Solution model and call for a method on a form

Postby ROCLASI » Tue Sep 15, 2015 10:45 am

Hi Marcel,

So your SM created subform can't call the method on the main form? And this main form is visible when you click the label on the subform?
That really sounds like a bug in Servoy and I remember having seen this also at times. Didn't investigated it though.

What version of Servoy is this?
Robert Ivens
ROCLASI Software Solutions / JBS Group, Partner
SAN Developer / Servoy Valued Professional / Servoy Certified Developer
Twitter: @roclasi / @servoyforge
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5230
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Solution model and call for a method on a form

Postby mboegem » Tue Sep 15, 2015 10:49 am

Hi Marcel,

just to make sure the parent form is really 'main' and therefore loaded, can you output the formContext of the tableview?
Code: Select all
controller.getFormContext()


It should return a dataset containing the structure (top to bottom) of your forms & tabpanels
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1386
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands

Re: Solution model and call for a method on a form

Postby IT2Be » Tue Sep 15, 2015 11:02 am

Exactly how you describe it.

But it is real shit because people rely on it :(

BTW Using S7.4.3
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4763
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Re: Solution model and call for a method on a form

Postby IT2Be » Tue Sep 15, 2015 11:08 am

Hi Marc,

This is the result of the output:

BufferedDataSet {Columnnames [containername, formname, tabpanel/splitpane/accordion/beanname, tabname, tabindex, tabindex1based]}
row_1=[null, main, projectView, project_list, 0, 1]
row_2=[null, project_list, null, null, null, null]
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4763
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Re: Solution model and call for a method on a form

Postby mboegem » Tue Sep 15, 2015 11:28 am

IT2Be wrote:row_1=[null, main, projectView, project_list, 0, 1]
row_2=[null, project_list, null, null, null, null]


This is what I expected to see.
Interesting what the result will be when the error occurs.
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1386
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands

Re: Solution model and call for a method on a form

Postby IT2Be » Tue Sep 15, 2015 11:36 am

I added these one line before the error occurs :)

Further testing now...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4763
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Re: Solution model and call for a method on a form

Postby mboegem » Tue Sep 15, 2015 11:44 am

In the exceptional case the parent is not 'main' anymore but some other named instance of 'main', this should make it work:
Code: Select all
var _ds = controller.getFormContext();
   var _parent = _ds.getValue(_ds.getMaxRowIndex()-1,2);
   forms[_parent].getDetails();
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1386
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands

Re: Solution model and call for a method on a form

Postby IT2Be » Tue Sep 15, 2015 1:00 pm

That did not help Marc :(

Also renaming the form to 'mainForm' did not help.

The only thing we see is that removing the (default Servoy) authentication makes it work without error message.

Funny thing: there are no limits set to any form for any user/group (and certainly not the mainForm)...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4763
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Re: Solution model and call for a method on a form

Postby ROCLASI » Tue Sep 15, 2015 1:07 pm

Hi Marcel,

How random is this? Sounds to me you can reproduce it fairly consistent.
Robert Ivens
ROCLASI Software Solutions / JBS Group, Partner
SAN Developer / Servoy Valued Professional / Servoy Certified Developer
Twitter: @roclasi / @servoyforge
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5230
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Solution model and call for a method on a form

Postby IT2Be » Tue Sep 15, 2015 1:14 pm

yes, we can consistently reproduce it at random :)

I don't have it, others don't have it, some have it often but not always...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4763
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Re: Solution model and call for a method on a form

Postby ROCLASI » Tue Sep 15, 2015 1:17 pm

And it's always the same users/machines that have this?
Robert Ivens
ROCLASI Software Solutions / JBS Group, Partner
SAN Developer / Servoy Valued Professional / Servoy Certified Developer
Twitter: @roclasi / @servoyforge
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5230
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Solution model and call for a method on a form

Postby IT2Be » Tue Sep 15, 2015 1:23 pm

Looks like it yes...

BTW cache cleaning did not help either...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4763
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Re: Solution model and call for a method on a form

Postby goldcougar » Tue Sep 15, 2015 5:05 pm

IT2Be wrote:
The only thing we see is that removing the (default Servoy) authentication makes it work without error message.



Do all the actions in your application break, or just this button? Also does it happen immediately, or it works for a while, and then stops working later in a user's session? What I'm wondering is if its related to the session expiring, but not exiting the application like normal (like there is a small outage in the communication between the client and the server, leaving the solution in a bad state and for some reason doesn't recover).

For something like this, I would suggest the user go into their Java preferences and turn on the Java Console (assume this is in Smart Client?) to always show. Then when they get this error, ask for a screenshot and an output from the Java Console. It should have some good stuff in it.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Free Training Videos
Servoy Guy- Free Plugins, Tips & Resources
ServoyForge- Open Source Servoy Components
User avatar
goldcougar
Servoy Expert
 
Posts: 658
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: Solution model and call for a method on a form

Postby IT2Be » Thu Sep 17, 2015 11:20 pm

Hi Scott,

We did all that already.
Unfortunately it did not give us nothing but the info given in the first post.

For now we removed the login stuff and it works as expected.

Will do some further testing later on after deleting and re-importing the solution again.
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4763
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany


Return to Forms

Who is online

Users browsing this forum: No registered users and 1 guest

cron