In Flex 3, set editedItemPosition = null, wait for ITEM_EDIT_END reason=Cancelled" then callLater to post the alert.
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Dmitri Girski Sent: Friday, February 22, 2008 6:05 AM To: [email protected] Subject: [flexcoders] Re: ItemEditor looses focus and then crash Hi Andrii, Thank you for reply. Actually, I wasn't clear on the details of the problem - I really want to cancel editing and quit, but as soon as I close Alert box datagrid resumes editing operation. And I don't want this. So the questions is - how can I cancel editing before showing the Alert box? Cheers, Dmitri. --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "andrii_olefirenko" <[EMAIL PROTECTED]> wrote: > > I remember the same problem - I did check for event.reason == > DataGridEventReason.OTHER in order to prevent showing Alert window > when the editor loses focus, not on canceling via Esc. > In my case i couldn't use callLater because my Alert was actually > asking (Yes/No) and not just warning > Hope this help to solve your problem > > Andrii Olefirenko > > --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "Dmitri Girski" <mitek17@> wrote: > > > > Hi Alex and all, > > > > I was so inspired with the last victory over my focus problem > > (http://tech.groups.yahoo.com/group/flexcoders/message/102706 <http://tech.groups.yahoo.com/group/flexcoders/message/102706> ) > > so I just went through the list of all focus related bugs. > > > > I've got another case of some weird behaviour regarding the loosing > > the focus. > > > > Test case is very simple - editable DataGrid, click anywhere in the > > cell, start editing and then press ESC key - the parent component > > keyboard events handler will throw an Alert box. If you choose Yes > > (discard changes and close the window) system crashes. > > Debugging shows that after Alert control has been closed Flex tries to > > resume editing in DataGrid - it starts again with editBegin event and > > then it crashes because system already started the removal of the > window. > > > > The question is - what I am doing wrong? > > > > SWF: > > http://mitek.id.au/flex/TestItemEditorEsc.html <http://mitek.id.au/flex/TestItemEditorEsc.html> > > > > Source code: > > http://mitek.id.au/flex/TestItemEditorEsc.mxml <http://mitek.id.au/flex/TestItemEditorEsc.mxml> > > http://mitek.id.au/flex/TestItemEditor.mxml <http://mitek.id.au/flex/TestItemEditor.mxml> > > > > > > Thanks in advance! > > > > Dmitri. > > >

