Skip to Content
0
Former Member
Apr 06, 2016 at 10:44 AM

Change elements of subview

98 Views

Hi,

i have a view where another view is embedded:

<mvc:View controllerName="account.controller.Main" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m">

<App>

<pages>

<Page title="{i18n>title}">

<content>

<sap.ui.layout.form:SimpleForm ariaLabelledBy="__text5" columnsL="1" columnsM="1" editable="true" emptySpanL="1" emptySpanM="1" id="__form0"

labelSpanL="4" labelSpanM="4" layout="ResponsiveGridLayout" maxContainerCols="2" xmlns:sap.ui.layout.form="sap.ui.layout.form">

<sap.ui.layout.form:content>

<Label labelFor="idFertigungsauftrag" text="{i18n>Fertigungsauftrag}"/>

<Input busy="false" editable="true" id="idFertigungsauftrag" width="100%"/>

</sap.ui.layout.form:content>

</sap.ui.layout.form:SimpleForm>

<mvc:XMLView viewName="account.view.Rueckmeldung"/>

</content>

<footer>

<Toolbar>

<ToolbarSpacer/>

<Button icon="sap-icon://accept" id="idConfirmBtn" press="onPressConfirmBtn" text="{i18n>Rueckmelden}" type="Accept"

visible="true"/>

<Button icon="sap-icon://sys-cancel" id="idCancelBtn" press="onPressCancelBtn" text="{i18n>Abbrechen}" type="Reject"

visible="true"/>

</Toolbar>

</footer>

</Page>

</pages>

</App>

</mvc:View>

In this subview I have input fields. Over the button in the footer I want to clear the input fields of the subview.

Within this button-method, I can call a function of the controller of the subview: sap.ui.controller("hauni.controller.Rueckmeldung").clear();

But within this function, I can not access this and so I can not get the elements of the view

clear: function() { this.byId("idGutmenge").setValue(""); this.byId("idAusschuss").setValue(""); this.byId("idEntlohnungsmenge").setValue(""); this.byId("idNCProgrammnummer").setValue("");

}

Has anybody an idea how to handle this?

Thank you in advance!

Bastian