简体   繁体   中英

How to set value of a field of the selected row in sap powerbuilder detail window

I wanted my project to hide/unhide column " my_column " of selected row at my detail data window. How can I achieve this. I am using SAP PoweBuilder 12.5. Below is my code:

this.modify("my_column_label.visible = true")
this.modify("my_column.visible = true")

In DataWindow:

1º) For example, select the column: "my_column"

2º) In its properties, locate "Visible" and click on its button "=" of expression

在此处输入图片说明

3º) Enter the code that determines when it should be visible, for example:

IF (not IsNull (my_column), 1, 0)

I assume your detail datawindow has multiple rows. The easiest way to do this is to modify the sql statement to return a computed column with the data set. Syntax is similar to this:

,'' as selected

Then in the datawindow painter set up an expression on the visible property of the column. Similar to:

if(selected[0] = 'Y', 1, 0)

Then in the clicked or rowfocuschanged event on the datawindow you set the value of 'selected' to 'Y' or 'N' depending upon if the row is selected or not, Remember setting something invisible does not mean it is protected, that is a separate property.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM