Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Triggering button clicking on datawindow header

1,196 views
Skip to first unread message

Dean Jones

unread,
May 6, 2008, 10:48:57 AM5/6/08
to
the event is actually in the control, why not just trigger the event in the
control?

--
Dean Jones
CEO
PowerObjects
http://www.powerobjects.com
(612) 339-3355 Ext. 112

TeamSybase
* * Think Sybase * *


"Gwydion" <gwy...@oletros.info> wrote in message
news:48206e6d@forums-1-dub...
> Can I trigger clicked event on a button in datawindow header from the
> outside of the datawindow?


Gwydion

unread,
May 6, 2008, 10:42:53 AM5/6/08
to

Gwydion

unread,
May 6, 2008, 11:03:58 AM5/6/08
to
Dean Jones wrote:
> the event is actually in the control, why not just trigger the event in the
> control?
>

Is a strange case, the button has code embedded in the tag property
which call some functions in a number o classes but I must use a command
button in the window (users want this), so when I press the button I
have to simulate a click on the datawindow button (which will be invisible)

Yes, I know that is bizarre, messy and so on but I have no other possibility

Dean Jones

unread,
May 6, 2008, 11:17:19 AM5/6/08
to
I guess I have know idea how you can add code to a dw control button. It
does not have an event. If you click the button, where would the code
execute, or how does the code execute? If you have stuff in the tag, you can
grab that information using dot notation or describe. I thin you can even
evaluate the information to get it to execute. What I don't understand is
how the click of a dw button could execute anything other then the event on
the datawindow control. Now if you have a case statement in this event and
need to know which button was click you need to load some variables before
triggering the event.

TeamSybase
* * Think Sybase * *


"Gwydion" <gwy...@oletros.info> wrote in message

news:4820735e@forums-1-dub...

Chris Pollach

unread,
May 12, 2008, 11:28:21 AM5/12/08
to

Hi G;

The trick for sending and receiving the button events is that the
pointer "dwo" will not be valid from outside the DW Control. Sooo - Here is
what I do ...

Might I suggest the following:

1) Send DW Control a "ButtonClicked" event ...

DWObject lo_dwo
Long ll_row = 1
Long ll_rc = 0
Message.StringParm = "cb_chris"
dc.event buttonclicked (ll_row, ll_rc, lo_dwo)

2) Process the BC Event ...

String ls_name
IF IsValid (dwo) = TRUE THEN
ls_name = String (dwo.Name)
else
ls_name = Message.StringParm
END IF
MessageBox ("DWO", "You pressed CB - " + ls_name)


HTH

Regards ... Chris

"Gwydion" <gwy...@oletros.info> wrote in message

news:48206e6d@forums-1-dub...

Yeyi

unread,
May 12, 2008, 12:25:15 PM5/12/08
to
This might work:

dwobject ldwco

ldwco = dw_1.object.__get_attribute("cb_yourbutton", false)
dw_1.event buttonclicked (ll_row, ll_rc, ldwco)

On May 12, 11:28 pm, "Chris Pollach" <cpoll...@travel-net.com> wrote:
> Hi G;
>
> The trick for sending and receiving the button events is that the
> pointer "dwo" will not be valid from outside the DW Control. Sooo - Here is
> what I do ...
>
> Might I suggest the following:
>
> 1) Send DW Control a "ButtonClicked" event ...
>
> DWObject lo_dwo
> Long ll_row = 1
> Long ll_rc = 0
> Message.StringParm = "cb_chris"
> dc.event buttonclicked (ll_row, ll_rc, lo_dwo)
>
> 2) Process the BC Event ...
>
> String ls_name
> IF IsValid (dwo) = TRUE THEN
> ls_name = String (dwo.Name)
> else
> ls_name = Message.StringParm
> END IF
> MessageBox ("DWO", "You pressed CB - " + ls_name)
>
> HTH
>
> Regards ... Chris
>

> "Gwydion" <gwyd...@oletros.info> wrote in message

Jerry Siegel [TeamSybase]

unread,
May 12, 2008, 12:41:42 PM5/12/08
to
It would be better OO to refactor and create a single method which gets
called both from the button clicked and buttonclicked events.

"Chris Pollach" <cpol...@travel-net.com> wrote in message
news:48286215$1@forums-1-dub...

Jerry Siegel [TeamSybase]

unread,
May 12, 2008, 12:58:07 PM5/12/08
to
What a handy function. We should request an enhancement to make it
documented and supported.

"Yeyi" <yeyi.ab...@gmail.com> wrote in message
news:df9081a8-7a3d-41e8...@f36g2000hsa.googlegroups.com...

Chris Pollach

unread,
May 12, 2008, 2:12:48 PM5/12/08
to
Jerry;

I agree ... and it works great too! :-)

BTW: Michael Searer has this in the ISUG enhancement list as request # 3065
Please vote on this request to raise its viability.

Regards ... Chris
ISUG - NA RUG Director


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com> wrote in message
news:4828771f@forums-1-dub...

Yeyi

unread,
May 12, 2008, 11:57:07 PM5/12/08
to
Props to Jeremy Lakeman and Philip Salgannik for this, I'm not sure w/
c of you guys came out with it first =P

On May 13, 2:12 am, "Chris Pollach" <cpoll...@travel-net.com> wrote:
> Jerry;
>
> I agree ... and it works great too! :-)
>
> BTW: Michael Searer has this in the ISUG enhancement list as request # 3065
> Please vote on this request to raise its viability.
>
> Regards ... Chris
> ISUG - NA RUG Director
>

> "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com> wrote in messagenews:4828771f@forums-1-dub...


>
> > What a handy function. We should request an enhancement to make it
> > documented and supported.
>

> > "Yeyi" <yeyi.abulen...@gmail.com> wrote in message

Dean Jones

unread,
May 13, 2008, 8:28:16 AM5/13/08
to
Can't you get a pointer to an object using simple dot notation?

TeamSybase
* * Think Sybase * *


"Yeyi" <yeyi.ab...@gmail.com> wrote in message
news:df9081a8-7a3d-41e8...@f36g2000hsa.googlegroups.com...

0 new messages