[Mono-bugs] [Bug 536816] New: textfield.Ended doesn't fire unless textfield.AllEditingEvents also 'wired up'

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Sep 4 08:24:44 EDT 2009


           Summary: textfield.Ended doesn't fire unless
                    textfield.AllEditingEvents also 'wired up'
    Classification: Mono
           Product: MonoTouch
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: gnorton at novell.com
        ReportedBy: craig.dunn at conceptdevelopment.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

Created an attachment (id=316807)
 --> (http://bugzilla.novell.com/attachment.cgi?id=316807)
Screenshot of monodevelop showing 'bug' code/output

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:
Gecko/2009073022 Firefox/3.0.13 (.NET CLR 3.5.30729)

I want the keyboard to 'disappear' when [Done] is touched. I believe in ObjC I
would be doing this
 - (IBAction)textFieldDoneEditing:(id)sender{[sender resignFirstResponder];}

In Monotouch I am using the textfield.Ended event - but it doesn't seem to fire
UNLESS textfield.AllEditingEvents is also wired up (even if its a no-op).
TextField is configured for the [Done] button to show on the normal keyboard.

iPhone 3GS 3.0.1 32Gb 
MonoTouch b7 (28-Aug-09?)
MonoDevelop IDE 2.1.0 (late-august)
MacOS X Leopard

The 'sample app' is from this blog post
and the code is downloadable from here

I know it doesn't seem to make sense, but if i put JUST this in
FinishedLaunching() - I'm assuming .Ended is equivalent to

            textfieldInput.Ended += delegate

then nothing is ever written to the Console and the keyboard doesn't disappear
(Simulator OR Device). However if I put this

           textfieldInput.AllEditingEvents += delegate
            {   //BUG: if this event is not wired up, the .Ended event doesn't
fire... weird?
            textfieldInput.Ended += delegate

Then the Console contains BOTH
AND the keyboard disappears.

So it _seems_ like the .Ended event doesn't fire unless .AllEditingEvents is
also wired up... although I can't think of a reason that would be. 

I've tested both Simulator and Device with and without the .AllEditingEvents
delegate - behavior as above every time.

Reproducible: Always

Steps to Reproduce:
1. wire up a delegate to a textField.Ended event (with Console.WriteLine,say)
2. nothing is written to the Console when you touch [Done] on the keyboard
3. add a delegate for textField.AllEditingEvents (again write something to
4. now both Ended and AllEditingEvents console messages are written

I was hesitant to raise this since it seems like the kind of thing where I
could be doing something wrong. The test app is fairly simple however, and the
behavior seems easily repeatable, so I hope it makes sense to you.

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list