This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 3970 - MT.Dialog with multiple BooleanImageElements - not all elements respond
: MT.Dialog with multiple BooleanImageElements - not all elements respond
Status: RESOLVED FIXED
Product: iOS
Classification: Xamarin
Component: General
: 5.2
: Macintosh Mac OS
: --- normal
: Untriaged
Assigned To: Sebastien Pouliot
:
:
:
:
  Show dependency treegraph
 
Reported: 2012-03-19 12:24 EDT by Jason Awbrey
Modified: 2012-03-20 14:12 EDT (History)
3 users (show)

See Also:
Tags:
Test Case URL:
External Submit: ---


Attachments
sample project illustrating problem with BooleanImageElement (16.79 KB, application/x-zip-compressed)
2012-03-19 12:24 EDT, Jason Awbrey
Details

Description Jason Awbrey 2012-03-19 12:24:05 EDT
Created attachment 1540 [details]
sample project illustrating problem with BooleanImageElement

MD 2.8.6.5, Mono 2.10.9, MT 5.2.5, Lion with latest XCode and 5.1.0 SDK

I have a project (sample attached) that uses MT.D to display a series of
questions with a YES/NO selection using BooleanImageElement.

1. run the project in landscape
2. the first 5 bools are clickable, the sixth is not
3. scroll back up - now the first is not clickable
4. scroll up and down, randomly clicking cells - cell responsiveness changes as
the scroll on and off the screen.  Some cells seem to be drawn based on the
state of other cells.
Comment 1 Sebastien Pouliot 2012-03-19 19:50:56 EDT
Yup, caching is buggy. Adding a C.WL in the tap event show:

Parent False : a.
Parent False : b.
Parent False : c.
Parent False : d.
Parent False : e.
Parent True : a.

when tapping on each question, last show be "Parent False : f."
Comment 2 Sebastien Pouliot 2012-03-19 20:23:23 EDT
there was a typo between 'this.parent' (field) and 'parent' (parameter) when
creating the cell and that fixed the button to the original parent

If you want to build your MT.D from (github) sources you can apply this fix.

$ git diff
diff --git a/MonoTouch.Dialog/Elements.cs b/MonoTouch.Dialog/Elements.cs
index bda8ccb..91492d2 100644
--- a/MonoTouch.Dialog/Elements.cs
+++ b/MonoTouch.Dialog/Elements.cs
@@ -342,9 +342,9 @@ namespace MonoTouch.Dialog
                        const int ImageSpace = 32;
                        const int Padding = 8;

-                       public TextWithImageCellView (BaseBooleanImageElement
parent) : base (UITableViewCellStyle.Value1, parent.CellKey)
+                       public TextWithImageCellView (BaseBooleanImageElement
p) : base (UITableViewCellStyle.Value1, p.CellKey)
                        {
-                               this.parent = parent;
+                               parent = p;
                                label = new UILabel () {
                                        TextAlignment = UITextAlignment.Left,
                                        Text = parent.Caption,
Comment 3 Jason Awbrey 2012-03-20 10:31:13 EDT
thanks for the quick response and workaround
Comment 4 Miguel de Icaza 2012-03-20 14:12:14 EDT
Will be on the next release.

Note You need to log in before you can comment on or make changes to this bug.