Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 712
  • Last Modified:

Drop Down Data Window - How to refresh the data??


Hi experts!

how do you refresh the data inside the datawindow drop down list??

i have a window with one datawindow (dw_1) in it.... this data window works like a drop dow list

whenever i run this script..

long new_id

new_id = dw_1.getitemnumber( 1, 1)

delete from tablename where id = :new_id;

dw_1.reset()
dw_1.retrieve()

the record i selected for deletion.. is still in the list.. but once you close and open the window.. and check the list again.. it will not be there anymore..

i dont want to user to close and open the window just to refresh the list.. can anyone help me pls..

arnel










0
arnel1257
Asked:
arnel1257
  • 2
  • 2
1 Solution
 
sandeep_patelCommented:
Hi,

say you have datawindow dw_1 and column emp_id is dddw.

Datawindowchild child1

dw_1.GetChild('emp_id',child1)
child1.SetTransObject(SQLCA)
child1.Retrieve()

you can write this script after dw_1.Retrieve() in your script

Regards,
Sandeep
0
 
arnel1257Author Commented:
in my window .. i have one datawindow which is dw_1 which has a data object of d_emp_id  which has a column of emp_id... and inside this d_emp_id.. i have another data object d_dd_emp_list which has two column.. emp_name which is the display column and emp_id which is the data column..

0
 
sandeep_patelCommented:
Hi,

so whatever the code i have writen will work for you as your column emp_id in dataobject d_emp_id has edit style of dropdowndatawindow.

in above code

dw_1.Getchild('emp_id',child1)

where,
dw_1 : datawindow control object name ( you have the same )
emp_id : column name in dataobject attached to dw_1 having edit style dropdowndatawindow ( in your case emp_id is the column name in dataobject d_emp_id attached to dw_1 having edit style dddw and dataobject is d_dd_emp_list)
child1 : is variable of type Datawindowchild to get reference of dddw attached to column 'emp_id'

For more detail see help of GetChild function.

Regards,
Sandeep
0
 
arnel1257Author Commented:
thanks sandeep.. it works!!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now