hai experts
i add a datawindow name dw_1 and dataobject = d_test to u_cst_test5 useroject of advguisample.pbl
and created a event closequery and event id pbm_closequery and add following event
i add a datawindow name dw_1 and dataobject = d_test to u_cst_test5 useroject of advguisample.pbl
and created a event closequery and event id pbm_closequery and add following event
dw_1.AcceptText()
IF dw_1.ModifiedCount() > 0 or dw_1.DeletedCount() > 0 THEN
IF MessageBox("Save Changes", "Would you like to save your changes before you exit the window?", Question!, YesNo!, 1) = 1 THEN
Return 1
End IF
End IF
when i run the application and made changes and close the tab without save it closes without executing above code ;does anyone suggest where is the fault and how to correct it? i debugged but cannot open debug window when i close the tab. i am using Powerbuilder classic 12.5 version
IF dw_1.ModifiedCount() > 0 or dw_1.DeletedCount() > 0 THEN
IF MessageBox("Save Changes", "Would you like to save your changes before you exit the window?", Question!, YesNo!, 1) = 1 THEN
Return 1
End IF
End IF
when i run the application and made changes and close the tab without save it closes without executing above code ;does anyone suggest where is the fault and how to correct it? i debugged but cannot open debug window when i close the tab. i am using Powerbuilder classic 12.5 version
regards
kumar
in order to achieve the result i put the following code in uo_tabcontrol tabclosed event of the w_main window
If isvalid( iuo_1) then
iuo_1.dw_1.AcceptText()
IF iuo_1.dw_1.ModifiedCount() > 0 or iuo_1.dw_1.DeletedCount() > 0 THEN
IF MessageBox("Save Changes", "Would you like to save your changes before you exit the window?", Question!, YesNo!, 1) = 1 THEN
Return 1
End IF
End IF
End if
when i compile i got error Return expression in subroutine
can you give me a clue about error in above code or any event i can put the above code?
regards
Kumar
You are returning a value where the subroutine is set as (None)
Regards,
I don't believe there is a built in way of "closing" a tab page like a window has, but if you have a script that closes a tabpage, you need to ask the question beforehand.
You still need the window closequery event script.