tacinpgh
asked on
PB 6.5 rowfocuschanging
I have something strange happening and I'm not quite sure why. I have 2 datawindows dw_master, dw_child. When a user clicks on a new row in the master I have code in the rowfucuschanging of dw_master that will prompt user to save changes if there are any. The messagebox options are yes, no, cancel.
When I press cancel, I'm prompted again to save my changes, I press cancel again and this time I'm returned to the window. Why would the rowfocuschanging be fired twice??
NOTE: This is a pfc datawindow, so I'm not sure if that has anything to do with it. The master detail is not setup. Do I have to set up the master/detail relationship to get rowfocuschanging to work.
Here is the code that was added to the rowfocuschanging
IF dw_acct_code.ModifiedCount () > 0 OR dw_acct_code.DeletedCount( ) > 0 THEN
//Case: Changes are pending in the Account Code dw
li_rtnval = gnv_app.Message("APPL_ABS_ LD_SAVE_AC COUNT_CODE S")
CHOOSE CASE li_rtnval
CASE 1 //user chose ok
//save the changes, if save fails prevent the rowfocus from changing
IF wf_save() <> 1 THEN RETURN 1
CASE 3 //user chose cancel
//prevent the row from changing
This.SelectRow(0, FALSE)
This.SelectRow(currentrow, TRUE)
RETURN 1
END CHOOSE
END IF
When I press cancel, I'm prompted again to save my changes, I press cancel again and this time I'm returned to the window. Why would the rowfocuschanging be fired twice??
NOTE: This is a pfc datawindow, so I'm not sure if that has anything to do with it. The master detail is not setup. Do I have to set up the master/detail relationship to get rowfocuschanging to work.
Here is the code that was added to the rowfocuschanging
IF dw_acct_code.ModifiedCount
//Case: Changes are pending in the Account Code dw
li_rtnval = gnv_app.Message("APPL_ABS_
CHOOSE CASE li_rtnval
CASE 1 //user chose ok
//save the changes, if save fails prevent the rowfocus from changing
IF wf_save() <> 1 THEN RETURN 1
CASE 3 //user chose cancel
//prevent the row from changing
This.SelectRow(0, FALSE)
This.SelectRow(currentrow,
RETURN 1
END CHOOSE
END IF
Hi,
If you are using pfc datawindow then why are you not using it's rowmanager and linkage services ????
It will handle everything without any extra coding.
Regards,
Sandeep
If you are using pfc datawindow then why are you not using it's rowmanager and linkage services ????
It will handle everything without any extra coding.
Regards,
Sandeep
ASKER
Rosh,
The first thing I did was to comment the "select row" lines. The problem was still occurring. I think I have found a workable solution. I believe the problem is having messagebox in the rowfocuschanging. If I take the messagbebox out and place it in a post_event of rowfocuschanging, Thw window is acting correctly.
Sandeep -- I inherited this app along with the all of the bugs. Can you point me to documentation about setting up the linkage?? I would like to use the linkage service if it is possible
The first thing I did was to comment the "select row" lines. The problem was still occurring. I think I have found a workable solution. I believe the problem is having messagebox in the rowfocuschanging. If I take the messagbebox out and place it in a post_event of rowfocuschanging, Thw window is acting correctly.
Sandeep -- I inherited this app along with the all of the bugs. Can you point me to documentation about setting up the linkage?? I would like to use the linkage service if it is possible
ASKER
Sandeep -- I have set up the linkage but when I modify detail records and then select a new master record I am not prompted to save my detail record changes, The records are just lost.
I put the linkage in the pre-open event of the window
dw_master.of_SetLinkage(tr ue)
dw_detail.of_SetLinkage(tr ue)
dw_detail.inv_linkage.of_S etMaster(d w_acct_cod e_idx)
dw_detail.inv_linkage.of_R egister("a cct_code_i dx_id", "acct_code_idx_id")
dw_detail.inv_linkage.of_S etStyle(n_ cst_dwsrv_ linkage.FI LTER)
I put the linkage in the pre-open event of the window
dw_master.of_SetLinkage(tr
dw_detail.of_SetLinkage(tr
dw_detail.inv_linkage.of_S
dw_detail.inv_linkage.of_R
dw_detail.inv_linkage.of_S
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try commenting the lines...
This.SelectRow(0, FALSE)
This.SelectRow(currentrow,
and see if the problem persists...
Cheers,
Rosh