cancel
Showing results for 
Search instead for 
Did you mean: 

Change Default View for Browse.jsp

lnagra
Champ in-the-making
Champ in-the-making
Does anyone know how to change the default view for browse.jsp

I wish to make the 'Details' view rather than browse be the default and in fact, remove the option to select different views altogether.

I can see this in browse.jsp
 <%– View mode settings –%>                              <h:outputText style="padding-left:26px" styleClass="mainSubTitle" value="#{msg.view}"/><br>                              <a:modeList itemSpacing="3" iconColumnWidth="20" selectedStyleClass="statusListHighlight" disabledStyleClass="statusListDisabled" selectedImage="/images/icons/Details.gif"                                    value="#{BrowseBean.browseViewMode}" actionListener="#{BrowseBean.viewModeChanged}">                                 <a:listItem value="details" label="#{msg.details_view}" />                                 <a:listItem value="icons" label="#{msg.view_icon}" />                                 <a:listItem value="list" label="#{msg.view_browse}" />                                 <a:listItem value="dashboard" label="#{msg.dashboard_view}" disabled="#{!NavigationBean.currentNodeHasTemplate}" />                              </a:modeList>‍‍‍‍‍‍‍‍‍‍

This just looks like it's used to change the views rather than set the default.

And have had a look in BrowseBean.jsp for default variables or if it's set during the constructor, but with no luck.

Any help?
1 REPLY 1

kevinr
Star Contributor
Star Contributor
The default view is configurable in the web-client-config.xml file - look for this block:
         <!– default values for the views available in the client –>         <view-defaults>            <browse>               <!– allowable values: list|details|icons –>               <view>icons</view>               <page-size>                  <list>10</list>                  <details>10</details>                  <icons>9</icons>               </page-size>            </browse>‍‍‍‍‍‍‍‍‍‍‍‍‍
and change the <view> element value to "details".

To completely remove the other available views, then editing the JSP as follows should work:
                              <a:modeList itemSpacing="3" iconColumnWidth="20" selectedStyleClass="statusListHighlight" disabledStyleClass="statusListDisabled" selectedImage="/images/icons/Details.gif"                                    value="#{BrowseBean.browseViewMode}" actionListener="#{BrowseBean.viewModeChanged}">                                 <a:listItem value="details" label="#{msg.details_view}" />                              </a:modeList>‍‍‍‍‍‍

Or you could simply do this:
                              <a:modeList itemSpacing="3" iconColumnWidth="20" selectedStyleClass="statusListHighlight" disabledStyleClass="statusListDisabled" selectedImage="/images/icons/Details.gif"                                    value="details" actionListener="#{BrowseBean.viewModeChanged}">                                 <a:listItem value="details" label="#{msg.details_view}" />                              </a:modeList>‍‍‍‍‍‍
And the component would never ask the BrowseBean for the view mode anyway and would use "details" only.

Hope this helps,

Kevin