Tristan,
Add a RaiseEvent(thisform.list1,"Requery") at the end of the section
starting "case lnAns=6"
Dave Crozier
PROCEDURE edit1.Valid
IF thisform.changes
lnAns=MESSAGEBOX("You have made changes. Do you want to save
them?",3+32,"Test")
DO CASE
CASE lnAns=2
* User cancelled dont do anything
RETURN .F.
CASE lnAns=6
* Save the changes
thisform.list1.ListItem[thisform.list1.ListItemId]=this.Value
RaiseEvent(thisform.list1,"Requery")
OTHERWISE
* Dont Save the changes
this.Value=thisform.list1.ListItem[thisform.list1.ListItemId]
ENDCASE
thisform.changes=.F.
ENDIF
ENDPROC
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Tristan Leask
Sent: 05 June 2007 10:23
To: [email protected]
Subject: RE: Valid event screwing with click event?
I'm still having issues with this. Below is some example code where you
can modify the text in a list using the edit box. When you leave the
edit box focus, it asks you if you want to update the text. However
after it has updated the text, if the user has select another entry in
the list it should then fire the interactivechange event and update the
text to the newly selected entry.
The interactivechange event doesn't fire though.
Any ideas?
Thanks
Tristan
Heres the test code....
PUBLIC testform
testform=CREATEOBJECT("test")
testform.show()
DEFINE CLASS test AS form
Height = 193
Width = 349
Caption = "Form1"
Name = "Form1"
changes = .F.
ADD OBJECT edit1 AS editbox WITH ;
Height = 72, ;
Left = 168, ;
Top = 108, ;
Width = 168, ;
Name = "Edit1"
ADD OBJECT list1 AS listbox WITH ;
Height = 168, ;
Left = 12, ;
Top = 12, ;
Width = 144, ;
Name = "List1"
ADD OBJECT label1 AS label WITH ;
WordWrap = .T., ;
Caption = "Select an item in the listbox to the left and then edit
its text below, then select another item in the list box.", ;
Height = 84, ;
Left = 168, ;
Top = 12, ;
Width = 168, ;
Name = "Label1"
PROCEDURE edit1.InteractiveChange
* Made some changes
thisform.changes=.T.
ENDPROC
PROCEDURE edit1.Valid
IF thisform.changes
lnAns=MESSAGEBOX("You have made changes. Do you want to save
them?",3+32,"Test")
DO CASE
CASE lnAns=2
* User cancelled dont do anything
RETURN .F.
CASE lnAns=6
* Save the changes
thisform.list1.ListItem[thisform.list1.ListItemId]=this.Value
OTHERWISE
* Dont Save the changes
this.Value=thisform.list1.ListItem[thisform.list1.ListItemId]
ENDCASE
thisform.changes=.F.
ENDIF
ENDPROC
PROCEDURE list1.InteractiveChange
* Load this value into the edit box
thisform.edit1.Value=this.Value
ENDPROC
PROCEDURE list1.Init
* Populate the list with crap
FOR x=1 TO 10
this.AddItem(SYS(2015))
ENDFOR
ENDPROC
ENDDEFINE
----------------------------------------------------------------------------
----------------------------------
This email was sent to [EMAIL PROTECTED] Unless otherwise agreed expressly
in writing by Marine Software Limited,
this communication and attachments are to be treated as confidential
and the information in it may not be used or disclosed except for the
purpose for which it was sent.
If you are not the intended recipient of this communication you should
destroy it without copying, disclosing or otherwise using its contents.
Please notify the sender immediately of the error.
[EMAIL PROTECTED]
Marine Software Limited. Registered in England & Wales. No 2576494
Regsitered Office. Unit3, Aylesham Business Pk, Aylesham. Kent. UK
----------------------------------------------------------------------------
--------------------------------------
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.