SAPUI5运行时自适应的稳定ID

时间:2016-05-23 07:34:29

标签: sapui5

我尝试构建类似于此RTA Demo App的应用程序,但收到以下错误:

Generated id attribute found - to offer flexibility a stable control id is needed to assign the changes to, but for this control the id was generated by SAPUI5 __xmlview0--smartForm--GroupContactData

<smartForm:SmartForm 
    id="SmartFormSalesOrder"
    title="Sales Order Details"
    editTogglable="true"
    editable="true"
    entityType="myType">                   
    <smartForm:Group
        id="GroupGeneralData"
        label="{i18n>smartFormGroup1}">

        <smartForm:GroupElement 
            id="GroupElementGeneralDataType">
            <smartField:SmartField value="{value1}" />
        </smartForm:GroupElement>

        <smartForm:GroupElement 
            id="smartForm--GroupElementGeneralDataSoldToParty">
            <smartField:SmartField value="{value2}" />
        </smartForm:GroupElement>

        <smartForm:GroupElement 
            id="smartForm--GroupElementGeneralDataAddressStreet">
            <smartField:SmartField value="{value3}" />
        </smartForm:GroupElement>

        <smartForm:GroupElement 
            id="smartForm--GroupElementGeneralDataAddressCity">
            <smartField:SmartField value="{value4}" />
        </smartForm:GroupElement>

        <smartForm:GroupElement 
            id="smartForm--GroupElementGeneralDataAddressZipCode">
            <smartField:SmartField value="{value5}" />
        </smartForm:GroupElement>

    </smartForm:Group>
 </smartForm:SmartForm>

问题是ID的前缀是SAPUI5,我不知道如何阻止。如果ID的开头有两个下划线,SAPUI5 Framework会检查每个ID,如果是这样,则框架会引发&#34;生成的id属性找到&#34;例外。所以我的任务是:如何在示例应用程序中创建自己的前缀(&#34; RTADemoAPPMD&#34;)。

1 个答案:

答案 0 :(得分:0)

我必须为我的Smartform所在的View定义一个ID。我必须在组件的路由中定义ID,而不是在我的视图的XML中定义