A control with dynamic id, for example "__component0---sap.app.view.MainView--sap.app.view.TableView--Table1", which changes in runtime and therefore this control cannot be accessed by fynction byId, can be however accessed in following way:
if for example there is the view with the table:
<mvc:View
displayBlock="true"
xmlns:l="sap.ui.layout"
xmlns:table="sap.ui.table"
xmlns:mvc="sap.ui.core.mvc"
controllerName="sap.app.controller.TableView"
>
<l:HorizontalLayout>
<SearchField liveChange="onSearch"/>
</l:HorizontalLayout>
<table:TreeTable
id="Table1"
rows="{/root}"
>
<table:columns>
...
</table:columns>
</table:TreeTable>
</mvc:View>
then in the controller of this view (sap.app.controller.TableView) this table can be accessed by following statement:
var oTable = this.getView().getContent()[1];
oTable.expandToLevel(3);
or in other controller this table can be accessed by calling corresponding function of this controller:
expandTable: function () {
var oTable = this.getView().getContent()[1];
oTable.expandToLevel(3);
}
See How to call function of one controller from another controller for more details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
13 | |
12 | |
11 | |
9 | |
9 | |
7 | |
5 | |
5 | |
5 |