cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Backoffice StandardDateRange in advanced- and simple-search

voiv
Explorer
0 Kudos
924

Hi,

My Type Foo contains a field "dates" of Type List<StandardDateRange> (de.hybris.platform.util.StandardDateRange).

Now i would like to add this field to the Backoffice advanced-search with this configuration:

<context type="Foo" component="advanced-search">
  <as:advanced-search connection-operator="AND">
    <as:field-list>
      <as:field name="dates" operator="contains" selected="true"/>
    </as:field-list>
  </as:advanced-search>
</context>


But the field doesn't appear:

I also would like to make the same field sortable in the List-View int the collection-browser.

How do I add the field to the advanced-search?

Is it possible and recommendable to make the "dates" field sortable in the List-View of the collection-browser?

Kindest regards

View Entire Topic
0 Kudos

Hi Ivo,

Sorry for my delay response.

Basically I didn't get the idea of having a List<StandardDateRange>, probably your case is require different approach. However, here is what I've got for you. Hope will help at least to get some idea from the configuration below.

Other than that if you give more details maybe I can think for a different approach.

*-items.xml

<itemtype code="Foo" autocreate="true" generate="true" extends="Product">
<attributes>
<attribute qualifier="dateRange" type="de.hybris.platform.util.StandardDateRange">
<description>date range the trigger is active</description>
<modifiers read="true" write="true" initial="false" optional="true"/>
<persistence type="property"/>
</attribute>
</attributes>
</itemtype>

*backoffice-config.xml

<context type="Foo" component="advanced-search" merge-by="type" parent="Product">
<as:advanced-search xmlns:as="http://www.hybris.com/cockpitng/config/advancedsearch" connection-operator="AND">
<as:field-list>
<as:field name="dateRange" operator="contains" selected="true" sortable="true"/>
</as:field-list>
</as:advanced-search>
</context>
<context type="Foo" component="listview" merge-by="type">
<list-view:list-view>
<list-view:column link="true" position="3" qualifier="dateRange" hflex="true" label="DateRannge" spring-bean=""/>
</list-view:list-view>
</context>

in the listview tag if you want to have a better rendering you need to define a spring-bean="theIdOfYourRenderer"

Other then that the field is sortable and it's displayed in the search and list view.

Hope this helps.

Best Regards,

0 Kudos

Forgot to attach the screenshot for you.