I'm using Powerbuilder 12.5. In design mode I have expression on protected which is working how is intend. When i run application is not working at all. Any help please.
I'm using Powerbuilder 12.5. In design mode I have expression on protected which is working how is intend. When i run application is not working at all. Any help please.
Hi, Viktor:
I note in your comment to the first reply the expression you gave is: IF(cd_1=1 or cb_2=1,1,0), so I don't know if that is a typo error or if the expression you copy/pasted references cd_1 instead of cb_1.
I threw together in a couple of minutes, a bare-bones test application in PB9 and PB2017 R2 (I don't have PB12.5, sorry) and the expressions work as expected in both versions in the DW painter, when running the test app from the IDE, and when running the app from the compiled exe/pbd.
Each column (cbx1, cbx2, & cbx3) is data type number. Edit style: checkbox, 1 = on, 0 = off. Text is "One","Two","Three", respectively. The initial data value for each column is zero.
Protect expressions:
cbx1: If( cbx2 = 1 Or cbx3 = 1, 1, 0)
cbx2: If( cbx1 = 1 Or cbx3 = 1, 1, 0)
cbx3: If( cbx1 = 1 Or cbx3 = 1, 1, 0)
I also put a similar expression on the Font/Text color:
cbx1: If( cbx2 = 1 Or cbx3 = 1, RGB(192,192,192), 0) /* Light grey if protected, Black if not */
cbx2: If( cbx1 = 1 Or cbx3 = 1, RGB(192,192,192), 0)
cbx3: If( cbx1 = 1 Or cbx2 = 1, RGB(192,192,192), 0)
When I check one checkbox, the other two are protected. Only by un-checking the checkbox can I check one of the other two.
John
Hi Viktor;
Could you have more than one instance of the DWO ... one with the expression and one without? If yes ... depending on the library list, the DWO without the expression could be used at App run-time( vs what you see in the IDE).
Just a thought.
Regards ... Chris
Here my scenario: I have 3 check boxes on line with value 1 for checked and 0 for unchecked. The goal is if one is checked other two to be protected. So in expression fro cb_3 i wrote: IF(cd_1=1 or cb_2=1,1,0) for other two the logic is the same. In design mode works perfectly fine but in run time expression is not applying
It would help if you told us what the expression is.
I found my mistake. I had function that was overriding