[TIMOB-1010] Ti.Android.OptionMenu.Menu doesn't respect title property change
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:54:56.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.4.0 |
Components | Android |
Labels | android, defect, menu |
Reporter | Konstantin |
Assignee | Blain Hamon |
Created | 2011-04-15T02:41:26.000+0000 |
Updated | 2011-04-17T01:54:56.000+0000 |
Description
Platform 1.3.0, Android 2.1
I have a "heavyweight" android window with menu attached. I try
to change "title" property of one menu items, after click.
Something like:
Controller.prototype.onMenuClick = function(e) {
e.source.title = 'New title based on some condition';
}
but it doesn't work. Title is same.
We'll look into this, but the native Tab control does not allow changes after creation.
Don,
It's not a Tab, it's an Android Menu
Ok this appears to be that the source is not what you're expecting. We'll definitely look into it.
I'm on it, though a tip or source to reproduce this would be helpful.
Most likely the onPropertyChange didn't get implemented for title and/or icon. Basically you need an app.js that creates a menu. You don't even need to worry about a windows. Just in the onclick of them menu change the title of the item. Then when you press the menu button again, it should show the new title.
Please check icon as well.
We've verified that setting the menu title and icon do function as expected. You need to set your listener on the actual object not its prototype. We inject objects in Javascript from the native side and they're effectively wrappers around native objects. In that respect they don't "obey" prototype as you're expecting.
Don,
No, it's not a problem of prototype, I have my own event manager, which keeps context and allows to attach and pass custom data to event handlers. All objects inside event handler are valid, event handler is executed and it works everywhere across project.
I'll prepare simple project to reproduce this bug.
Ooops, Don and Matthew, I'm very sorry, I found stupid bug in my source code. From now, I'll check my bug report more carefully.
Sorry again