小编Jar*_*aro的帖子

在C++中打开一个数字高于9的COM端口

我在C++中使用COM端口.我无法打开数字大于9的COM端口,例如10.这是用于COM端口检测的功能:

WCHAR port_name[7];
WCHAR num_port[4];        

for (i=1; i<256; i++)
{
    bool bSuccess = false;

    wcscpy(port_name,L"COM");
    wcscat(port_name,_itow(i,num_port,10));

    HANDLE hPort;

    //Try to open the port
    hPort = CreateFile(L"COM10", GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
    //hPort = CreateFile(port_name, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);

    if (hPort == INVALID_HANDLE_VALUE)
    {
        DWORD dwError = GetLastError();

        //Check to see if the error was because some other application had the port open
        if (dwError == ERROR_ACCESS_DENIED)
        {
            bSuccess = TRUE;
            j=j+1;  
        }
    } …
Run Code Online (Sandbox Code Playgroud)

c++ ports

8
推荐指数
2
解决办法
2万
查看次数

SAPUI5在控制器中动态创建ComboBox

目前我正在我的页面中开发 SAPUI5 应用程序。我必须根据微服务的数据动态创建组合框。

\n\n

我按照以下网址中的示例代码进行操作。\n查看源:https ://sapui5.hana.ondemand.com/test-resources/sap/m/ComboBox.html

\n\n

但是,它在我的组合框中返回空

\n\n

以下是我的示例代码。

\n\n
$.ajax({\n                    url: "json/customers.json", \n                    dataType: \'json\',\n                    success: function(response){\n                        var data= response; \n                        console.log(data);\n                        var customerModel = new JSONModel(data);\n                        console.log(customerModel);\n                        oController.getView().setModel(customerModel, "customerJSON");\n                        var ExtensionForm = oController.getView().byId("Extension_Form");\n\n                                ExtensionForm.addContent(new sap.m.ComboBox(oController.getView().createId(\xe2\x80\x9cExtensionLabelId\xe2\x80\x9d), {\n                                    items: {\n                                        path: "{ComboBoxModel>/}",\n                                        template: new sap.ui.core.Item({\n                                            key: "{ComboBoxModel>CUSTOMER_NAME}",\n                                            text: "{ComboBoxModel>CUSTOMER_NAME}"\n                                        })\n                                    },\n                                    value : "{model2>/"+ keys[i] + "/fieldvalue}",\n                                    enabled: false\n                                }));\n                    },\n                    error: function(error)\n                    {\n                        console.log("Error Message : " + JSON.stringify(error));\n                    }\n                });\n
Run Code Online (Sandbox Code Playgroud)\n

javascript ajax sapui5

5
推荐指数
1
解决办法
7040
查看次数

在智能表的P13n对话框​​的"过滤器"选项卡中添加包含过滤选项

我使用SmartTable,属性useTablePersonalisation设置为true,按钮生成P13n对话框在此输入图像描述.根据手册我应该能够更改过滤器操作符的数据类型:

第二个字段为操作员提供了更详细的指定过滤器.可用的运算符取决于所选列的数据类型.

我对手册中的这两个选项感兴趣: 在此输入图像描述

我想获得"字符串类型"选项,它会自动生成:

在此输入图像描述

但我仍然为"数字类型"而不是"字符串类型"自动生成选项.我在后端实体中将此字段声明为Edm.String.

在此输入图像描述

请问你知道如何解决这个问题吗?

这是我的xml代码,Abc是Edm.String:

                        <smartTable:SmartTable id="idSmartTable" smartFilterId="idSmartFilterBar" tableType="ResponsiveTable" entitySet="AbcSet"
                        useVariantManagement="false" useTablePersonalisation="true" header=" " showRowCount="true" enableAutoBinding="true" useExportToExcel="false"
                        showFullScreenButton="true">
                        <Table growing="true" mode="None">
                            <columns>
                                <Column>
                                    <customData>
                                        <core:CustomData key="p13nData" value='\{"columnKey": "Abc","leadingProperty": "Abc","sortProperty": "Abc","filterProperty": "Abc"}'/>
                                    </customData>
                                    <header><Text text="{i18n>Abc}" wrapping="false"/></header>
                                </Column>                                                                   
                            </columns>
                            <items>
                                <ColumnListItem>
                                    <cells>
                                        <Text text="{Abc}"/>                                            
                                    </cells>
                                </ColumnListItem>
                            </items>
                        </Table>
                    </smartTable:SmartTable>
Run Code Online (Sandbox Code Playgroud)

我试图改变数据类型的"sap.ui.model.type.String" 的CustomData在XML表定义或ColumnListItem但也许我做错了什么.我必须使用1.38 UI5版本.

感谢您的任何设备.

sapui5

5
推荐指数
1
解决办法
271
查看次数

是否可以在 SAP Cloud Platform 中刷新/刷新特定的离线 oData 实体?

标准刷新/刷新离线 oData 功能在离线存储中的所有实体上执行。

当然,这会对移动数据和性能产生影响。

有没有办法只刷新/刷新离线商店中的特定实体?

mobile sapui5 sap-cloud-platform

5
推荐指数
1
解决办法
520
查看次数

获取注册表中所有实例化控件的列表

我了解OpenUI5具有实例化控件的注册表,可以通过来查询sap.ui.getCore().byId

但是,有没有办法在控制注册表中获取实例的完整列表?

像这样:

var aControls = sap.ui.getCore().allControls();
Run Code Online (Sandbox Code Playgroud)

sapui5

3
推荐指数
1
解决办法
805
查看次数

如何扩展翻译?

我扩展了一个标准 fiori 应用程序,我也想扩展i18n
扩展应用程序的结构如下所示:

在此输入图像描述

Component.js文件中,我注意到扩展名:

this.i2d.eam.pmnotification.create.s1.Component.extend("i2d.eam.pmnotification.create.s1.ZEAM_NTF_CRES1_EXT.Component", {
    metadata: {
        manifest: "json",
        config: {
            "sap.ca.i18Nconfigs": {
                bundleName: "i2d.eam.pmnotification.create.s1.ZEAM_NTF_CRES1_EXT.i18n.i18n"
            }
        }
    }
}); 
Run Code Online (Sandbox Code Playgroud)

但文本仍然没有被翻译。

文件内容i18n.properties

ext.createNotification=Create notification
ext.createOrder=Create order 
Run Code Online (Sandbox Code Playgroud)

和按钮,使用翻译:

<Button press="onCreateWithOrder" text="{i18n>ext.createOrder}" />
<Button press="onSave" text="{i18n>ext.createNotification}"/>  
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

sapui5

3
推荐指数
1
解决办法
2498
查看次数

SAPUI5中如何将属性值传递给init方法?

假设我有一堂课

sap.ui.core.Control.extend("sap.my.MyButton", {
    metadata: {
        properties: {                
            "isButtonWithMenu": {
                type: "boolean",
                defaultValue: true
            }
        }
    }
},

init: function () {
    if (this.getIsButtonWithMenu()) {
         this.myButton = this._createMenuButton();
    } else {
         this.myButton = this._createNormalButton();
    }
    var baseBox = new sap.m.FlexBox();
    baseBox.addItem(this.myButton);
    this.setLayout(baseBox);
}
Run Code Online (Sandbox Code Playgroud)

现在我想将 的值传递isButtonWithMenu到我的init方法中,并执行以下操作:

var myButton = new sap.my.MyButton({isButtonWithMenu: false});
Run Code Online (Sandbox Code Playgroud)

但这不起作用,这意味着我没有在类中获得传递的值。但是,当我更改它时defaultValue,它确实有效,那么,这里出了什么问题以及我如何实现我的目标?

javascript sapui5

2
推荐指数
1
解决办法
1509
查看次数

如果在 sap UI5 中第一个文本为空,如何显示第二个文本

控制器.js

table.bindItems({
    path: "/",
    template: new sap.m.ColumnListItem({
        cells: [
            new sap.m.Text({
                text: "{account} ? {recieverAddress} "
            }),
        ]
    })
});
Run Code Online (Sandbox Code Playgroud)

在这里,如果“account”为空,我必须显示“recieverAddress”。如何在 sap ui5 中执行此操作?

sapui5

2
推荐指数
1
解决办法
390
查看次数

SAPUI5 自动绑定智能表(带过滤器)

我有一个智能表,它绑定到启用了自动绑定的 oData 服务。目前,它返回实体集的所有数据。

我需要的是在从 oData 服务加载数据时过滤数据。我尝试在控制器中添加过滤器,但它不起作用。

看法

<smartTable:SmartTable id=mytable" entitySet="SampleDetail"  tableType="ResponsiveTable"
                    useExportToExcel="false" beforeExport="onBeforeExport" useVariantManagement="false" useTablePersonalisation="true"
                    header="{i18n>tickets_table_header}" showRowCount="true" persistencyKey="ticketsSmartTable_persis" enableAutoBinding="true"
                    demandPopin="true" class="sapUiResponsiveContentPadding">
</smartTable:SmartTable>
Run Code Online (Sandbox Code Playgroud)

和控制器js

var serviceURL = this.getConfiguration("myDestination");
            serviceURL = serviceURL + "sample.xsodata";
            var oModel, oView, that = this;
            var filtersDef = [];
            filtersDef.push(new Filter("STATUS", sap.ui.model.FilterOperator.NE, "D"));

            oView = this.getView();
            oModel = new sap.ui.model.odata.v2.ODataModel(serviceURL, {
                useBatch: false
            });


            oModel.read("/SampleDetail", {
                async: true,
                success: function(e) {
                    that.setModel(oModel);

                },
                error: function(e) {
                    oModel.setData({

                    });
                },
                filters: filtersDef
            });
Run Code Online (Sandbox Code Playgroud)

odata sapui5

2
推荐指数
1
解决办法
2万
查看次数

SAPUI5应用程序无法加载ABAP存储库中的CSS文件

我有一份SAPUI5申请。

manifest.json我通过如下方式向其中添加了一个自定义 css 文件:

"resources": {
        "css": [
            {
                "uri": "css/style.css"
            }
        ]
    },
Run Code Online (Sandbox Code Playgroud)

虽然当我将该文件部署到 ABAP 存储库时可以在 WEB IDE 中正确加载该文件,但它的地址无法正确解析。实际上,它尝试使用与 WEB IDE 中使用的相同地址加载 CSS 文件,显然会失败。

什么可能导致此问题?

sapui5

2
推荐指数
1
解决办法
1173
查看次数

标签 统计

sapui5 ×9

javascript ×2

ajax ×1

c++ ×1

mobile ×1

odata ×1

ports ×1

sap-cloud-platform ×1