Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modify datawindows object properties for each row independently

Status
Not open for further replies.

sannafabr

Programmer
Jan 23, 2008
2
IT
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


 
Ok, it's impossible to enable/disable a button row by row independently!

The same result (but in a graphically different way) can be achivied only setting visibility property via expression to be set directly in the painter, such
"if((isnull( al_nprot_ddocu_i ) or isnull( al_ycale_ingme )
> or isnull( as_ccaus_sdocu_i ) or ( a_lgucxinm_bchiu_dudcx
> <>'N')), 0, 1)"
 
If you can't see it, you can't click it. I've yet to have any issues using the method from your post #2.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top