cancel
Showing results for 
Search instead for 
Did you mean: 

problem trying to display location

stk137
Champ in-the-making
Champ in-the-making
so I want to display the location

So I added

<aSmiley Tongueanel id="location-header" rendered="#{(NavigationBean.searchContext == null)}">
<div class="mainSubText" style="font-weight:normal;"><hSmiley SurprisedutputText value="#{msg.location}" />: <r:nodePath value="#{NavigationBean.currentNode.nodeRef}" breadcrumb="true" showLeaf="true" actionListener="#{BrowseBean.clickSpacePath}" /></div>
</aSmiley Tongueanel>

Which does display the location except when there's a search which is what I want.  However, if you browse after a search it throws the error below about a duplicate in the faces tree. If I take it out the render condition and let it render with search results, it doesn't happen.

What do I need to do to keep this error from occuring when not showing the location with search results?

javax.faces.FacesException: Client-id : _idJsp19 is duplicated in the faces tree. Component : browse:_idJsp19, path: {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/browse/browse.jsp][Class: javax.faces.component.html.HtmlForm,Id: browse][Class: org.alfresco.web.ui.common.component.UIPanel,Id: spaces-panel][Class: org.alfresco.web.ui.common.component.data.UIRichList,Id: spacesList][Class: org.alfresco.web.ui.common.component.data.UIColumn,Id: col1][Class: org.alfresco.web.ui.common.component.UIActionLink,Id: col1-act2][Class: javax.faces.component.UIParameter,Id: _idJsp19]}
2 REPLIES 2

kevinr
Star Contributor
Star Contributor
When writing JSF pages, if you have components that are not immediately visible on the page - or can be made visible/invisble (i.e. actually missing from the page component tree rather than just set rendered=false) then you need to give those components an explicit ID value. It's annoying but that's just JSF Smiley Happy

So in your case this will probably work:

<a:panel id="location-header" rendered="#{(NavigationBean.searchContext == null)}">
<div class="mainSubText" style="font-weight:normal;"><h:outputText id="txt-loc1" value="#{msg.location}" />: <r:nodePath id="path-loc1" value="#{NavigationBean.currentNode.nodeRef}" breadcrumb="true" showLeaf="true" actionListener="#{BrowseBean.clickSpacePath}" /></div>
</a:panel>

Thanks,

Kevin

stk137
Champ in-the-making
Champ in-the-making
thanks,
I'll give that a try