首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >扩展项目中的SAPUI5智能域

扩展项目中的SAPUI5智能域
EN

Stack Overflow用户
提问于 2018-12-13 16:03:53
回答 1查看 637关注 0票数 0

我有一个可以工作的应用程序(A),它在XML中使用SmartFields。我基于这个工作应用程序创建了一个扩展项目,我的工作应用程序(A)仍然工作良好,所有数据都按预期显示。

但是当我运行我的扩展项目时:我在应用程序(A)中使用的SmartFields只显示标签而不显示绑定值,即使我使用UI5-Inspector,值也包含数据。

即使是我在扩展项目中创建的SmartFields (我为包含SmartFields的额外片段创建了一个扩展点),也只显示标签,而不显示我插入的值:

代码语言:javascript
复制
<core:FragmentDefinition xmlns:core="sap.ui.core" xmlns="sap.uxap" xmlns:layout="sap.ui.layout" xmlns:m="sap.m"
xmlns:suite="sap.suite.ui.commons" xmlns:comp="sap.ui.comp.variants" xmlns:smartForm="sap.ui.comp.smartform"
xmlns:smartField="sap.ui.comp.smartfield">
<ObjectPageSection title="{i18n_AfkoppelingsDossier>tab.Project}" id="projectTab-ObjectPageSection--id">
    <subSections>
        <ObjectPageSubSection>
            <blocks>
                <smartForm:SmartForm id="ProjectSmartFormId" editable="true">
                    <!-- Kolom 1 -->
                    <smartForm:Group label="{i18n_AfkoppelingsDossier>title.project}">
                            <smartForm:GroupElement useHorizontalLayout="true">
                            <m:Input value="abc"/>
                        </smartForm:GroupElement>
                        <smartForm:GroupElement>
                            <smartField:SmartField id="IDWBSElement" textLabel="{i18n_AfkoppelingsDossier>label.WBS.element}" value="a"/>
                        </smartForm:GroupElement>
                        <smartForm:GroupElement useHorizontalLayout="true">
                            <smartField:SmartField id="IDContractNumber" textLabel="{i18n_AfkoppelingsDossier>label.contrNr.contractor}" value="nummerke"/>
                        </smartForm:GroupElement>
                        <smartForm:GroupElement useHorizontalLayout="true">
                            <smartField:SmartField id="IDMaxIntervention" textLabel="{i18n_AfkoppelingsDossier>label.max.intervention}" value="0.00€"/>
                        </smartForm:GroupElement>
                        <smartForm:GroupElement useHorizontalLayout="true">
                            <smartField:SmartField id="IDLocationInfomeeting" textLabel="{i18n_AfkoppelingsDossier>label.location.infomeeting}" value="Locatie"/>
                        </smartForm:GroupElement>
                    </smartForm:Group>
                </smartForm:SmartForm>
            </blocks>
        </ObjectPageSubSection>
    </subSections>
</ObjectPageSection>

我已经检查了我的DevTools,值就在那里,所以我不知道为什么它没有显示值。

SmartField的属性:

有什么可能导致这个问题的想法吗?

提前感谢!

EN

回答 1

Stack Overflow用户

发布于 2018-12-13 18:05:48

我能够重新创建它,似乎value property只能与绑定一起工作。

Value Control Property Definition

&

SmateField Example

data.json和view.xml文件:

代码语言:javascript
复制
[{

  "nummerke": "nummerke",
  "Euro": "0.00€",
  "Local": "Locatie",
  "Letter": "a"
}]
代码语言:javascript
复制
<mvc:View controllerName="com.controller.name" xmlns="sap.m" xmlns:smartForm="sap.ui.comp.smartform" xmlns:viz="sap.viz.ui5.controls" xmlns:mvc="sap.ui.core.mvc" xmlns:viz.feeds="sap.viz.ui5.controls.common.feeds" xmlns:viz.data="sap.viz.ui5.data" xmlns:suite="sap.suite.ui.commons"
  xmlns:comp="sap.ui.comp.variants" xmlns:smartField="sap.ui.comp.smartfield">
  <Page id="page" title="PageTitle" showHeader="true" enableScrolling="true">
    <content>
      <FlexBox alignItems="Center" busyIndicatorDelay="{masterView>/delay}" renderType="Bare" class="ne-flexbox2" width="100%" justifyContent="SpaceBetween" id="container">
        <items>
          <smartForm:SmartForm id="ProjectSmartFormId" editable="true">
            <!-- Kolom 1 -->
            <smartForm:Group label="title.project">
              <smartForm:GroupElement useHorizontalLayout="true">
                <Input value="abc" />
              </smartForm:GroupElement>
              <smartForm:GroupElement>
                <smartField:SmartField id="IDWBSElement" value="{/0/Letter}" />
              </smartForm:GroupElement>
              <smartForm:GroupElement useHorizontalLayout="true">
                <smartField:SmartField id="IDContractNumber" textLabel="label.contrNr.contractor" value="{nummerke}" />
              </smartForm:GroupElement>
              <smartForm:GroupElement useHorizontalLayout="true">
                <smartField:SmartField id="IDMaxIntervention" textLabel="label.max.intervention" value="{/0/Euro}" />
              </smartForm:GroupElement>
              <smartForm:GroupElement useHorizontalLayout="true">
                <smartField:SmartField id="IDLocationInfomeeting" textLabel="label.location.infomeeting" value="{/0/Local}" />
              </smartForm:GroupElement>
            </smartForm:Group>
          </smartForm:SmartForm>
        </items>
      </FlexBox>
    </content>
  </Page>
</mvc:View>

希望能有所帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53757398

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档