Omnis and subwindows

I've been way to busy lately to do any personal posts however today there was a topic on the Omnis discussion list about subwindows and communication between them and their parent windows that made me want to write a little something about it. The topic has come up many times in the past and since it is something I've done a lot with it seemed like a good idea to do a little sample library and add some explanation.

Subwindows are basically windows that are contained within another window. They are Omnis Studio's answer to be able to reuse visual components in multiple places in your application. This can be anything from a subwindow containing a single component/field to a subwindow that allows you to enter an entire record consisting of a dozen entry fields.

The problem herein is how to properly communicate between the subwindow and its parent window.
Object Orientation states that any object should not assume or directly influence another object that contains/uses it. That is the only way to guarantee an object can be reused in multiple places without any restrictions in the behavior of the object that uses it. A subwindow and it's parent however always have a symbiotic relationship in one form or another and some measure of communication between them is required. The parent window communicating with the subwindow is easy as this is simply done through public methods, but the subwindow (as it interacts directly with the user) communicating back to the parent, now their lies the problem.



Read more ...

Add to: Digg | Technorati | del.icio.us | Stumbleupon | reddit | Furl