how use timer event in powerbuilder for changing multiple data windows

1.2k views Asked by At

I had a screen named w_main and i have 5 data windows

dw_one , dw_two , dw_three, dw_four ,dw_five

and here iam used the data windows in the screen with a user object uo_main,

i inserted a datawindow control to the uo_main , and in the open event i queried
Timer(5)

and in the timer event i queried as

uo_main.dw_1.dataobject = 'dw_one'
dw_1.insertrow(0);


uo_main.dw_1.dataobject = 'dw_two'
dw_1.insertrow(0);


uo_main.dw_1.dataobject = 'dw_three'
dw_1.insertrow(0);


uo_main.dw_1.dataobject = 'dw_four'
dw_1.insertrow(0);


uo_main.dw_1.dataobject = 'dw_five'
dw_1.insertrow(0);

this is to change the dataobject in the datawindow in every 5 seconds but its not working, how i make it possible,

its a updates displaying screen like project but i have to work it with powerbuilder.

1

There are 1 answers

0
Marc Vanhoomissen On

Create five datawindow controls in your object, called dw_1 up to dw_5, and connect them respectively to the various datawindow objects dw_one up to dw_five (in design mode - you do not have to code everything). In such a case, your code would be:

dw_1.insertrow(0);
dw_2.insertrow(0);
dw_3.insertrow(0);
dw_4.insertrow(0);
dw_5.insertrow(0);

and every 5 seconds, you would see one more record in all those controls. Do not forget to connect the dw_1 to dw_5 to a database if DB interaction is needed (dw_1.settransObject(SQLCA) for instance).