Subject Re: beginappend() Problem Fixed
From Mervyn Bick <invalid@invalid.invalid>
Date Fri, 30 Jun 2023 17:25:12 +0200
Newsgroups dbase.getting-started

On 2023/06/30 09:31, Lee Grant wrote:
> Ken,
>
> Along these lines, and somewhat related to this, if I have custom
> buttons, that I include in the set procedure and use in the form, is
> there something that prevents the button from knowing the form's rowset
> relation and being able to beginAppend() the rowset?
>
> I've created buttons on the app that does it, but my question goes to
> the reason a custom button brought in from another file doesn't know the
> forms rowset for the form that it was placed on?

It doesn't know ANYTHING until you tell it.  A pushbutton actually does
absolutely nothing except sit on a form and look pretty. :-)

The pushbutton does have some events that the user can trigger.  The
event probably used most often is the onClick event.  The problem is
that even triggering an event does absolutely nothing unless the
programmer has assigned an event handler (function or codeblock) to the
event.  This is true whether one is using a standard pushbutton or a
custom pushbutton.

With a custom pushbutton there is a possibility that in the .cc file
event handlers have been assigned to events.  If no event handler has
been assigned in the .cc file to an event you want to use then simply
assign you own event handler exactly as you would with a standard
pushbutton.

If an event handler has been assigned to an event in the .cc file you
have two choices.  You can completely bypass the event handler in the
.cc file by assigning your own event handler as with a standard
pushbutton.  Alternatively you can set up your own event handler with
additional code and execute the event handler in the .cc file.
Depending on the actual code you may need to execute the event handler
in the .cc file before or after you execute your own code.


    function cust_but1_onClick
       cust_but_classname::onclick()
        //additional code
       return

or

    function cust_but1_onClick
        //additional code
       return cust_but_classname::onclick()

Mervyn.