我希望在每次显示视图之前做一些逻辑.我不能在渲染方法之前使用它,因为它只在创建视图时被调用一次并且首次显示.帮助.任何想法?
我创建了一个响应式sap.m.table.但我无法从数据对象加载值.我想介绍"subvariants"对象数组.请帮忙
summaryDetailData={"subvariants":[{"currentValue":"","Article":"1234567","question":"Carpet Installation type"},{"currentValue":"","question":"CarpetQuantity"},{"currentValue":"","Article":"1234568","question":"Underpad type"},{"currentValue":"","question":"UnderpadQuantity"},{"currentValue":false,"Article":"1234568","question":"Rapid Install"}]}
var oTable = new sap.m.Table("idRandomDataTable", {
headerToolbar: new sap.m.Toolbar({
content: [
new sap.m.Label({text: "Summary Data"}),
new sap.m.ToolbarSpacer({}),
new sap.m.Button("idPersonalizationButton", {
icon: "sap-icon://person-placeholder"
})]}),
columns: summaryDetailData.cols.map(function (colname) {
return new sap.m.Column({ header: new sap.m.Label({ text: colname })})
})
});
oTable.setModel(new sap.ui.model.json.JSONModel(summaryDetailData));
oTable.bindAggregation("subvariants", "/subvariants", new sap.m.ColumnListItem({
cells: oData.cols.map(function (colname) {
return new sap.m.Label({ text: "{" + colname.toLowerCase() + "}" })
})
}));
Run Code Online (Sandbox Code Playgroud) 我想在按钮按下时将值从视图传递给控制器.在视图中传递productJson这是一个对象.但我无法在控制器中检索该值.请帮助.
查看js:
new sap.m.Button({
text: "Add to Cart",
press:[oController.addtoCartBtnPress,oController,productJson],
})
Run Code Online (Sandbox Code Playgroud)
控制器js:
addtoCartBtnPress:function(e,oView,productJson)
{
}
Run Code Online (Sandbox Code Playgroud)
结果:
oView and productJson values are returned as undefined.
Run Code Online (Sandbox Code Playgroud) 如何将json数据绑定到form.Below是我的表单和要绑定的数据.请帮我解决一下这个.示例我想将111个对象值绑定到表单
Data:
{"customerdetailsjson": {
"111": [
{
"name": "Bhuvaneswari Krishnan",
"phone-number":"8050231233"
}
],
"112": [
{
"name":"Chetan Sandeep Renu",
"phone-number":"9840321321"
}
]
}}
Form:
var oLayout1 = new sap.ui.layout.form.ResponsiveGridLayout();
customerDetailsForm = new sap.ui.layout.form.Form("F1", {
layout: oLayout1,
formContainers: [new sap.ui.layout.form.FormContainer("F1C2", {
title: new sap.ui.core.Title({
text: "Address Information",
tooltip: "Address data"
}),
formElements: [new sap.ui.layout.form.FormElement({
label: "Street / Number",
fields: [new sap.m.Input({
type: sap.m.InputType.Text,
value: "{name}",
layoutData: new sap.ui.core.VariantLayoutData({
multipleLayoutData: [new sap.ui.layout.ResponsiveFlowLayoutData({
weight: 5
}), new sap.ui.layout.form.GridElementData({
hCells: "5"
})]
})
})] …Run Code Online (Sandbox Code Playgroud) 为了在iPad上保存文件,我需要sites/default/files/在以下路径字符串中获取文件名substring(after ):
sites/default/files/243347_TroubleShootingSqlserver20052008.pdf
Run Code Online (Sandbox Code Playgroud)
我该怎么做?