cancel
Showing results for 
Search instead for 
Did you mean: 

Number of items in browse.jsp

back0rifice
Champ in-the-making
Champ in-the-making
Hello!

Can someone please tell me how to determine the number of items in the two existing sections

* spaces
* content

in browse.jsp?!

I need this because I want to show/hide the section depending on if content exists or not. But unfortunately I have no idea how to figure out if there is any data to display in spaces and content section.

What I'd need is something like that:

<c:if test="${something.count > 0)">
   <%– Details - Content –%>
</c:if>

TIA!  Smiley Happy
3 REPLIES 3

back0rifice
Champ in-the-making
Champ in-the-making
nobody?  :?:

what i found out so far is this:

1.) <c:if…> seems to be ignored completely but i dont know why?!

2.)

<a:booleanEvaluator value="#{!empty BrowseBean.nodes}">
<%– Details - Spaces –%>

</a:booleanEvaluator>

works BUT i have to double-click each folder, that means i have to click it once - nothing happens - and afterwards a second time before the web client navigates to the "subdolder" and as in 1. i have no idea why this is happening?

i hope that anybody can help?  :?

kevinr
Star Contributor
Star Contributor
Our pages are 99% based on JSF tags, which do not interoperate well with JSTL tags like you are using. So use of an outer <a:booleanEvaluator> tag or the rendered="true|false" attribute (available on virtually all JSF components) is the correct pattern.

I'm not sure why you are needed to click the items twice - are you using the BACK button? As this is a limitation of the MyFaces JSF library we are using - the BACK button is only supported after clicking twice on an item (to restore the server state).

Thanks,

Kevin

back0rifice
Champ in-the-making
Champ in-the-making
Ok, thanks for your answer.

Does that mean that the following lines of code should achieve the wanted result?

<%– Spaces List –%>
<a:richList id="spacesList" binding="#{BrowseBean.spacesRichList}" viewMode="#{BrowseBean.browseViewMode}" pageSize="#{BrowseBean.pageSizeSpaces}"
styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
value="#{BrowseBean.nodes}" var="r" rendered="#{NavigationBean.searchContext != null}">

Of course I'm asking because it doesn't work…  :wink:


Edit: problem solved. The rendered attribute has to be used with the panel and doesn't work with the richList. Sorry, my fault…