我每次查看页面时都会搜索模式以执行代码(在我的情况下,检索数据以便从服务器可视化)(每个tipe页面都由splitApp.toDetail或splitApp.backDetail调用).我该怎么做??onBeforeRendering和onAfterRendering仅在第一次执行..
我写了一个XML视图.里面有一张桌子:
<Table xmlns="sap.m"
id="myTable"
select=""
selectionChange=""
swipe=""
growingStarted=""
growingFinished=""
updateStarted=""
updateFinished=""
itemPress="console.log('clicked on item')"
>
<columns>
<!-- sap.m.Column -->
</columns>
<items>
<!-- sap.m.ListItemBase -->
</items>
</Table>
Run Code Online (Sandbox Code Playgroud)
我使用onInit
控制器将行插入表中,但是当我单击一行时,消息不会显示.
我有这个数组:
aItems = [{
"PropertyA": "apple",
"PropertyB": "banana",
"PropertyC": "dog",
"PropertyD": "hotdog",
"PropertyE": "coldcat",
"PropertyF": "Y",
"PropertyG": "N"
},
...,
{
"PropertyA": "this",
"PropertyB": "is",
"PropertyC": "json",
"PropertyD": "code",
"PropertyE": "wow",
"PropertyF": "N",
"PropertyG": "N"
}]
Run Code Online (Sandbox Code Playgroud)
我想使用lodash来获得这个结果:
aItems = [{
"propertyA": "apple",
"propertyB": "banana",
"propertyC": "dog",
"propertyD": "hotdog",
"propertyE": "coldcat",
"propertyNEW": true,
"propertyG": false
},
...,
{
"propertyA": "this",
"propertyB": "is",
"propertyC": "json",
"propertyD": "code",
"propertyE": "wow",
"propertyNEW": false,
"propertyG": false
}]
Run Code Online (Sandbox Code Playgroud)
我希望将每个属性名称与其他名称一起映射,并更改某些特定属性的值.我可以用lodash做吗?
如果我this.getView()
在视图的控制器内部使用,我可以毫无问题地检索它。
如果我在控制器之外(例如在另一个视图的控制器中),如何检索视图?
我尝试sap.ui.core.Core().byId("<name of view>")
但它返回undefined
。
我是Java开发人员,我总是使用getter-setter方法.我怎样才能在Delphi中使用这个概念?
//1
//2
//3
对于这个例子:
unit Unit1;
type
ClassePippo=class
private
colorText:string; //1
function getColorText: String; //3
procedure setColorText(const Value: String); //3
public
property colore: String read getColorText write setColorText; //2
end;
implementation
{ ClassePippo }
function ClassePippo.getColorText: String; //3
begin
Result:=colorText;
end;
procedure ClassePippo.setColorText(const Value: String); //3
begin
colorText:=Value;
end;
end.
Run Code Online (Sandbox Code Playgroud)
是否有自动创建getter和setter方法的功能?
我只想写colorText: string; //1
和调用一个快捷方式,我希望IDE自动创建//2
和//3
.
(当我使用Eclipse在Java中开发时,我可以使用Source - > Generate getter和setter自动生成getter和setter方法...)
对于我的项目,我使用git-flow.我master
和develop
remote-repo同步分支通常对于所有更改我创建一个feature
分支,编辑文件,在feature
分支上提交更改并通过合并关闭分支develop
.
但有时我忘了创建一个feature
分支,我直接编辑文件develop
.如何在新的feature
分支中移动canges ?
我创建了这个片段:
var dialogFrafment = sap.ui.xmlfragment(
"appIntra.fragment.dialog",
this.getView().getController() // associate controller with the fragment
);
this.getView().addDependent(dialogFrafment);
sap.ui.getCore().byId("idMailReport").setValue(sap.ui.getCore().getModel("mailUser"));
dialogFrafment.
dialogFrafment.open();
Run Code Online (Sandbox Code Playgroud)
完成后如何删除?
如果我创建一个JSON对象并在控制台上打印它:
LJSONObject:= TJSONObject.Create;
LJSONObject.AddPair(TJSONPair.Create(TJSONString.Create('Hello'), TJSONString.Create('World')));
LJSONObject.AddPair(TJSONPair.Create(TJSONString.Create('Ciao'), TJSONString.Create('Mondo')));
Writeln(LJSONObject.ToString);
Run Code Online (Sandbox Code Playgroud)
结果是:
{"Hello":"World", "Ciao":"Mondo"}
Run Code Online (Sandbox Code Playgroud)
我怎么能用更好的缩进打印结果,像这样?
{
"Hello":"World",
"Ciao":"MOndo"
}
Run Code Online (Sandbox Code Playgroud) s如果我有一个表,我可以从一列过滤:
handleSearch: function(oEvent) {
var sValue = oEvent.getParameter("value");
var oFilter = new sap.ui.model.Filter("RAG_SOC_1", sap.ui.model.FilterOperator.Contains, sValue);
var oBinding = oEvent.getSource().getBinding("items");
oBinding.filter([oFilter]);
},
Run Code Online (Sandbox Code Playgroud)
但我可以从更多cols过滤?
例如,如果我有cols:A,B,C,B,如果我在搜索栏中写"hello",我想要在字段A或B或C或D中包含"hello"字样的所有结果
我的目标是将文档页面包含到 sap.m.Page 中。我有一个 sap.m.Page 到 XML 视图:
<Page id="idPageSidebar" title="" showNavButton="false" navButtonPress="doBack">
<content>
//here I want visualize myDocumentation.html page
</content>
</Page>
Run Code Online (Sandbox Code Playgroud)
我将 myDocumentation.html 放入我的项目目录中。我如何将它包含到 sap.m.Page 中?
我的REST服务向我发送了很多数据。每个属性都包含value
和属性,该属性包含help
对字段属性的详细说明。
好的,我在JSONModel中有数据(带有值和帮助的属性列表),并且我使用了数据绑定XML https://openui5.hana.ondemand.com/#docs/guide/91f0f3cd6f4d1014b6dd926db0e91070.html将数据映射value
为表单和桌子。现在,我想以某种方式help
显示每个属性的消息。
我的想法是 当用户双击表中列标题的“ 标签”或“ 文本 ” 时显示一个消息对话框
Label和Text都具有attachBrowserEvent方法,但是我不知道如何使用该函数附加仅在XML视图中冲洗的事件
我想要这样的东西:
在XML视图中:
<Label text="Language"
attachBrowserEvent:"function("click",showMessageHelp({model>/language/help}))">
<Input value="{model>/language/value}"/>
Run Code Online (Sandbox Code Playgroud)
在控制器中:
showMessageHelp:function(sMessage){
//show message dialog with sMessage
...........
}
Run Code Online (Sandbox Code Playgroud) 这是我的片段,片段没有控制器
<core:FragmentDefinition
xmlns="sap.m"
xmlns:core="sap.ui.core">
<Dialog
title="Invio report via mail">
<content>
<FlexBox
alignItems="Start"
justifyContent="Center">
<items>
<TextArea id="idMailReport" value="themail.mail.it" rows="1" cols="50" />
</items>
</FlexBox>
</content>
<beginButton>
<Button text="Ok" press="onDialogOkButton" />
</beginButton>
<endButton>
<Button text="Close" press="onDialogCloseButton" />
</endButton>
</Dialog>
</core:FragmentDefinition>
Run Code Online (Sandbox Code Playgroud)
我可以设置TextArea元素的che值吗?
我尝试从我调用片段的控制器设置它:
var dialogFrafment = sap.ui.xmlfragment(
"dialogFragment",
"appIntra.fragment.dialog",
this // associate controller with the fragment
);
this.getView().addDependent(dialogFrafment);
dialogFrafment.open();
this.byId("idMailReport").setValue("initial.mail.com");
Run Code Online (Sandbox Code Playgroud)
你能帮助我吗?
sapui5 ×8
delphi ×2
javascript ×2
sap-fiori ×2
git ×1
git-branch ×1
git-flow ×1
git-merge ×1
json ×1
lodash ×1