some minor issues on 2.2 beta

Johan,

I think things have become better since I changed something major. I need to explain a little better what we did:

Our users see only one form, basically. All other forms are loaded in a tab panel on that form (tabs are hidden, a navigation logic jumps to the right tab). Some of the forms that are shown have tab panels themselves, it can be nested up to five levels deep, maybe.

On most forms we apply “global logic”, for example the highlighting of required fields etc. We try to approach these issues “globally”, so we don’t have to change this on 55 forms. In the beginning we thought that the easiest way was to have for example a method _formOnShow in every form, that is fired onShow and that calls a global onShow method. The same for onHide, onRecordSelection, onLoad and so forth.

For us it seemed very easy then to do something “globally”. If, for example, somebody wants all integer fields with a green background (to make a stupid example), we could have easily created a global method that walks through the elements of form… and attach that to our global onShow method.

Since our solution has grown more complex, this technique is the source of lots of trouble, it seems. If we show one form with several tabs, tons of onShow, onLoad and onRecordSelection methods are called, all of these calling global methods and so forth. Yesterday I started to take out many of those that are not necessary (those, that could have been necessary one day…) and a few problems disappeared.

The things that do look better and that I have reported are the value list problem we discussed here (is gone now) and the strange changing to design mode if showing a dialog (strange error when showing a dialog - Classic Servoy - Servoy Community). In the latter case I noticed in the debugger, that when the dialog is shown all kinds of onLoad methods were executed, even though no new form was shown. The dialog was called in one form, just showing its message. It can’t see why this leads to the calling of several onLoads, but it did.

Maybe you can tell is if we were madmen to do what we did or if this kind of setup should actually work ok.

Thanks
Patrick

i can’t tell you that exactly, i need to see the solution for that.

But i can tell you how i work. I almost don’t create ANY global methods. I program in servoy just as i do in java.. Object based (form based). I don’t like to be completely generic.. ect. You can have global methods that do some standard things ofcourse. But in that global method you never should do thing like “if(currentcontroller.getName())” because when you do that then the method should belong to a form.

Most of the times you want to change something for a form Then jumping just to that form in the designer and editor you have a logical block of code..

I never use currentcontroller either. My onLoads etc. pass the formname to the global method as an argument.

But maybe it is interesting to see things getting fired if you do it my way? I know that things go wrong there, but I am starting to get convinced that this is not the most efficient way of doing it.

On the other hand, how do you, for example, mark required fields? Do you have a method attached on every form you want this? This seems a little unlogical to me, because the logic behind marking those fields is always the same…

Another example: I have a logic where you can configure record restrictions to a user and table. An administrator of my solution can pick a user and attach records that describe restrictions (fieldA = ‘abc’, fieldB = ‘def’) for a table. onLoad of any form, I retrieve the table of that form, see if there is a restriction and apply a foundsetfilter dynamically if there is. This is very handy using a global method. I don’t want to script this into every form…

one more little issue, I don’t know if feature or bug: when exporting a module from the repository the setting that the solution is a module is lost. This can be nasty if you want to update a module at some other location…

Servoy Developer
Version R2 2.2b2-build 317
Java version 1.4.2_06-b03 (Windows XP)

Added a new field to a Table and inserted it into three forms. But noticed later that it was not showing in Methods Editor under ‘selectedrecord’ or ‘record’ on any of the three forms so could not be referenced by any Methods.

Was fine after restarting Servoy.

Regards

GrahamG