我观看了一些关于导航+在视图之间传递数据的教程,但它在我的情况下不起作用.我的目标是实现以下目标:
导航工作完美,详细信息页面显示,但数据绑定似乎不起作用(没有数据显示)我的想法是将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) 我想在 VBA 中使用 MSXML 创建 XML。目标输出非常基本:
<Main xmlns="http://www.myurl.com/xml">
<Info>
<BaseData>
<CreationDate>2021-11-10</CreationDate>
<Hardware>
<Frquency>100</Frquency>
</Hardware>
<SomeCode>000000_0000000</SomeCode>
<SomeName>HW GPU SoC 1</SomeName>
</BaseData>
</Info>
</Main>
Run Code Online (Sandbox Code Playgroud)
但是我的代码在“Info”元素中生成xmlns属性,我不知道为什么:
<Main xmlns="http://www.myurl.com/xml">
<Info xmlns="">
<BaseData>
<CreationDate>2021-11-10</CreationDate>
<Hardware>
<Frquency>100</Frquency>
</Hardware>
<SomeCode>000000_0000000</SomeCode>
<SomeName>HW GPU SoC 1</SomeName>
</BaseData>
</Info>
</Main>
Run Code Online (Sandbox Code Playgroud)
这是代码:
Dim doc As New MSXML2.DOMDocument60
Dim root As IXMLDOMNode
Dim info As IXMLDOMElement, baseData As IXMLDOMElement
Dim someCode As IXMLDOMElement, someName As IXMLDOMElement, hardware As IXMLDOMElement, freq As IXMLDOMElement, creationDate As IXMLDOMElement
Dim namesp As String
namesp …Run Code Online (Sandbox Code Playgroud)