1. Dan Cooperstock
  2. PowerBuilder
  3. Saturday, 2 January 2021 19:28 PM UTC

I saw a previous thread that was related to this but nothing there worked for me.

I have a DDDW on a DW, that has some rows with italicized display values, and some non-italic, based on an undisplayed field in the DDDW.

I would like the DW to immediately change the field that contains the DDDW to italic if a row is selected from it that is italicized, and vice versa.

I have code that basically works, except you have to tab out or otherwise move out of the field before that happens. I'm even posting the call to the function that evaluates the value on the current row of the DDDW and sets the field to be italic or not, but that doesn't help.

I have confirmed that ItemChanged is firing as soon as I make a selection from the DDDW.

A secondary problem is I'm trying to call that same function after the initial retrieve of the data in the DW, but in that case, the GetRow() call on the retrieved DataWindowChild always returns 1, not the row associated with the value that is being displayed. (That GetRow call does work perfectly when the function is called from the ItemChanged event.)

Any bright ideas on either problem? Thank you.

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Saturday, 2 January 2021 22:15 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi, Dan - 

From what you've described, it sounds like what you are experiencing is that the Edit Control (the dynamically placed mechanism that handles all user input in a DW) is not immediately reflecting the property change in the underlying column DWObject. The edit control was probably not designed to change its appearance while focus stays on a column, but only when a column DWO receives focus.

If this is indeed the case, I think your options are limited. You might be have to perform a little sleight-of-hand to trick the Edit Control. If it were me, I would try to (a) SetRedraw(false), (b) SetColumn to another column, (c) Change the Italic property in the original column, (d) SetColumn back to the original column, and (e) SetRedraw(True). I've no idea if this will work, but this is what I would try.

I hope it works for you.

Regards, John

Thank you, great idea. Just using the SetColumn to another column before setting the italic property, then SetColumn back to the desired column, solved it. SetRedraw (which I had actually already tried!) wan't required.
  1. Dan Cooperstock
  2. Saturday, 2 January 2021 22:23 PM UTC
IMO, this is a bug. if you do a modify or an expression value changes, it should change the edit control display properties as well. I bet it probably always worked that way, but it is still a display bug. I've run into this myself.

this work around only works if you have more than 1 editable column in a datawindow.
  1. mike S
  2. Sunday, 3 January 2021 21:10 PM UTC
There are no comments made yet.
Dan Cooperstock Accepted Answer Pending Moderation
  1. Saturday, 2 January 2021 21:37 PM UTC
  2. PowerBuilder
  3. # 1

I solved my secondary problem, which is that when I called the functions after retrieving the row, they always thought the child DW (the DDDW) was on row 1. The solution was to read the value from the main DW column value, find that value in the child DW, and do a SetRow to go to the row number it was found at.

But I still don't have any good ideas for the main problem, of not seeing changes based on ItemChanged until I tab out of the field.

There are no comments made yet.
  • Page :
  • 1

There are no replies made for this question yet.
However, you are not allowed to reply to this question.