this.getView().setModel(new sap.ui.model.json.JSONModel(
{
"SupplierName": "New Orleans Cajun Delights",
"Region": "LA",
"ZIPCode": "70117",
"City": "New Orleans",
"Country": "USA",
"Tel": "(100) 555-4822",
"Sms": "123456789"
}
), "oAddressModel");
<f:Form editable="true">
<f:title>
<core:Title text="Address" />
</f:title>
<f:layout>
<f:ResponsiveGridLayout
labelSpanXL="4"
labelSpanL="4"
labelSpanM="12"
labelSpanS="12"
adjustLabelSpan="false"
emptySpanXL="0"
emptySpanL="0"
emptySpanM="0"
emptySpanS="0"
columnsXL="2"
columnsL="2"
columnsM="1"
singleContainerFullSize="false" />
</f:layout>
<f:formContainers>
<f:FormContainer title="Office Address">
<f:formElements>
<f:FormElement label="Name">
<f:fields>
<Input value="{oAddressModel>/SupplierName}" id="nameText">
<layoutData>
<l:GridData span="XL2 L6 M2 S4" />
</layoutData>
</Input>
</f:fields>
</f:FormElement>
<f:FormElement label="Region">
<f:fields>
<Input value="{oAddressModel>/Region}">
<layoutData>
<l:GridData span="XL2 L6 M2 S4" />
</layoutData>
</Input>
</f:fields>
</f:FormElement>
<f:FormElement label="ZIP Code/City">
<f:fields>
<Input value="{oAddressModel>/ZIPCode} {oAddressModel>/City}">
<layoutData>
<l:GridData span="XL2 L6 M2 S4" />
</layoutData>
</Input>
</f:fields>
</f:FormElement>
<f:FormElement label="Country">
<f:fields>
<Input value="{oAddressModel>/Country}" id="countryText">
<layoutData>
<l:GridData span="XL2 L6 M2 S4" />
</layoutData>
</Input>
</f:fields>
</f:FormElement>
<f:FormElement label="Tel.">
<f:fields>
<Input value="{oAddressModel>/Tel}">
<layoutData>
<l:GridData span="XL2 L6 M2 S4" />
</layoutData>
</Input>
</f:fields>
</f:FormElement>
<f:FormElement label="SMS">
<f:fields>
<Input value="{oAddressModel>/Sms}">
<layoutData>
<l:GridData span="XL2 L6 M2 S4" />
</layoutData>
</Input>
</f:fields>
</f:FormElement>
</f:formElements>
</f:FormContainer>
</f:formContainers>
</f:Form>
this.getRouter().getRoute("appView").attachMatched(this._onRouteOrderCreateMatched, this);
_onRouteOrderCreateMatched:function(oEvent){
var sHash = sap.ui.core.routing.HashChanger.getInstance().getHash();
if(sHash !== "undefined" && sHash !== ""){
var sAppStateKeys=/(?:sap-iapp-state=)([^&=]+)/.exec(sHash);
if(sAppStateKeys !== null)
{
var sAppStateKey = sAppStateKeys[1];
sap.ushell.Container
.getService("CrossApplicationNavigation")
.getAppState(this.getOwnerComponent(), sAppStateKey)
.done(function (oSavedAppState) {
this.getView().getModel("oAddressModel").setData(oSavedAppState.getData());
}.bind(this));
}
}
}
"routes": [
{
"pattern": ":?query:",
"name": "appView",
"target": "appView"
},
{
"pattern": "nextView",
"name": "nextView",
"target": "nextView"
}
],
"targets": {
"appView": {
"viewName": "App"
},
"nextView": {
"viewName": "Product"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 |