[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


http://bugzilla.novell.com/show_bug.cgi?id=536816


           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:1.9.0.13)
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.

Environment:
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
http://conceptdev.blogspot.com/2009/09/initiate-call-with-monotouch.html
and the code is downloadable from here
http://conceptdevelopment.net/iPhone/InitiateCall01/InitiateCall.zip

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

            textfieldInput.Ended += delegate
            {
                Console.WriteLine("ended");
                textfieldInput.ResignFirstResponder();
            };

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?
                Console.WriteLine("alleditingevents");
            };
            textfieldInput.Ended += delegate
            {
                Console.WriteLine("ended");
                textfieldInput.ResignFirstResponder();
            };

Then the Console contains BOTH
   alleditingevents
   ended
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
console)
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