on 07-28-2016 2:49 PM
Hi all,
I want to access the Title control within the headerToolbar of a Panel in order to set the title text dynamically. Is there any method already available for that? The Panel and its headerToolbar is as follows:
<Panel>
<headerToolbar>
<Toolbar height="2rem">
<Title id="panelTitle" text="{WorkflowModel>Name}"
</ToolbarSpacer>
<Text text="Sequence: {WorkflowModel>Sequence}" />
<Button icon="sap-icon://settings" press="onNaviToParameterPressed" tooltip="Go to Parameter Setting"/>
</Toolbar>
</headerToolbar>
</Panel>
I tried oPanel.getHeaderToolbar().getContent() and manage to get an array of four control objects (i.e., Title, ToolbarSpacer, Text, Button). However, I think looping through this array to find the Title control is not the optimal way. Therefore, is there any method that can achieve this directly?
Any help would be appreciated.
Regards,
La
Hi La,
Best way to change the text would be via binding as Jun suggested, since I see the title text is bound - "{WorkflowModel>Name}"
this.getView().getModel("WorkflowModel").setProperty("yourBindingPath", "yourText");
(or) you declared an 'id' for title control.
this.getView().byId("panelTitle").setText("yourText");
Regards,
Sai.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
do it via binding if possible. don't access the control to change the attribute if it is bindable
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.