我正在寻找一个包含组件可能的元数据属性名称和配置参数的文档.
互联网上有许多文件都有这样的定义.问题是我如何知道属性/参数设置的名称是否是有效名称.
metadata : {
name : "XXXXX",
version : "1.0",
includes : [],
dependencies : {
libs : ["sap.m", "sap.ui.layout"],
components : []
},
rootView : "XXXXX",
config : {
resourceName : "i18n",
resourceBundle : "XXXX",
serviceConfig : {
name : "main",
serviceUrl : "XXXXX",
}
}
Run Code Online (Sandbox Code Playgroud) 我有以下问题:
我有 2 个带有几个输入字段的 XML 视图,在导航到第二个视图时,焦点应该放在第 5 个(ID = "RueckmeldeNr")字段上。
我尝试了几件事,但没有任何效果。如果我使用 jQuery delayCall,焦点会在输入字段上短暂闪烁,但会立即设置为左上角的 NavBack 按钮。
我是使用 false 方法还是忘记了什么?我该如何解决这个问题?
onAfterRendering : function(oEvent) {
oInputRueck = this.getView().byId("RueckmeldeNr");
// this.getView().byId("RueckmeldeNr").focus();
// this.getView().byId("RueckmeldeNr").$().focus();
// jQuery.sap.delayedCall(200, this, function() {
// //this.getView().byId("RueckmeldeNr").focus();
// oInputRueck.focus();
// });
// var oFocusInfo = this.getView().byId("RueckmeldeNr").getFocusInfo()
// this.getView().byId("RueckmeldeNr").applyFocusInfo(oFocusInfo);
jQuery.sap.delayedCall(0, this, function() {
oInputRueck.focus();
});
},
Run Code Online (Sandbox Code Playgroud)
我希望你可以帮助我!
谢谢
我观看了一些关于导航+在视图之间传递数据的教程,但它在我的情况下不起作用.我的目标是实现以下目标:
导航工作完美,详细信息页面显示,但数据绑定似乎不起作用(没有数据显示)我的想法是将JSON字符串传递给详细信息页面.我怎样才能做到这一点?还是有更优雅的方式?
这是迄今为止的代码:
MainView控制器
sap.ui.controller("my.zodb_demo.MainView", {
onInit: function() {
var oModel = new sap.ui.model.json.JSONModel("zodb_demo/model/products.json");
var mainTable = this.getView().byId("productsTable");
this.getView().setModel(oModel);
mainTable.setModel(oModel);
mainTable.bindItems("/ProductCollection", new sap.m.ColumnListItem({
cells: [new sap.m.Text({
text: "{Name}"
}), new sap.m.Text({
text: "{SupplierName}"
}), new sap.m.Text({
text: "{Price}"
})]
}));
},
onDetailsPressed: function(oEvent) {
var oTable = this.getView().byId("productsTable");
var contexts = oTable.getSelectedContexts();
var items = contexts.map(function(c) {
return c.getObject();
});
var app = sap.ui.getCore().byId("mainApp");
var page = app.getPage("DetailsForm");
//Just to check if the selected JSON String is correct …Run Code Online (Sandbox Code Playgroud) 打开文档时遇到问题。
reportEngines =
(ReportEngines) enterpriseSession.getService("ReportEngines");
ReportEngine wiRepEngine =
(ReportEngine) reportEngines.getService(
ReportEngines.ReportEngineType.WI_REPORT_ENGINE);
/*
* Process Webi Documents from a folder
* */
for (Object object : infoObjects) {
IInfoObject infoObject = (IInfoObject) object;
String path = getInfoObjectPath(infoObject);
if (path.startsWith("/")) {
String doc = infoObject.getTitle();
System.out.println("Title :" + doc + "\n ID " + infoObject.getID() );
System.out.println(path + "/" + doc);
System.out.println(infoObject.toString());
DocumentInstance widoc = wiRepEngine.openDocument(infoObject.getID());
}
}
Run Code Online (Sandbox Code Playgroud)
调用 openDocument() 时抛出以下异常
com.businessobjects.rebean.wi.CommunicationException: Cannot initialize Report Engine server. (Error: RWI 00226)
at com.businessobjects.rebean.wi.occa.OccaConnection.doConnect(Unknown …Run Code Online (Sandbox Code Playgroud) 我想getCountdown用两个参数调用函数:
"Time"或 中硬编码"Status"。这是我的代码:
<ObjectStatus
title="Time"
text="{
parts: [
{path: 'AuctionEnd'},
{path: 'Time'}
],
formatter: '.formatter.getCountdown'
}"
/>
Run Code Online (Sandbox Code Playgroud)
在 formatter.js 中,只有在我的控制台日志中看到的第一个参数:
Run Code Online (Sandbox Code Playgroud)["2016-05-20T12:00:00", undefined]
在 JS 中,我会这样做:
["2016-05-20T12:00:00", undefined]
Run Code Online (Sandbox Code Playgroud) 我看过两篇关于 URL 约定的帖子,但我的问题是针对 OData Web 服务假设的 SAP 网关实现的。尝试$filter与 with 结合使用时,$expand我们收到错误消息:
Left hand expression of memberaccess operation has wrong cardinality
Run Code Online (Sandbox Code Playgroud)
假设我有两个简单的实体:
Foo
* Key
- Value
Bar
* Key
* Id
- Value
Run Code Online (Sandbox Code Playgroud)
Foo 与 1:n 关联Bar。以下 URL 按预期工作。
/sap/opu/odata/sap/ZTEST_SRV/Foo?$expand=Bar
Run Code Online (Sandbox Code Playgroud)
就像
/sap/opu/odata/sap/ZTEST_SRV/Foo?$filter=Key gt 10&$expand=Bar
Run Code Online (Sandbox Code Playgroud)
尝试$filter在实体Bar属性上使用时,Id我们收到错误消息。
/sap/opu/odata/sap/ZTEST_SRV/Foo?$filter=Key gt 10 and Bar/Id gt 2&$expand=Bar
Run Code Online (Sandbox Code Playgroud)
是否可以$filter在 SAP 中以这种方式使用 a ?相关文章如下。
sap.ushell.Container.getServiceAsync("CrossApplicationNavigation")我在从部署在 BTP Cloud Foundry 中并通过 SAP BTP Launchpad 服务访问的 SAPUI5 应用程序进行调用时遇到问题。
我的理解是:如果应用程序是从Fiori launchpad启动的,它可以触发CrossApplicationNavigation.
manifest.json声明了以下依赖项:
{
"sap.ui5": {
"dependencies": {
"minUI5Version": "1.52.0",
"libs": {
"sap.ui.core": {},
"sap.m": {},
"sap.ui.layout": {},
"sap.ushell": {},
"sap.collaboration": {},
"sap.ui.comp": {},
"sap.uxap": {}
}
Run Code Online (Sandbox Code Playgroud)
sapui5 sap-fiori sap-cloud-foundry sap-business-technology-platform
如果我this.getView()在视图的控制器内部使用,我可以毫无问题地检索它。
如果我在控制器之外(例如在另一个视图的控制器中),如何检索视图?
我尝试sap.ui.core.Core().byId("<name of view>")但它返回undefined。
我正在使用方便的 try-with-resources 语句来关闭连接。这在大多数情况下都很有效,但只有在一种非常简单的方法中它才能正常工作。即,这里:
public boolean testConnection(SapConnection connection) {
SapConnect connect = createConnection(connection);
try ( SapApi sapApi = connect.connect() ) {
return ( sapApi != null );
} catch (JCoException e) {
throw new UncheckedConnectionException("...", e);
}
}
Run Code Online (Sandbox Code Playgroud)
sapApi 对象为非空,该方法返回 true,但从未调用 sapApi 的 close() 方法。我现在求助于使用一个工作正常的 finally 块。但这很令人费解。Java 字节码还包含对 close 的调用。有没有人见过这种行为?
编辑以澄清情况:
这是 SapApi,当然,它实现了 AutoCloseable。
class SapApi implements AutoCloseable {
@Override
public void close() throws JCoException {
connection.close(); // this line is not hit when leaving testConnection(..)
}
..
}
Run Code Online (Sandbox Code Playgroud)
下面是与 …
我正在尝试创建一个自定义对话框来显示页脚中的一些文本和链接以及按钮。我不知道如何更改现有的渲染,因此我编写了一个简单的渲染器来检查行为。这是我的代码:
sap.m.Dialog.extend("EnhancedDialog",{
metadata:{
properties:{
footerLabelText:{type:"string",defaultValue:null},
footerLinkText:{type:"string",defaultValue:null},
footerLinkHref:{type:"string",defaultValue:null}
},
aggregations:{
_label:{type:"sap.m.Label",multiple:false,visibility:"hidden"},
_link:{type:"sap.m.Link",multiple:false,visibility:"hidden"}
},
events:{}
},
init:function(){
this.getAggregation("_label", new sap.m.Label({text:"Check"}));
this.getAggregation("_link",new sap.m.Link({text:"Link"}));
},
setFooterLabelText:function(oLabelText){
this.setProperty("footerLabelText",oLabelText,true);
this.getAggregation("_label").setText(oLabelText);
},
setFooterLinkText:function(oLinkText){
this.setProperty("footerLinkText",oLinkText,true);
this.getAggregation("_link").setText(oLinkText);
},
setFooterLinkHref:function(oLinkHref){
this.setProperty("footerLinkHref",oLinkHref,true);
this.getAggregation("_link").setHref(oLinkHref);
},
renderer:{
render:function(oRM,oControl){
oRM.write("<div");
oRM.writeControlData(oControl);
oRM.writeClasses();
oRM.write(">");
oRM.renderControl(oControl.getAggregation("_label"));
oRM.renderControl(oControl.getAggregation("_link"));
oRM.write("</div");
}
}
});
var enhancedDialog=new EnhancedDialog();
var btn=new sap.m.Button({
text:"Click Here!",
press: function(){
enhancedDialog.open();
}
});
Run Code Online (Sandbox Code Playgroud)
但我收到错误
Dialog.js:6 未捕获类型错误:无法读取未定义的属性“setInitialFocusId”
当我点击按钮时。
有人可以指出我做错了什么吗?
以及如何更改现有渲染器行为以在页脚中显示文本?
sapui5 ×7
java ×2
javascript ×1
modal-dialog ×1
odata ×1
sap-business-technology-platform ×1
sap-fiori ×1
sap-gateway ×1
sapjco3 ×1