1. Kari Paukku
  2. PowerBuilder
  3. Friday, 1 December 2023 05:29 AM UTC

Hi,

I have a data window (dw) with that has a column which also has a drop-down-datawindow list box (dddw). The PB version is PB CloudPro, 2022R2,  build 2819

Here is an example;

A dw has one column bord_type (header text is "Type") and in this case the data has value "L" with the dddw maps to be "Loss"

Here is the initial retrieve

The MakeDisplayOnly = TRUE button has one line

 dw_1.Modify( "bord_type.Edit.DisplayOnly = 'Yes'")

What happens next, is that the text from the dddw disappears and the true value from the database is shown,

Is this expected behaviour?

Making the column protected doesn't have this effect, but I would preref to use the "DisplayOnly" option, if possible.

Thanks,
kari

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Friday, 1 December 2023 16:04 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi, Kari - 

Last night I tested your scenario in PB 2017 R3 and got the same results as you.

In looking at the documentation in PB Help for the topic titled "Edit.property (DataWindow object)", the description at the beginning of this Help topic states "Settings that affect the appearance and behavior of columns whose edit style is Edit" (emphasis added). The column you are dynamically modifying uses the DropDownDW edit style. This is why you do not see a means of setting the DisplayOnly property in the "Edit" tab in the Properties pane of the DataWindow painter whenever the style type is set to DropDownDW.

I believe the issue is you're using Edit.DisplayOnly in a manner for which it is not designed or intended. Using the Protect property is the proper way to prevent a user from modifying the value in a column that uses the DDDW edit style.

Best regards, John

 

Comment
  1. Kari Paukku
  2. Friday, 1 December 2023 16:19 PM UTC
John,

yes I agree. I did come to the same conclusion when testing different ways to do this. The approach I took is that if the field doesn't have a dddw, then it is DisplayOnly. If it has a dddw, then it is protected.



Kari
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.