Hi all,
I have a problem with PowerBuilder10.
I'm a new PB programmer and so many things can be not trivial for me... please if you want to help me don't provide too much "high-level" answers, thank's!!
Let's go with technical details:
I have defined a datawindow which retrieve data from a table (SQL Select's results can be multi-row). I have defined some fields to display retrieved data and a button (say CLOSE_UDC) to perform a given action above the data retrieved. The action performed is an Update of the origin table and must be followed by a refresh of the windows displayed data.
No problem encountered with the Update and the data refresh ;-)
The problems arise here:
the window displays n rows, and for each row the button CHIUDI_UDC is enabled/visible depending on the property settings set in the datawindows painter (via the check-box in the property tab).
=> I want to enable/disable the button run-time and independently for each single row, depending on the value of some fields of the specific row (as I want to close only opened UDC items).
I don't want to use the condition editor in the painter, but I want to edit my own script.
I've inserted the following script in the RETRIEVEROW() method:
IF isnull(is_ccaus_sdocu) OR isnull(il_ycale) OR isnull(il_nprot_ddocu) OR (ls_bchiu_dudcx<>'N') THEN
dw_lista_udc.Object.close_udc.Enabled ="No"
ELSE
dw_lista_udc.Object.close_udc.Enabled ="Yes"
END IF
(and also using the Modify method as follows:
dummy = dw_lista_udc.Modify("close_udc.Enabled ='No'"))
but the result is not the desired one: ALL Close_UDC buttons in the window are enabled/disabled regarding to the last enabling operation performed in the Retrieverow() method.
It seems that I'm correctly fetching all rows (verified in debug), but I'm not modifying the properties of the button single instances but the properties of al buttons altogether.
I can't go on with my task, please can you help me???
Thank's a lot
I have a problem with PowerBuilder10.
I'm a new PB programmer and so many things can be not trivial for me... please if you want to help me don't provide too much "high-level" answers, thank's!!
Let's go with technical details:
I have defined a datawindow which retrieve data from a table (SQL Select's results can be multi-row). I have defined some fields to display retrieved data and a button (say CLOSE_UDC) to perform a given action above the data retrieved. The action performed is an Update of the origin table and must be followed by a refresh of the windows displayed data.
No problem encountered with the Update and the data refresh ;-)
The problems arise here:
the window displays n rows, and for each row the button CHIUDI_UDC is enabled/visible depending on the property settings set in the datawindows painter (via the check-box in the property tab).
=> I want to enable/disable the button run-time and independently for each single row, depending on the value of some fields of the specific row (as I want to close only opened UDC items).
I don't want to use the condition editor in the painter, but I want to edit my own script.
I've inserted the following script in the RETRIEVEROW() method:
IF isnull(is_ccaus_sdocu) OR isnull(il_ycale) OR isnull(il_nprot_ddocu) OR (ls_bchiu_dudcx<>'N') THEN
dw_lista_udc.Object.close_udc.Enabled ="No"
ELSE
dw_lista_udc.Object.close_udc.Enabled ="Yes"
END IF
(and also using the Modify method as follows:
dummy = dw_lista_udc.Modify("close_udc.Enabled ='No'"))
but the result is not the desired one: ALL Close_UDC buttons in the window are enabled/disabled regarding to the last enabling operation performed in the Retrieverow() method.
It seems that I'm correctly fetching all rows (verified in debug), but I'm not modifying the properties of the button single instances but the properties of al buttons altogether.
I can't go on with my task, please can you help me???
Thank's a lot