VO 2 - Just learning - need help! 
Author Message
 VO 2 - Just learning - need help!

I want to know how to work with a server on a data window which has no
attached server but is attached to the sub-data window.  Basically,
I want to just add, delete, ect with buttons on the parent window but
want the browse view sub-data window look.

Thanks.




Mon, 27 Sep 1999 03:00:00 GMT  
 VO 2 - Just learning - need help!

Todd

Why don't you just use the data window to show the DBServer in #BrowseView
instead of using a subDataWindow.

--
Steve Quinn
BRUTE Computer Services - Australia

http://www.brutecom.com.au



Quote:
> I want to know how to work with a server on a data window which has no
> attached server but is attached to the sub-data window.  Basically,
> I want to just add, delete, ect with buttons on the parent window but
> want the browse view sub-data window look.

> Thanks.





Mon, 27 Sep 1999 03:00:00 GMT  
 VO 2 - Just learning - need help!

Quote:

> I want to know how to work with a server on a data window which has no
> attached server but is attached to the sub-data window.  Basically,
> I want to just add, delete, ect with buttons on the parent window but
> want the browse view sub-data window look.

The best thing is to subclass all the classes that are created
automatically by VO and then attach yourself the data servers to the
datawindows, then you only work with one dataserver, for example:

        // VODataWindow - Class created by the window editor
        Class MyDataWindow Inherit VODataWindow
                Protect oMyDBServer as ClientDBServer
        Method Init(oOwner) Class MyDataWindow

                // Call parent
                super:Init(oOwner)

                self:oMyDBServer := ClientDBServer{}
                self:oSF_SubDataWindow:Use(self:oMyDBServer)    // the subdatawindow
created by VO

                // This line is only necessary if you want to work with the server on
this dataWindow
                self:Use(self:oMyDBServer)

        return self

And if you want to access the Protected variable from the subdataWindow
you can access it with the Server Property or you can declare it as
export or declare an access method like:

        Access oMyDBServer Class MyDataWindow
        return self:oMyDBServer

Remember not to attach a server on the window editor, because it is not
necessary.

I hope it helps.

Regards,

Lus Gomes,
QED Informtica



Mon, 27 Sep 1999 03:00:00 GMT  
 VO 2 - Just learning - need help!



Quote:

> > I want to know how to work with a server on a data window which has no
> > attached server but is attached to the sub-data window.  Basically,
> > I want to just add, delete, ect with buttons on the parent window but
> > want the browse view sub-data window look.

> The best thing is to subclass all the classes that are created
> automatically by VO and then attach yourself the data servers to the
> datawindows, then you only work with one dataserver, for example:
[snip]
> Lus Gomes,
> QED Informtica


Hi Everyone,

        Following on from the above, and because I have no theoretical background
in matters IT, I would like to get some opinions on subclassing, pros and
cons and any other thoughts.

        With VO2 and its PreInit() and PostInit() methods and an "Inherit from"
property for just about everything, what are the thoughts about
subclassing?

        I have been trying to make use of the new features and haven't encountered
any problems as yet that I could attribute to the lack of a subclassing
regime.

        Are there any deep theoretical issues that I should be aware of?  Is there
any good advice from someone who has been bitten by not subclassing in VO2?
 Will this post take the minds of some contributors off the "what went
wrong with the vote on the new newsgroups" issue? <g>

--
Regards

Don Andersen
RAT Software
Database Programming, Accounting Solutions, PC Support
Phone +61 07 3881 2432
QUEENSLAND AUSTRALIA

"I never forget anything I remember"



Wed, 29 Sep 1999 03:00:00 GMT  
 VO 2 - Just learning - need help!

Quote:

> Hi Everyone,

> With VO2 and its PreInit() and PostInit() methods and an "Inherit
> from" property for just about everything, what are the thoughts about
> subclassing?

IMO, subclassing is still an issue if you follow strict OOP guidelines.
In the past, we (meaning VO 1.0 users) used sub-classing to get around
specific code behavior we wanted to get into a class, like a window,
without having the generated source code from the WED overwrite our
changes.   With the PreInit() and PostInit() (and the // don't modify
below this line), that's not needed.  However, the point of "specific"
code behavior should not get in the way of a good OOP design.  For
example, in making SP-CLASSic nuVO 2.2 for VO 2.0, I still use
sub-classing when building a base "helpabout" window.  For all other
applications with "specific" information, sub-classing and adding text
to the controls makes more OOP sense to me than using the PreInit() or
PostInit() of a class.

I guess what I'm saying is that for HOW we were using sub-classing in VO
1.0, the PreInit() and PostInit() methods are ideal.  Notwithstanding
that, there really is still a need to sub-class if you think of building
base windows or base servers that will be sub-classed in the future.

Oh, by the way.... don't forget about the CLONE feature in VO 2.0.  It's
often overlooked.

Again, that's just the way I see it from a design perspective and not an
implementation perspective.

Just a thought...

Steve
Sirius Press, Inc.
http://www.siriuspress.com

Quote:

>         I have been trying to make use of the new features and haven't encountered
> any problems as yet that I could attribute to the lack of a subclassing
> regime.

>         Are there any deep theoretical issues that I should be aware of?  Is there
> any good advice from someone who has been bitten by not subclassing in VO2?
>  Will this post take the minds of some contributors off the "what went
> wrong with the vote on the new newsgroups" issue? <g>

> --
> Regards

> Don Andersen
> RAT Software
> Database Programming, Accounting Solutions, PC Support
> Phone +61 07 3881 2432
> QUEENSLAND AUSTRALIA

> "I never forget anything I remember"



Wed, 29 Sep 1999 03:00:00 GMT  
 VO 2 - Just learning - need help!



[snip]

Quote:
> I guess what I'm saying is that for HOW we were using sub-classing in VO
> 1.0, the PreInit() and PostInit() methods are ideal.  Notwithstanding
> that, there really is still a need to sub-class if you think of building
> base windows or base servers that will be sub-classed in the future.
[snip]
> Steve
> Sirius Press, Inc.
> http://www.siriuspress.com

Steve,

        Does this mean that, for a window used in a SPECIFIC application and
nowhere else, I inherit from <whatever_class>, eg, DataWindow, and within
the SPECIFIC application, I make use of Pre- and PostInit() methods?  

        If I need to enhance the capabilities of DataWindow, do I put my subclass
into my class library as:
        CLASS RatDataWindow INHERIT DataWindow
                ........
                <improved functionality>
                ............
then, in the WED, "Inherit From" RatDataWindow?

        Are there suggested activities that could/should be performed in Pre- and
PostInit()s?

Don Andersen



Thu, 30 Sep 1999 03:00:00 GMT  
 VO 2 - Just learning - need help!

Quote:

> Steve,

> Does this mean that, for a window used in a SPECIFIC application and
> nowhere else, I inherit from <whatever_class>, eg, DataWindow, and
> within the SPECIFIC application, I make use of Pre- and PostInit()
> methods?

Yes, BUT... and here's the big BUT.  The window you design TODAY may be
SPECIFIC TODAY but may be use in the future for other pending
applications.  Just because we have a window editor to do all of this
painting for us, we also have a great OOP language that needs to be,
IMO, utilized.  For example, would you even think about creating a
generic HELPABOUT{} window?  No, probably not... many of us would just
re-create one over and over again.  Rather than get specific, step back
and take a look at what you are designing and ask if it can be applied
in other places.  Now, you may have to granulate out certain behaviors.
Fine, but I don't hope we don't loose site of the OOP paradigm for the
sake of some neat and useful properties in a WED.

Quote:

> If I need to enhance the capabilities of DataWindow, do I put my
> subclass
> into my class library as:
>         CLASS RatDataWindow INHERIT DataWindow
>                 ........
>                 <improved functionality>
>                 ............
> then, in the WED, "Inherit From" RatDataWindow?

Well, yes if those "capabilities" have long-term ramifications.

Quote:
> Are there suggested activities that could/should be performed
> in Pre- and PostInit()s?

Well, in our SP-DATADIALOG{} class, for example, part of the new
SP-CLASSic nuVO 2.2 for VO 2.0.  There is a method called
ClearControls().  In the PostInit() of that window, I check to see if
there is an attached server to the window and if that instance is an
inherited instance from the SP-BUFFEREDSERVER{} class.  If so, when the
window is instantiated, all of the values in the attached controls are
cleared.  That is idea for a PostInit() call.

