on 2016 Jul 28 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
Request clarification before answering.
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.
| User | Count |
|---|---|
| 18 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.