在 Hybris cockpit 中修改简单搜索
Modify Simple Search in Hybris cockpit
我正在尝试修改促销的简单搜索行为。我只想搜索 'name' 字段。
我这样做了:
<context type="PromotionSourceRule" component="simple-search">
<yss:simple-search xmlns:yss="http://www.hybris.com/cockpitng/config/simplesearch">
<yss:field name="name"/>
</yss:simple-search>
</context>
但问题是字段 'name' 已本地化,我现在的简单搜索只搜索英语。
我还有德语和荷兰语本地化版本,我也想用这些语言进行搜索。
有什么想法吗?
您不能对本地化字段使用 simple-search
。
您必须配置您的语言,请参阅 com.hybris.cockpitng.editor.localized.LocalizedSimpleEditor
and use advanced-search widget。
LocalizedSimpleEditor
Description
A drop-down list version of the Localized Editor applied in the Advanced Search widget.
Type
Reference to any type which must be provided in the following format LocalizedSimple( ), for example:
LocalizedSimple(java.lang.String)
LocalizedSimple(java.lang.Integer)
LocalizedSimple(Reference(Product))
示例:
<as:field editor="com.hybris.cockpitng.editor.localized(com.hybris.cockpitng.editor.defaulttext)" .../>
高级搜索小部件示例
<context type="Product" component="advanced-search">
<as:advanced-search xmlns:as="http://www.hybris.com/cockpitng/config/advancedsearch" connection-operator="AND">
<as:field-list disable-attributes-comparator="false" disable-subtypes-checkbox="false">
<as:field name="code" operator="equals" selected="true"/>
<as:field name="approvalStatus" operator="equals" selected="false"/>
<as:field editor="com.hybris.cockpitng.editor.defaultlong" name="pk" operator="less" selected="true" sortable="false"/>
<as:field name="modifiedtime" operator="greaterOrEquals" selected="true"/>
</as:field-list>
<as:sort-field name="code" asc="false" />
</as:advanced-search>
我正在尝试修改促销的简单搜索行为。我只想搜索 'name' 字段。 我这样做了:
<context type="PromotionSourceRule" component="simple-search">
<yss:simple-search xmlns:yss="http://www.hybris.com/cockpitng/config/simplesearch">
<yss:field name="name"/>
</yss:simple-search>
</context>
但问题是字段 'name' 已本地化,我现在的简单搜索只搜索英语。
我还有德语和荷兰语本地化版本,我也想用这些语言进行搜索。
有什么想法吗?
您不能对本地化字段使用 simple-search
。
您必须配置您的语言,请参阅 com.hybris.cockpitng.editor.localized.LocalizedSimpleEditor
and use advanced-search widget。
LocalizedSimpleEditor
Description
A drop-down list version of the Localized Editor applied in the Advanced Search widget.
Type
Reference to any type which must be provided in the following format LocalizedSimple( ), for example:
LocalizedSimple(java.lang.String) LocalizedSimple(java.lang.Integer) LocalizedSimple(Reference(Product))
示例:
<as:field editor="com.hybris.cockpitng.editor.localized(com.hybris.cockpitng.editor.defaulttext)" .../>
高级搜索小部件示例
<context type="Product" component="advanced-search">
<as:advanced-search xmlns:as="http://www.hybris.com/cockpitng/config/advancedsearch" connection-operator="AND">
<as:field-list disable-attributes-comparator="false" disable-subtypes-checkbox="false">
<as:field name="code" operator="equals" selected="true"/>
<as:field name="approvalStatus" operator="equals" selected="false"/>
<as:field editor="com.hybris.cockpitng.editor.defaultlong" name="pk" operator="less" selected="true" sortable="false"/>
<as:field name="modifiedtime" operator="greaterOrEquals" selected="true"/>
</as:field-list>
<as:sort-field name="code" asc="false" />
</as:advanced-search>