Hi,

I have a Treeview and a tab object on a window. Treeview contains the list 
of employees. The sytem retrieves data in the tab object for the selected 
employee and if user make changes in the tab object and then click on a 
different employee, I want the system to check for pending updates for the 
old employee and give user the save prompt. These are the concerned events :

1) ue_retrieve() for Window
*** retrieves data for the tab object for the employee

2) ue_tabsave() for Window
*** check for pending updates for the tab object. If there are pending 
updates then ask to save changes through MessageBox (Options availabe are 
Yes, No,Cancel). Return values :
  0  --- No pending updates
  1  --- Pending updates and user select Yes to save changes. Update
         data successfully
  2  --- Pending updates but user select No to save changes
  3  --- Pending updates but user select Cancel to save changes

3) clicked event for Treeview
*** trigger ue_retrieve() for the new selected employee

4) selectionchanging event for Treeview
*** first trigger ue_tabsave(). If return value is 3 (i.e. user select 
Cancel) then do not allow the selection to change otherwise proceed.

Code in selectionchanging() event for Treeview
==============================================
li_rtnval = Parent.Event ue_tabsave()
IF li_rtnval = 3 THEN RETURN 1
...

Now my thinking is that selectionchanging() triggers before clicked() for 
the treeview (Am I right?). So my sequences of triggering the events should 
work fine. But what happens is that if user made some changes for an 
employee then select a different employee then he will get the To save 
message. Now

If he click Yes then it will save the data for the old employee and also the 
selection changes in the Treeview so that user can see that the new employee 
is selected but the data for the new employee is never retrieved. On debug I 
find out that the clicked event never trigger. I have to click on the new 
employee again to retrieve his data.

If he click No then the selection changes in the Treeview so that user can 
see that the new employee is selected but the data for the new employee is 
never retrieved. On debug I find out that the clicked event never trigger. I 
have to click on the new employee again to retrieve his data.

If he click Cancel then it works OK i.e. user cannot change the selection in 
the Treeview.

Please tell me if I am missing something. Any help will be greatly 
appreciated.

The treeview is inherited from u_tvs, the Tab Page is inherited from u_tabpg 
and the window is inherited from w_sheet.

I am using PFC 6.5 with MS SQL Server 7.0 under Windows NT 4.0


Rizwan


P.S. I try to post the clicked event from selectionchanging event

IF li_rtnval = 0 OR li_rtnval = 1 OR li_rtnval = 2 THEN
    This.Event Post Clicked(newhandle)
END IF

But then it retrieves data twice. On debug I find out that it triggers 
Clicked event twice. Very strange for me. Please help.




______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

> [EMAIL PROTECTED] HOSTED BY IIGG, INC. FOR HELP WITH LIST SERVE COMMANDS, ADDRESS
> A MESSAGE TO [EMAIL PROTECTED] WITH THE FOLLOWING MESSAGE:   help pfcsig
> SEND ALL OTHER INQUIRES TO [EMAIL PROTECTED]

Reply via email to