1. Stefanos Evangelopoulos
  2. PowerBuilder
  3. Friday, 13 December 2024 08:25 AM UTC

Hi, in PB2025 Beta2,  we cannot modify the background color of the DataWindow Detail band via script or with the expression in the properties dialog when theme applied. The modify command has no effect. We can change the color in the json theme file via "datawindow" >  "grid-style" > "detail-band" > "background-color" but we want to set a special rule for the background color depending on a value or coloring alternate rows  if(mod(getrow(),2)=0,rgb(229,234,238),rgb(255,255,255))

Thanks

Andreas Mykonios Accepted Answer Pending Moderation
  1. Friday, 13 December 2024 09:23 AM UTC
  2. PowerBuilder
  3. # 1

Hi.

Have you tried this in Powerbuilder 2022 R3? If yes, are you seeing the same behavior?

Generally, when using themes, the background color of your datawindows is set by themes. But, there is a way to change that. You have to modify your theme.json file from:

...

	"datawindow":
	{
		"drawing":true,
		"background-color-enabled":true,

...

to

...

	"datawindow":
	{
		"drawing":true,
		"background-color-enabled":false,

...

That way, the expressions should work. But this means that themes won't control at all the background color of your datawindows!

Now, this may not be what exactly you want to achieve. You may need such a behavior for certain datawindows. This can be done by setting a custom theme. Check the documentation in the following link:

Specifying application properties - - Users Guide

Based on the above documentation, you can add a custom theme that would affect a specific control. Example:

"w_mywindow.dw_mydatawidnow":
{
	"drawing":true,
	"background-color-enabled":false,
	...
}

This may be a way to achieve your goal.

Andreas.

 

Comment
There are no comments made yet.
Stefanos Evangelopoulos Accepted Answer Pending Moderation
  1. Friday, 13 December 2024 09:45 AM UTC
  2. PowerBuilder
  3. # 2

Hi Andreas,

In Powerbuilder 2022 R3 is working fine. In Powerbuilder 2025 Beta is not working even if we set the background-color-enabled to false.

"datawindow":
	{
		"drawing":true,
		"background-color-enabled":false,

even if it worked, we only want it in the case of the grid-style datawindow.

Yes we can set theme properties for specific controls but this is not the case, and we want the behavior of Powerbuilder 2022 R3 

In the article https://community.appeon.com/index.php/articles-blogs/tutorials-articles/2-powerbuilder/230-applying-a-new-ui-theme-to-your-application

in the section "How to set the background color of DataWindow" says that:

"Solution:

You can set by the following method:

Method 1: Use the following script to modify the background color of the DataWindow Detail band:

dw_1.modify("datawindow.detail.color = "+string(il_BackColor))

Method 2: Use the expression in the properties dialog to modify the background color of the DataWindow Detail band. "

This is not working in Powerbuilder 2025 Beta

 

Comment
  1. Andreas Mykonios
  2. Friday, 13 December 2024 09:55 AM UTC
You are right. This should work. I also can confirm that in PB 2022 R3 it works fine. Even when "background-color-enabled":true. I would suggest you submit a bug about this by replicating the issue in a small application. Provide the pbl from PB 2022 R3, and ask them to migrate it to PB 2025 and see the difference. Currently I haven't tested this behavior in PB 2025 Beta.

Andreas.
  1. Helpful
  1. Stefanos Evangelopoulos
  2. Friday, 13 December 2024 10:04 AM UTC
ΟΚ Andreas, for the point we are using PowerBuilder 2025 Build 3484
  1. Helpful
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Friday, 13 December 2024 10:07 AM UTC
  2. PowerBuilder
  3. # 3

Sorry, I just tested an application in PB 2025. This is what you want to achieve?

(Here the first row has a different color because it's the selected one). Using Flat Design Gray.

The screenshot is from an application running in Powerbuilder 2025... In this specific test I'm using expressions in the designer.

What Build are you using?

Andreas.

Comment
  1. Stefanos Evangelopoulos
  2. Friday, 13 December 2024 10:27 AM UTC
PowerBuilder 2025 Build 3484
  1. Helpful
  1. Stefanos Evangelopoulos
  2. Friday, 13 December 2024 10:31 AM UTC
In Solution not workpspace, if it matters..
  1. Helpful
  1. Andreas Mykonios
  2. Friday, 13 December 2024 10:41 AM UTC
I don't believe that it matters if it's a solution or not... I'm trying to understand if this is the issue you are facing...

Andreas.
  1. Helpful
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Friday, 13 December 2024 11:03 AM UTC
  2. PowerBuilder
  3. # 4

Did again some tests. This time I used runtime 3484. Converted to solution (but I am pretty sure that this cannot make a difference in that specific issue).

The above datawindow shows a follows:

I'm using an expression (if(mod(getrow(), 2)=1, rgb(192, 220, 192), rgb(192, 220, 0)) in background color with vertical gradient).

I have added a button <none> that executes the following command:

dw_contracts_funds.modify("datawindow.detail.color = 12639424~tif(mod(getrow(), 2)=1, rgb(192, 220, 192), rgb(192, 220, 0))")

When pressing that button I see no change on my datawindow. But when testing the same in PB 2022 r3, the space on right of column max date changes color. So I do see a different behavior.

Also, setting:

...

	"datawindow":
	{
		"drawing":true,
		"background-color-enabled":false,

...

seems to have no effect in PB 2025 Beta, while in PB 2022 R3 I do see the background color that I set in the datawindow.

So I can say that I do see at least two points where the behavior differs.

Andreas.

Comment
There are no comments made yet.
Stefanos Evangelopoulos Accepted Answer Pending Moderation
  1. Friday, 13 December 2024 11:31 AM UTC
  2. PowerBuilder
  3. # 5

Andreas,

without theme and without gradient mode and using the expression in background color of the detail band: if(mod(getrow(), 2)=1, rgb(192, 220, 192), rgb(192, 220, 0))  , I have the following:

 

Applying the Flat Design Grey Theme I have the Following:

the test was done with pure datawindow control in Powerbuilder 2025 build 3484 using the json themes of PowerBuilder 2025

 

 

 

 

Comment
  1. Andreas Mykonios
  2. Friday, 13 December 2024 11:48 AM UTC
Ok. This is a bug in my opinion. I do the coloring in a different way. That's why it works for me.

Andreas.
  1. Helpful
There are no comments made yet.
kitty he @Appeon Accepted Answer Pending Moderation
  1. Monday, 16 December 2024 03:09 AM UTC
  2. PowerBuilder
  3. # 6

Hi Stefanos,

 

Thank you for raising this issue.

 

PB 2025 UI theme has added support for setting the background color of DataWindow bands. In the theme.json file, you can now define the background-color for the detail-band, summary-band, and footer-band in grid-style DataWindows. However, due to this new functionality, the background-color setting in theme.json takes precedence, causing expressions for background color to not work as expected.

 

In practice, users often set colors in the detail band of the DataWindow to display different row colors based on conditions. We are looking into optimizing this by either adding a toggle for band background colors or prioritizing expressions over theme settings.

 

We suggest you submit this issue through a ticket so that we can follow up promptly and keep you updated on the progress:
https://www.appeon.com/standardsupport/newbug

 

Regards,
Kitty

Comment
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.