AnsweredAssumed Answered

Taglibs and browser navigation

Question asked by sergi.l on Jul 6, 2009
Hi All!

I have overrode the "browse.jsp" to add my custom functionallity.
The purpose is: If my own content items are shown, the content URL that would open the document will be my own viewer. However, I want to keep the standard functionallity for the others types.

So I have developed something like

<%– Primary column for details view mode –%>
<a:column id="col10" primary="true" width="200" style="padding:2px;text-align:left" rendered="#{BrowseBean.browseViewMode == 'details'}">
<f:facet name="header">
<a:sortLink id="col10-sort" label="#{msg.name}" value="name" mode="case-insensitive" styleClass="header"/>
</f:facet>
<f:facet name="small-icon">
<%– Keep the standard viewer –%>
<c:if test="${!folderBloqueDocumental && (NavigationBean.searchContext == null)}">
<a:actionLink id="col10-act1" value="#{r.name}" href="#{r.url}" target="new" image="#{r.fileType16}" showLink="false" styleClass="inlineAction" />
</c:if>
<%– Show my own viewer –%>
<c:if test="${folderBloqueDocumental || (NavigationBean.searchContext != null)}">
<a:actionLink id="col10-act2" value="#{r.name}" onclick="window.open('/alfresco/wcs/ui/smsviewer?path=#{r.nodeRef}','Visor','width=1024,height=670,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=1')" image="#{r.fileType16}" showLink="false" styleClass="inlineAction" />
</c:if>

</f:facet>
<%– Keep the standard viewer –%>
<c:if test="${!folderBloqueDocumental && (NavigationBean.searchContext == null)}">
<a:actionLink id="col10-act3" value="#{r.name}" href="#{r.url}" target="new" />
</c:if>
<%– Show my own viewer –%>
<c:if test="${folderBloqueDocumental || (NavigationBean.searchContext != null)}">
<a:actionLink id="col10-act4" value="#{r.name}" onclick="window.open('/alfresco/wcs/ui/smsviewer?path=#{r.nodeRef}','Visor','width=1024,height=670,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=1')" />
</c:if>

<r:lockIcon id="col10-lock" value="#{r.nodeRef}" align="absmiddle" />
<h:outputLabel id="col10-lang" value="#{r.lang}" styleClass="langCode" rendered="#{r.lang != null}" />
<r:nodeInfo id="col10-info" value="#{r.id}">
<h:graphicImage id="col10-img" url="/images/icons/popup.gif" styleClass="popupImage" width="16" height="16" />
</r:nodeInfo>
</a:column>

This is working!!
But there's an exception. When I navigate to the folder, the element is shown, and then if I press the browser's "Back" button (tested with IE7 and Firefox), the previous screen is shown and navigating againg with a simple click to the folder that cointain the document, both actionLinks are shown!! It's like "c:if" doesn't take effect (but I added a literal and it's always correctly shown according to this condition).
If I avoid the browser back navigation everything's fine. But this is not a solution for the final user.

Why "c:if" condition is not working?? I have also duplicated the entire column and used the column "rendered" attribute to show one viewer or another and it's the same.
Please help!! How can I do that??

Many thanks,
Sergi

Outcomes