[TIMOB-26794] Android: Cannot show / hide a view created via Common JS
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Unknown |
Created | 2019-02-03T11:14:20.000+0000 |
Updated | 2019-02-04T19:18:17.000+0000 |
Description
This is a weird one. When creating a view programmatically, e.g. via a CommonJS file, it later cannot be shown / hidden anymore. We need to elaborate more on it, but it's similar to the following (using Alloy):
**xp.ui.js**
exports.createMyView = (args = {}) => {
};
**index.xml**
<Alloy>
<Window onOpen="hideView">
<MyView id="theView" width="100" height="100" backgroundColor="red" />
</Window>
</Alloy>
**index.js**
function hideView() {
$.theView.hide();
}
Hmm... I can't reproduce the issue. I've tried the below code which dynamically calls a label's
show()
andhide()
methods, as well as setting its "visible" propertytrue
/false
.The below code should be a similar equivalent of your Alloy example. But I cannot reproduce the issue with this either.
The main difference is that my example is about a require()'d view.