Skip to Content
Nov 13, 2012 at 03:45 AM

Problem with DDDW, GetChild and SetTransObject after dw.Modify


I posted this on the sybase.public.powerbuilder.datawindow newsgroup, but then I saw it was being discontinued soon, so I apologize, I'm reposting it here.

OK, this is tricky. I have a data entry window in PB 11.5 with a DDDW. I want it to display the drop-down arrow at the right, so it's obvious to users it's that sort of field. But I also want it to automatically drop-down as soon as the user Tabs into the field.

So, I do:
dw.Modify(columnName + ".dddw.ShowList=Yes")
when the user enters the field.

That works perfectly. However, in some cases after that I need to re- retrieve the DDDW. I do:
dw.GetChild(columnName, ldwc)
That works fine. But
fails, returning -1. And then a call to ldwc.Retrieve() also returns -1.

If I take out the Modify() call, everything goes back to working perfectly.

I really don't want to just set the column to always show list, because as I mentioned I want the user to see that it's drop-down-able. I could make a tiny button that looks like the drop-down arrow, and position it to the right of the field, but the colours would only be correct (matching other drop-down arrows in the same or other DWs) if the user's Windows colour scheme was the same as mine.

Any bright ideas? (Other ways to immediately force a drop-down, for instance, that I could not find?) Thanks.