首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Backoffice Itemtype过滤

Backoffice Itemtype过滤
EN

Stack Overflow用户
提问于 2018-06-27 19:09:45
回答 2查看 918关注 0票数 1

我有一个名为InoLocation的项目,它有一个名为'InoLocationType‘的枚举类型。此枚举类型包含3个值: COUNTRY、CITY、COUNTY。存在将城市和县导入到此项类型的impexes。在items.xml上,我创建了一个名为'cities‘的属性,它的类型是InoLocation。

默认情况下,'cities‘返回所有枚举类型。我想过滤这些枚举,只是在后台显示城市类型。

有可能吗?

代码语言:javascript
复制
<enumtypes>
    <enumtype code="InoLocationType" >
        <value code="COUNTRY"></value>
        <value code="CITY"></value>
        <value code="COUNTY"></value>
    </enumtype>
</enumtypes>

<itemtypes>
    <itemtype generate="true"
              code="InoLocation"
              jaloclass="com.inomera.hybris.custom.location.jalo.InoLocation"
              extends="GenericItem"
              autocreate="true">
        <deployment table="ino_location" typecode="11115"/>

        <attributes>

            <attribute qualifier="code" type="java.lang.String">
                <description>City's Plate Code</description>
                <modifiers initial="true"/>
                <persistence type="property"/>
            </attribute>

            <attribute qualifier="name" type="java.lang.String">
                <description>Location Name</description>
                <modifiers initial="true"/>
                <persistence type="property"/>
            </attribute>

            <attribute qualifier="parent" type="InoLocation">
                <description>Selected location's parent location</description>
                <modifiers read="true" write="true" search="true"/>
                <persistence type="property"/>
            </attribute>

            <attribute qualifier="type" type="InoLocationType">
                <description>Location Type</description>
                <modifiers initial="true"/>
                <persistence type="property"/>
            </attribute>


        </attributes>

    </itemtype>
</itemtypes>

Cities labelCities label opened

还有一件事,

这些屏幕来自backoffice,它们作为模型返回,我希望它们返回它们的'name‘属性。

EN

回答 2

Stack Overflow用户

发布于 2018-06-27 23:32:18

您可以使用下面的代码片段在后台中仅提供"CITY“。

代码语言:javascript
复制
<attribute qualifier="type" type="InoLocationType">
   <description>Location Type</description>
   <defaultvalue>em().getEnumerationValue("InoLocationType", "CITY")</defaultvalue>
   <modifiers optional="false" read="true" write="false"/>
    <persistence type="property"/>
</attribute>

这将启用属性类型的默认值为“城市”,并且该属性作为不可更改的属性存在。

希望这能有所帮助!

票数 0
EN

Stack Overflow用户

发布于 2018-12-25 01:09:16

考虑一下availableValuesProvider编辑器参数:

代码语言:javascript
复制
<wz:property qualifier="cities">
    <wz:editor-parameter>
         <wz:name>availableValuesProvider</wz:name>
         <wz:value>onlyWhatIWantToDisplayProvider</wz:value>
     </wz:editor-parameter>
</wz:property>

onlyWhatIWantToDisplayProviderReferenceEditorSearchFacade的一个实现,您必须将其声明为spring bean。

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

https://stackoverflow.com/questions/51061274

复制
相关文章

相似问题

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