There are many ways you can approach this. One of the easiest is to disable 
close query. Set ib_disableclosequery  to false in your window, and then turn it
on in your itemchanged event of your datawindow.



______________________________ Reply Separator _________________________________
Subject: Re: PFCSIG pfc_save 
Author:  "Daniel Coppersmith" <[EMAIL PROTECTED]>  at uucp
Date:    8/6/99 4:40 PM


Bill,
     
It sounds like an AcceptText is not being fired as it should.  Are you sure 
the update is actually happening? (Turn on SQLSpy, or put a break point in 
the u_dw SQLPREVIEW event to make sure the statement is actually being sent 
to the database).
     
That would explain the behavior -- since you don't tab out, the datawindow 
doesn't know the value was modified so PFC_SAVE thinks there is nothing to 
do, but when you attempt to close the window, closeQuery peforms an 
(pfc_)AcceptText (the equivalent of you tabbing out of the column) and makes 
the datawindow think something was changed and asks you if you want to save 
the changes -- but, when you DO tab out and hit PFC_SAVE, it knows something 
changes so it doesn't ask you.
     
What confuses me though is PFC_SAVE should be doing an accept text...  is it 
possible that you somehow altered (e.g. overrode) the functionality of 
pfc_acceptText on either the window or the datawindow?  Check the window and 
controls ancestor scripts as well...
     
Check that and let me know....  you can quickly prove or disprove my theory 
by putting an accept text right before the call to the PFC_SAVE event... (I 
wouldn't recommend keeping it if it works though since that would cure the 
symptom, not the disease but it would tell you if we're on the the right 
track....)
     
Daniel
     
     
     
----- Original Message -----
From: Skiffington, Bill <[EMAIL PROTECTED]> 
To: Daniel Coppersmith <[EMAIL PROTECTED]>
Sent: Friday, August 06, 1999 3:58 PM 
Subject: RE: PFCSIG pfc_save
     
     
> Daniel,
>
> You almost have it. A-D are correct. If I perform steps a-d then try to
> close the window, that's when the pfc_saveChanges message is displayed. In 
> step 'B', if I tab out of the column everything works correctly.
>
> Thanks again for your help. If you have any other ideas I would appreciate 
> the help.
>
> Bill
>
> -----Original Message-----
> From: Daniel Coppersmith [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, August 06, 1999 11:02 AM
> To: Skiffington, Bill
> Subject: Re: PFCSIG pfc_save
>
>
> Bill,
>
> Let me rephrase your issue to make sure I understand it correctly... 
>
> (a)    Retrieve datawindow
> (b)    Modify a value in a column but do not tab out of it 
> (c)    Click button that calls PFC_SAVE
> (d)    Change is sent to the database 
>
> However, if in step (b) you modify the value and tab out of the column, 
> when you click PFC_SAVE it asks you if you want to save changes (which 
> is silly because you obviously do since you clicked SAVE).
>
> Is that right?  I might have misunderstood your issue.  If I phrased
> it correctly, I am not sure what could cause that off the top of my head 
> since the pfc_saveChanges message should only be displayed from
> the closequery event...
>
> If you want, you can e-mail me the exported script from the window (and 
> datawindow control if you modified it) and I'll see if something jumps 
> out at me...
>
> D
>
>
>
> ----- Original Message -----
> From: Skiffington, Bill <[EMAIL PROTECTED]> 
> To: Daniel Coppersmith <[EMAIL PROTECTED]>
> Cc: PFCSIG <[EMAIL PROTECTED]>
> Sent: Friday, August 06, 1999 12:07 PM 
> Subject: RE: PFCSIG pfc_save
>
>
> > Daniel,
> >
> > Thanks for your quick response! What I am doing is a simple retrieve for 
1
> > record, then I type in a change to a column. During the save process and 
> > during the closequery process 'pfc_updatespending' is called. This 
returns
> > the modified + deleted counts. The return value is always 1, unless I 
tab
> > out of the modified column before I save. This is what leads me to 
believe
> > that the status is not getting updated. 
> >
> > Any thoughts?
> >
> > Thanks,
> > Bill
> >
> >
> > -----Original Message-----
> > From: Daniel Coppersmith [mailto:[EMAIL PROTECTED]] 
> > Sent: Friday, August 06, 1999 9:07 AM
> > To: Skiffington, Bill
> > Cc: PFCSIG
> > Subject: Re: PFCSIG pfc_save
> >
> >
> > Bill,
> >
> > I would do some investigating into which status is being changed (it 
might
> > not even be the datawindow you expect). 
> >
> > (1)    If you have a second datawindow that is used for retrieval 
criteria
> > or some other display and is never meant for updating, call 
> > of_setUpdateable(False) on it and PFC will ignore it.
> > (2)    If you are sure the datawindow you expect is the one with the 
> changed
> > status, loop through all the rows and if you find one that has a value 
> other
> > than NotModified!, then search all of it's columns until you find one 
that
> > is NotModified!, then see if you are doing a setItem on it. 
> >
> > Your note said "It seems that the dw status isn't getting reset"... that 
> > makes me think that you are doing something to the datawindow other than 
a
> > simple retrieve (because if you just retrieve the datawindow and nothing 
> > else, it's statuses should all be NotModified!).  Are you doing set 
items
> > anywhere?
> >
> > - If you are doing a setItemStatus, are trying to change to one you 
cannot
> > go to directly?  i.e. NewModified! to NotModified!
> > - Is a row being inserted that you didn't expect (and cannot see because 
> > there's only room for 1 and no scroll bars?)
> > - Did you try cursing at it?  Sometimes that helps.  :) 
> >
> > D
> >
> >
> > ----- Original Message -----
> > From: Skiffington, Bill <[EMAIL PROTECTED]> 
> > To: PFC Mailing List <[EMAIL PROTECTED]>
> > Sent: Friday, August 06, 1999 10:39 AM 
> > Subject: PFCSIG pfc_save
> >
> >
> > > Maybe it's because it's Friday or maybe my brain is fried, or maybe 
> both,
> > > but I'm not seeing this.
> > > I have a window with 1 dw on it. I retrieve a record, change a column, 
> > click
> > > save(call pfc_save), and the changes are saved. However, if I didn't 
> > change
> > > columns before saving, I get the 'Do you want to save your changes?' 
> > > message. It seems that the dw status isn't getting reset. I can 
manually
> > > reset the status, but I would like to do it the right way, which I'm 
not
> > > seeing... Could someone point me in the right direction. 
> > >
> > >
> > > TIA,
> > > Bill
> > > > [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] 
> > >
> >
>
     
> [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]
     


> [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