Moving the statistics to the home page.

Need help? Post your questions here.

Moderator: moderators

Moving the statistics to the home page.

Postby mixmaster » Thu May 14, 2009 4:32 am

Help me out with this. I'm trying to take the statistics and move them to the home page so they are displayed right above the welcome message. The problem is the reference to the left object I think. How should I modify this reference so that I can get the stats to show?

I pulled this code from left.jsp

Code: Select all
<c:if test="${model.statistics.songCount gt 0}">
    <div class="detail">
      <b>Library Statistics:</b><br/>
        <fmt:message key="left.statistics">
            <fmt:param value="${model.statistics.artistCount}"/>
            <fmt:param value="${model.statistics.albumCount}"/>
            <fmt:param value="${model.statistics.songCount}"/>
            <fmt:param value="${model.bytes}"/>
            <fmt:param value="${model.hours}"/>
        </fmt:message>
    </div>
</c:if>


Where I'm trying to insert that is at the very bottom of the home.jsp

Code: Select all
            <c:if test="${not empty model.welcomeMessage}">
                <td style="vertical-align:top;width:20em">
                    <div style="padding:0 1em 0 1em;border-left:1px solid #<spring:theme code="detailColor"/>">
                        <sub:wiki text="${model.welcomeMessage}"/>
                    </div>
                </td>
            </c:if>
        </tr>
    </table>


So what I create is ...

Code: Select all
            <c:if test="${not empty model.welcomeMessage}">
                <td style="vertical-align:top;width:20em">
               <div class="detail">
                  <b>Library Statistics:</b><br/>
                  <fmt:message key="left.statistics">
                        <fmt:param value="${model.statistics.artistCount}"/>
                      <fmt:param value="${model.statistics.albumCount}"/>
                     <fmt:param value="${model.statistics.songCount}"/>
                      <fmt:param value="${model.bytes}"/>
                      <fmt:param value="${model.hours}"/>
                    </fmt:message><br/><br/>
                </div>
                    <div style="padding:0 1em 0 1em;border-left:1px solid #<spring:theme code="detailColor"/>">
                        <sub:wiki text="${model.welcomeMessage}"/>
                    </div>
                </td>
            </c:if>
        </tr>
    </table>


When I do that I get the following displayed above my welcome message:

Library Statistics:
null artists
null albums
null songs
null (~ null hours)


The problem I believe lies in the object references of left.statistics or model.statistics. Anyone know how I should modify these to get it to work?

Note that changing left.statistics to model.statistics doesn't help, so it's probably the model. references. Changing left.statistics to model.statistics results in:

Library Statistics:
???model.statistics???
________
mixmaster
 
Posts: 121
Joined: Thu Nov 13, 2008 5:30 am

Return to Help

Who is online

Users browsing this forum: No registered users and 4 guests