Solution model and call for a method on a form

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?

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?

Hi Marcel,

just to make sure the parent form is really ‘main’ and therefore loaded, can you output the formContext of the tableview?

controller.getFormContext()

It should return a dataset containing the structure (top to bottom) of your forms & tabpanels

Exactly how you describe it.

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

BTW Using S7.4.3

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]

IT2Be:
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.

I added these one line before the error occurs :)

Further testing now…

In the exceptional case the parent is not ‘main’ anymore but some other named instance of ‘main’, this should make it work:

var _ds = controller.getFormContext();
	var _parent = _ds.getValue(_ds.getMaxRowIndex()-1,2);
	forms[_parent].getDetails();

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)…

Hi Marcel,

How random is this? Sounds to me you can reproduce it fairly consistent.

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…

And it’s always the same users/machines that have this?

Looks like it yes…

BTW cache cleaning did not help either…

IT2Be:
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.

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.