Navigate to a new search based on context

Build 1501 on 14/Nov/2017  This topic last edited on: 1/Sep/2014, at 09:57

You can navigate to a new search based on the current selection, for example if we were displaying a list of editions, selecting one and running an extended search on it would replace the current list of editions with a list of pages on that edition.

This is achieved through the search built-in command:

<contextMenu objectTypeName="edition">

  ...

  <menuItem name="Pages" iconName="fa-edit" command="search">

    <params>

      <add key="searchContextName" value="Pages"/>

      <add key="dirStyleKind" value="1"/>

      <add key="dirStyleName" value="MediumIcons"/>

      <add key="xpath" value="[gn4:editionRef/@idref = $p0]"/>

    </params>

   </menuItem>

The extra parameters define what extra conditions are to be applied and which searchContext to use.

searchContextName: the name of the searchContext used to display
the results.

xpath: the extra condition to use with that defined in the searchContext identified above. The $p0 placeholder in the expression will be replaced with
the id of the selected object.

dirstyleKind: the type of directory style use display the results: 0 for a table, 1 for a grid.

dirstyleName: the name of the directory style to use.

The navigation history is updated when using this search, e.g. having displayed the pages for the selected edition it would be possible to navigate back to the list of editions.