我想删除sap ui5表的第一列(用于选择行的列).我没有要求选择行.
我尝试用css做到这一点,但是,它正在弄乱表格对齐.
可以任何人建议,如何删除表的第一列?
我不能从同一个控制器的另一个函数调用一个函数.我在控制器中有什么:
checkData: function(){
if(//check the data here before submitting it to the server){
//display error message if the data is not ok
}
else{
//call the function that submits data - submitData
}
},
submitData: function(){
//make ajax call here
}
Run Code Online (Sandbox Code Playgroud)
如何从checkData函数else块中调用submitData函数?
以下是上述两个函数的完整代码: 链接到JSBin
我想value通过value从另一个page或另一个输入区域取一个来设置文本。这是我的文本字段。我为尝试了多种组合this.byId("thisOne").,但没有用。
this.byId("thisOne").setValue("Some thing");
Run Code Online (Sandbox Code Playgroud)
其它的办法:
sap.ui.getCore().byId("thisOne")....
Run Code Online (Sandbox Code Playgroud)
文字元素:
<Text text="" id ="thisOne"/>
Run Code Online (Sandbox Code Playgroud)
我的XML文件:
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m" controllerName="App.view.Take"
xmlns:l="sap.ui.layout"
xmlns:f="sap.ui.layout.form">
<Page showHeader="false">
<Label text="thisOne" />
<Input text="" id="thisOne" />
<Button type="Accept" text="Accept" ></Button>
<Button type="Reject" text="Reject" ></Button>
</Page>
</mvc:View>
Run Code Online (Sandbox Code Playgroud) 我试图在主视图中选择列表的第一项。我正在从 Detail 控制器执行此操作。我可以选择列表中的项目,但它不会触发事件以在“详细信息”视图中显示详细信息。
主视图.xml
<List id="idMasterList" mode="{device>/listMode}" select="onSelect"
noDataText="{i18nMaster>masterListNoDataText}"
items="{ path: '/', sorter: {path: 'name'} }" icon="sap-icon://refresh">
<items>
<StandardListItem id="idStandardItem" type="{device>/listItemType}"
tooltip="{name}"
title="{name}"
info="{total}/{due}"
/>
</items>
</List>
Run Code Online (Sandbox Code Playgroud)
详细信息.controller.js
sap.ui.getCore().byId("__xmlview2--idMasterList").getItems()[0].setSelected(true);
Run Code Online (Sandbox Code Playgroud)
我找不到任何可以直接解决这个问题的信息(或)我没有得到它!!!
任何帮助表示赞赏。
谢谢
我想构建自己的格式化程序来显示不同货币的金额。
有人可能猜到我使用了这个我已经知道的解决方案:
<t:template>
<Text text="{
parts: [
{path: 'amount'},
{path: 'currency'}
],
type:'sap.ui.model.type.Currency',
formatOptions: {
currencyCode: false
}
}"
</t:template>
Run Code Online (Sandbox Code Playgroud)
这个解决方案的问题是我已经在一个单独的列中显示了货币,如果我使用这个解决方案,它看起来很丑......
所以我尝试了这个:
<t:template>
<Text text="{parts: [
{path: 'amount'},
{path: 'currency'}
],
formatter : '.formatter.currency'}"
/>
</t:template>
Run Code Online (Sandbox Code Playgroud)
我的格式化程序功能如下所示:
currency: function(amount, currency) {
var change = [];
change.push(amount);
change.push(currency);
var sInternalType = "";
var amount1 = new sap.ui.model.type.Currency();
amount1.formatValue(change, sInternalType);
return amount1;
}
Run Code Online (Sandbox Code Playgroud)
在这里,我想我做错了什么,因为英语不是我的第一语言,我可能会认为我没有正确理解 API 参考,因为它们是这样说的:
我之前用 VBox 实现了聚合。这将获得所有“问题”并为每个问题创建一个文本框......
<VBox items="{path: 'view>questions', templateShareable: true}">
<items>
<VBox class="sapUiTinyMargin" templateShareable="true">
<Text text="Question {view>OrderSequence}"/>
</VBox>
</items>
</VBox>
Run Code Online (Sandbox Code Playgroud)
我需要做同样的事情,但对于 formElements。这能做到吗?
<f:formElements>
<f:FormElement label="{i18n>radioLabel}">
<f:fields>
<Input value="{viewmodel>radioLabel}" id="__redioLabel"/>
</f:fields>
</f:FormElement>
</f:formElements>
Run Code Online (Sandbox Code Playgroud)
它似乎不适用于“项目”
我需要将参数传递给后端.我想为此使用$ filter.我下面的代码是不工作的,没有通过返回过滤器io_tech_request_context->get_filter( )->get_filter_select_options( )在FiguresEntitySet的.
var aFilters = [ new sap.ui.model.Filter("TeamMembers/Figures/FILTERKEY", sap.ui.model.FilterOperator.EQ, sFilterValue) ];
this.getView().bindElement({
path: "/TeamDataSet('0')",
parameters: {
expand: 'TeamMembers/Figures'
},
filters: aFilters
});
Run Code Online (Sandbox Code Playgroud) 我想在我的 sapui5 应用程序中捕获一个可选的 url 参数。
显现:
"routes": [
{
"pattern": "page_1:query:",
"name": "page_1",
"target": [
"page_1"
]
}]
Run Code Online (Sandbox Code Playgroud)
控制器:
handleRouteMatched: function(oEvent) {
var oArgs, oView, oQuery;
oArgs = oEvent.getParameter("arguments"); // undefined
console.log(oEvent.mParameters);
Run Code Online (Sandbox Code Playgroud)
测试用例
根据测试用例模式 匹配
网址模式:查询:
清单模式:查询:
会匹配:{"query":"test=123123,bla=123213"}
网址:
/webapp/index.html?test=123
没有值:oEvent.mParameters.data.hash:“”
/webapp/index.html?#/query=123
有值:oEvent.mParameters.data.hash:查询=“123”
我想绑定 JSON 数据来查看我尝试过的如下:
XML:
<m:Select id="Employee" items="{Employee>/EmployeeList}">
<c:Item key="{Employee>key}" text="{Employee>value}" />
<m:layoutData>
<l:GridData span="L2 M2 S2"/>
</m:layoutData>
Run Code Online (Sandbox Code Playgroud)
这是我的 JSON 数据的方式:
var xyz = {
"Employee": {
"EmployeeList": [{
"key": "ram",
"value": "ram"
},
{
"key": "raj",
"value": "raj"
},
{
"key": "rani",
"value": "rani"
}
]
}
}
var oModel = new sap.ui.model.json.JSONModel();
oModel.setData(xyz);
this.getView().setModel(oModel);
Run Code Online (Sandbox Code Playgroud)
我有一个选择框,我想在视图页面中将员工姓名显示为下拉列表。如何绑定这个 XML。提前谢谢
我在 SAP Web IDE 中创建了一个项目。在那里我看到了一个名为.che的文件夹。有人可以解释为什么我们需要使用该文件夹吗?如果我们不使用它会怎样?