Thanks Hans for coming up with ideas.
If you create the controls in the window constructor everything
should be fine then or? No need to put references into constructors.
yes I need references.... My Window acts like a global Storage for my
DataBinder(s), because I can have several windows open each
representing a different view on the database.
Step 1:
So in the constructor method of certain 'TableViewer
ContainerControl', I init this 'DataBinder' object(s) and attach them
to Window.
Step 2:
In the 'Open Event' all the Control/Container controls that needs
data from a certain DataBinder, they call the Window to see if
DataBinder exists and keep a Reference to it for later use.
A second solution would be to add a init method to the container
contol, which could be called in the windows constructor.
That doesn't work because RB has bugs. It can't make a difference
(since I last checked a few weeks ago) and my bug report hasn't been
updated, between container controls and rect controls. So I can't
make my own general method that walks through all controls. and in
case I meet a containerControl I call the special Init method. I'm
trying to build a general solution because I have about 100
'TableViewer ContainerControls' that are being dynamically swapped
in/out etc...
BUT:
I currently came up with a solution, but I found it a Hack, because
it isn't as elegant that I initially had constructed, until I start
having trouble with multiple windows.
I create a new class that is called DataBinderStorage
before I open up a Window or access a Window, I do the following
app.DataBinderStorage = new DataBinderStorage
aNewWindow = new Window_DatabaseViewer
in the constructor I have written the following
myWindow.constructor
begin
app.mMainWindow = self
self.mDataBinderStorage = app.mDataBinderStorage
end
Activate
do
app.mDataBinderStorage = self.mDataBinderStorage
end
.... similar for other events....
In the "TableViewer ContainerControl".Constructor
do
if (not app.DataBinderStorage.Exist("T_ORDER_LINE[T_ORDER]")) then
app.DataBinderStorage.AddDataBinder(new cDataBinder
("T_ORDER_LINE[T_ORDER]")
end
end
cheers
mvo
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>