我有一个可以工作的应用程序(A),它在XML中使用SmartFields。我基于这个工作应用程序创建了一个扩展项目,我的工作应用程序(A)仍然工作良好,所有数据都按预期显示。
但是当我运行我的扩展项目时:我在应用程序(A)中使用的SmartFields只显示标签而不显示绑定值,即使我使用UI5-Inspector,值也包含数据。
即使是我在扩展项目中创建的SmartFields (我为包含SmartFields的额外片段创建了一个扩展点),也只显示标签,而不显示我插入的值:
<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的属性:

有什么可能导致这个问题的想法吗?
提前感谢!
发布于 2018-12-13 18:05:48
我能够重新创建它,似乎value property只能与绑定一起工作。
Value Control Property Definition
&
data.json和view.xml文件:
[{
"nummerke": "nummerke",
"Euro": "0.00€",
"Local": "Locatie",
"Letter": "a"
}]<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>
希望能有所帮助。
https://stackoverflow.com/questions/53757398
复制相似问题