Skip to Content
0
Jun 07, 2018 at 08:20 AM

Getter Setter methods for sap.ui.layout.form.Form.

202 Views

I am using a form controller in sapui5. The form has the ID formCreateEdit. The form has a Title specification as follows:

<f:Form id="formCreateEdit" editable="false" visible="false" >

<f:title>

<core:Title text="Edit Form" />

</f:title>

.<f:layout>

............

</f:layout>

<f:formContainers>

..............

</f:formContainers>

</f:Form>

When I use the following lines of code on a press button event, I get some meta data value, whereas I expect this to return the value 'Edit Form':

The code inside the event handler:

onPress: function(){

var x = this.byId("formCreateEdit").getTitle();

alert (x);

}

Curiously enough, if I use the setTitle method inside init, for example, the onPress event returns the title string correctly.

this.byId("formCreateEdit").setTitle ("Alpha Beta Gamma);

Any pointers?