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

Manually triggering ItemChanged event within code

660 views
Skip to first unread message

Patricia Cipriani

unread,
Jun 26, 2003, 8:05:58 PM6/26/03
to
Hi Guys,

Can any one tell me how I create the DWO object that the itemchanged event
wants in order to be triggered?

I can't figure it out for the life of me.

This is only one of several attempt I have made, which crashes.

DWObject ldw_object

ldw_object.name = dw_1.Object.we_date
THIS.Event ItemChanged(1, ldw_object, ls_date)

Thanks in advance.

Patricia


PowerObject!

unread,
Jun 26, 2003, 9:28:02 PM6/26/03
to
DWObject ldw_Object
//
ldw_Object = dw_1.Object.<column-name> // we_date ?
This.Event ItemChanged( 1, ldw_Object, ls_Date )

---
PowerObject!
-----------------------------------------
http://Groups.Yahoo.com/group/PowerObject
PowerBuilder / PFC Developers' Group

Scott Morris

unread,
Jun 27, 2003, 10:40:16 AM6/27/03
to
This approach will generally not work. There are certain assumptions built
into the event logic that cannot be replicated (afaik) outside of that
event. Foremost is the fact that the data that is about to be accepted into
the current column/row (as specific in the event arguments) is not actually
in the datawindow's data buffers.

The best way to handle this is to move the code that you need to execute
from multiple places to a user-defined event (or function) and call that
event (or function) from the itemchanged event and any other place that it
is needed.

"Patricia Cipriani" <cipr...@londonhydro.com> wrote in message
news:ubysUDLPDHA.301@forums-2-dub...
> Hi
> I tried that but it crashes with a NULL object reference on the
ItemChanged
> event when I reference dwo.name.
>
> __________________________________________________
> dw_1.ItemChanged Event Code:
>
> CHOOSE CASE dwo.name
> .....
>
> ___________________________________________________
> dw_1.ButtonClicked Event code
>
> DWOJECT ldwo_object
> ldw_object = dw_1.Object.we_date
> THIS.Event ItemChanged(1, ldw_Object, ls_date)
>
> Thanks,
> Patricia
>
>
> <PowerObject!> wrote in message
> news:9EF81F8D2268E97E00080F1885256D52.0005740A85256D52@webforums...

bede

unread,
Jun 27, 2003, 10:11:18 AM6/27/03
to
- does the DW exist? does it have a valid dataobject assigned?
- inspect the objects in the debugger
- what version of PB?

"Patricia Cipriani" <cipr...@londonhydro.com> wrote in message
news:ubysUDLPDHA.301@forums-2-dub...
> Hi
> I tried that but it crashes with a NULL object reference on the
ItemChanged
> event when I reference dwo.name.
>
> __________________________________________________
> dw_1.ItemChanged Event Code:
>
> CHOOSE CASE dwo.name
> .....
>
> ___________________________________________________
> dw_1.ButtonClicked Event code
>
> DWOJECT ldwo_object
> ldw_object = dw_1.Object.we_date
> THIS.Event ItemChanged(1, ldw_Object, ls_date)
>
> Thanks,
> Patricia
>
>
> <PowerObject!> wrote in message
> news:9EF81F8D2268E97E00080F1885256D52.0005740A85256D52@webforums...

Patricia Cipriani

unread,
Jun 27, 2003, 9:26:37 AM6/27/03
to
Hi
I tried that but it crashes with a NULL object reference on the ItemChanged
event when I reference dwo.name.

__________________________________________________
dw_1.ItemChanged Event Code:

CHOOSE CASE dwo.name
.....

___________________________________________________
dw_1.ButtonClicked Event code

DWOJECT ldwo_object
ldw_object = dw_1.Object.we_date
THIS.Event ItemChanged(1, ldw_Object, ls_date)

Thanks,
Patricia


<PowerObject!> wrote in message
news:9EF81F8D2268E97E00080F1885256D52.0005740A85256D52@webforums...

Biju Nair

unread,
Jun 27, 2003, 3:43:02 PM6/27/03
to
Ben,

Shouldn't it be

DWObject ldwo
Long ll_row
...
ll_row = dw_1.GetRow()
ldwo = dw_1.Object.we_date[ll_row]
THIS.Event ItemChanged(1, ldw_object, ls_date)
???

Patricia,
Why would you need to call Itemchanged event?
Wouldn't it be better to use a SetColumn(), SetText(ls_date) and then call a
AcceptText() to trigger an Itemchanged event?
Or else you can directly use SetItem()

Thanks,
Biju

"bede" <be...@nospam.sofico.be> wrote in message
news:%23Qlv72HPDHA.186@forums-2-dub...
> Assign a valid dwo to the declared variable (don't assign it to the name
> property)
>
> DWObject ldwo
> ...
> ldwo = dw_1.Object.we_date
> THIS.Event ItemChanged(1, ldw_object, ls_date)
>
> Ben


>
> "Patricia Cipriani" <cipr...@londonhydro.com> wrote in message

> news:eke86DEPDHA.186@forums-2-dub...

bede

unread,
Jun 27, 2003, 3:22:45 AM6/27/03
to
Assign a valid dwo to the declared variable (don't assign it to the name
property)

DWObject ldwo
...
ldwo = dw_1.Object.we_date
THIS.Event ItemChanged(1, ldw_object, ls_date)

Ben

"Patricia Cipriani" <cipr...@londonhydro.com> wrote in message
news:eke86DEPDHA.186@forums-2-dub...

0 new messages