Schultz’s PowerBuilder Notes

Setting the RowStatus

If you have worked with PowerBuilder for a while, you have learned that setting the status of a row is not always a straight forward procedure.  I have created a handy utility which will simplify this process.

Continue reading


January 1, 2009 Posted by | 2. Datawindows, Datawindow PowerScript, Powerscript | , , , , , , , , , , | 9 Comments

DBError Event

The DBError event fires in a DataWindow when a database error occurs as a result of an Update( ).

Continue reading

May 16, 2008 Posted by | DataWindow Control | , , , , | 2 Comments

DDDW Odds and Ends

Replacing the dddw dataobject

dw_parent.Modify( d_dddw_empsal_by_dept )

Getting the name of the dddw

ls_dddwname = idw_requestor.Describe(ls_columns[li_col] + “.dddwname”)

Datawindowchild as Instance variables

I had a window which had several columns which featured filtering and copying of dddw children data. After the datawindow refreshed its contents, this functionality no longer worked. I tracked this down to the fact that I was saving a reference to the dddw in an instance variable. Apparently, after the datawindow was refreshed, this reference was clobbered, and filtering or copying to this dddw resulted in an error. Oddly, another dddw reference was not clobbered. To solve this problem, I deleted the idwc and when I needed a reference to the dddw, I used a local variable.

DDDW display value must be unique

Sometimes users want the oddest things.

I had an interesting requirement where the user wanted the same display value for two different data values. When the drop down appeared, additional columns were viewed which made it clear which data value should be associated to the display value. The problem was that if the display value does not change, the itemchanged is not triggered and the item status does not change to xxxModified!. This was very surprising and hard to track down.

The solution was to make the display value unique. This was done be appending many blank spaces and then the data value to the display value. The blank padding pushes the data value, which the user does not want to see, out of view

Filter buffer inadvertently discarded

There is a PB bug (at least in 6.5, don’t know if was fixed in later versions) with filtering dddws. Sometimes, the filter buffer is discarded.

May 12, 2008 Posted by | Drop Down Data Window (DDDW) | , , , , , | Leave a comment