Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PB7 - Why doesnt setFilter work twice in a row?

Status
Not open for further replies.

programmerbrian

Programmer
Sep 27, 2002
15
0
0
CA
I have a data window with multiple DDW's. Some of the display values should only show for historical records. When the user created a new record, Certain endated items should not appear and thus the user will not be able to select them. I thought that the solution would be to us the setfilter function like this:
dataWindowChild dwchild

dw_detail.getchild("DDW_1",dwchild)
dwchild.setfilter("isnull(end_date)")
dwchild.filter()

dw_detail.getchild("DDW_2",dwchild)
dwchild.setfilter("isnull(end_date)")
dwchild.filter()

This works for filtering the first DDW but it fails on the second.

Any suggestions on how to get this to work for multiple DDW's?

Thanks

 
Maybe, re-using the var is causing some trouble. Try declaring two dataWindowChild's:

dataWindowChild dwChild1, dwChild2
//
dw_detail.getchild("DDW_1",dwchild1)
dwchild1.setfilter("isnull(end_date)")
dwchild1.filter()

dw_detail.getchild("DDW_2",dwchild2)
dwchild2.setfilter("isnull(end_date)")
dwchild2.filter()

Do let us know if the above worked for you...

---
PowerObject!
-----------------------------------------
PowerBuilder / PFC Developers' Group
 
I thought that sharing the var was the problem too, but two different vars didnt help. I'm going to try to use the itemfocuschanged event, and or the getcurrentcolumn function dynamically filter which ever DDW that has been given focus. Works good with message boxes. :)

Thanks for looking at my problem. Helps to have help!

Cheers!

bri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top