Think of the PostInit() call as the NEW way to code things where in the
past we used the EXPOSE() method in VO 1.0c.  There, we knew that that
method would be called just prior to the window being "shown" on the
screen.  The PostInit() helps hold that type of coding.

BTW, could you check to see if our web site is back on-line?

HTH,

Steve
Sirius Press, Inc.
http://www.siriuspress.com



Thu, 30 Sep 1999 03:00:00 GMT  
 VO 2 - Just learning - need help!

Don

Quote:
>         Does this mean that, for a window used in a SPECIFIC application and
> nowhere else, I inherit from <whatever_class>, eg, DataWindow, and within
> the SPECIFIC application, I make use of Pre- and PostInit() methods?

>         If I need to enhance the capabilities of DataWindow, do I put my subclass
> into my class library as:
>         CLASS RatDataWindow INHERIT DataWindow
>                 ........
>                 <improved functionality>
>                 ............
> then, in the WED, "Inherit From" RatDataWindow?

Absolutely.  I have my own library where the datawindows add themselves
to a child windows array of the owner window as they are opened and
remove themselves when they are destroyed.  I inherit from this class in
the window editor.

Quote:
>         Are there suggested activities that could/should be performed in Pre- and
> PostInit()s?

Its really down to your program flow.  If you are displaying a column
from a secondary server in the browse, then you will need to open the
server before the browse is created, in the PreInit() method.  If you
want to change the window caption, you would do it after the window has
been created, in the PostInit(), since the caption is assigned in the
Init() method.

Sean
-------------------------------------------------------------------

CA (UK) Technical Support
-------------------------------------------------------------------



Fri, 01 Oct 1999 03:00:00 GMT  
 VO 2 - Just learning - need help!

Todd

Quote:
> I want to know how to work with a server on a data window which has no
> attached server but is attached to the sub-data window.  Basically,
> I want to just add, delete, ect with buttons on the parent window but
> want the browse view sub-data window look.

To do this all you have to do is send the appropriate message to the
subform when the appropriate button is clicked.  For example, the Add
button, the click event should look like:

METHOD Add() CLASS MYDataWindow
Self:oSFSubform:Append()

Sean
-------------------------------------------------------------------

CA (UK) Technical Support
-------------------------------------------------------------------



Fri, 01 Oct 1999 03:00:00 GMT  
 VO 2 - Just learning - need help!

Quote:

> Its really down to your program flow.  If you are displaying a column
> from a secondary server in the browse, then you will need to open the
> server before the browse is created, in the PreInit() method.  If you
> want to change the window caption, you would do it after the window has
> been created, in the PostInit(), since the caption is assigned in the
> Init() method.

I agree with this up to a point which is not to foresake program flow
for good OOP class design.  Program flow is fine for the immediate needs
but I'm sure you'll agree that long-term planning and leveraging good
OOA and OOP design is how future applications can better be served.
Mind you, this is just an opinion ...

Cheers,

Steve
Sirius Press, Inc.
http://www.siriuspress.com



Fri, 01 Oct 1999 03:00:00 GMT  
 VO 2 - Just learning - need help!

Steve

Quote:
> Mind you, this is just an opinion ...

Ah, sorry, I really try not to express opinions here but that one just
slipped out.  I'll be more careful in future <G>.

Sean
-------------------------------------------------------------------

CA (UK) Technical Support
-------------------------------------------------------------------



Sat, 02 Oct 1999 03:00:00 GMT  
 
 [ 23 post ]  Go to page: [1] [2]

 Relevant Pages 

1. VO: Need advice in VO programming

2. Begginer in VO need help!!

3. VO - Need Help for DialogWindow

4. VO 1.0 browser help needed.

5. Help on VO needed !

6. Vo help needed with DbServer:appendSdf() method

7. VO 2.0 Tab controls - help needed

8. VO Help Needed

9. Help with VO 1.0c - need to change DBServer DBF path

10. VO: Need help PO Entry Screen

11. CA-VO 1.0C - Help Needed !

12. VO and MicroSoft SQL Server Help needed

 

 
Powered by phpBB® Forum Software