I want to show a list of files, and when clicking the file, the file should
be downloaded.
The JSF page for this contains code like this:
<h:panelGroup rendered="#{studioAuditTracking.files.rowCount eq 0}">
<tr>
<td class="sub_table_row" colspan="7" height="22">
<h:outputText
value="#{trackingText.TRACKING_noItemsFound}" />
</td>
</tr>
</h:panelGroup>
<certione:foreach value="#{studioAuditTracking.files}" var="file"
styleVar="style" styleClass="sub_table_row">
<h:column>
<tr>
<td class="#{style}" style="width: 90px">
<h:commandLink
action="#{studioAuditTracking.viewFile}"
title="#{trackingText.TRACKING_viewDownloadFile}" target="mainHidden">
#{studio.pix}icon_message.gif
<h:outputText value="#{file.fileId}" />
</h:commandLink>
</td>
<td class="#{style}">
<nobr>
<certione:outputExtension
extension="#{file.fileType}"
extensionList="#{studio.filetypes}"/>
</nobr>
</td>
<td class="#{style}">
<nobr>
<h:outputText value="#{file.fileName}"
/>
</nobr>
</td>
<td class="#{style}">
<nobr>
<certione:localeText
value="#{file.documentType}" bundle="#{text}" />
</nobr>
</td>
<td class="#{style}">
<nobr>
<certione:outputFileSize
value="#{file.filesize}" />
</nobr>
</td>
<td class="#{style}" align="right" width="20">
<h:commandLink
action="#{studioAuditTracking.viewFile}"
title="#{trackingText.TRACKING_viewDownloadFile}" target="mainHidden">
#{studio.pix}icon_view.gif
</h:commandLink>
</td>
</tr>
</h:column>
</certione:foreach>
When clicking a line, I always get the first file. but when removing the
first part, and the code looks like this:
<certione:foreach value="#{studioAuditTracking.files}" var="file"
styleVar="style" styleClass="sub_table_row">
<h:column>
<tr>
<td class="#{style}" style="width: 90px">
<h:commandLink
action="#{studioAuditTracking.viewFile}"
title="#{trackingText.TRACKING_viewDownloadFile}" target="mainHidden">
#{studio.pix}icon_message.gif
<h:outputText value="#{file.fileId}" />
</h:commandLink>
</td>
<td class="#{style}">
<nobr>
<certione:outputExtension
extension="#{file.fileType}"
extensionList="#{studio.filetypes}"/>
</nobr>
</td>
<td class="#{style}">
<nobr>
<h:outputText value="#{file.fileName}"
/>
</nobr>
</td>
<td class="#{style}">
<nobr>
<certione:localeText
value="#{file.documentType}" bundle="#{text}" />
</nobr>
</td>
<td class="#{style}">
<nobr>
<certione:outputFileSize
value="#{file.filesize}" />
</nobr>
</td>
<td class="#{style}" align="right" width="20">
<h:commandLink
action="#{studioAuditTracking.viewFile}"
title="#{trackingText.TRACKING_viewDownloadFile}" target="mainHidden">
#{studio.pix}icon_view.gif
</h:commandLink>
</td>
</tr>
</h:column>
</certione:foreach>
It works just fine. if I change my expression in the panelGroup object from
#{studioAuditTracking.files.rowCount eq 0}
to
#{0 eq 0}
It also works fine.
I'm using the same code on other pages, where it also works just fine, but
for this page I can't get it working.
I'm using MyFaces version 1.1.3 running on JBoss 4.0.4.GA together with
facelets version 1.1.5.
--
View this message in context:
http://www.nabble.com/Problem-to-get-the-correct-row-data-tf1899387.html#a5196029
Sent from the MyFaces - Users forum at Nabble.com.