views:

24

answers:

0

Hello,

I have noticed a small issue with ui:repeat and checkboxes - the information is not passed back if the rendered or disabled attributes are set. I am not sure why it occurs or rather what is the offending code. The code given below is high level of what I am working with. My goal is to have a bean that display uploaded file with the ability to download selected (checked) files.

My bean looks something like that:

class UploadViewer
{
    private List<UploadViewerResult> viewerResults;
    public List getViewerResult()
    {
        return this.viewerResults();
    }
    public void setViewerResults(List<UploadViewerResult> viewerResults)
{
    this.viewerResults = viewerResults;
}
    public void doSearch()
    {
     // perform search and set results
    }
    public String downloadFiles()
    {
     // perform download
    }
}

My jsf looks something like this

<f:view>
            #{uploadViewer.doSearch}
            <table class="tabular">
                <tbody>
                    <tr jsfc="ui:repeat" value="#{uploadViewer.viewerResults}"
                        var="result" class="#{result.rowNumber % 2 == 0 ? 'even' : 'odd'}">
                        <td align="center"><t:selectBooleanCheckbox id="selected"
                            value="#{result.selected}"
                            /></td>
                        <td>
                        <div class="clip350"><a jsfc="h:outputLink" value="file">#{result.fileIdentifier}
                        <f:param name="fid" value="#{result.fileNumber}" /> <f:param
                            name="fileNumber" value="#{result.fileNumber}" /> <f:param
                            name="type" value="ORIGINAL" /> </a></div>
                        </td>
                    </tr>
                    <tr class="functions">
                        <td align="center"><input id="check2" class="checkall"
                            type="checkbox" /></td>
                        <td><label for="check2">Select all files</label></td>
                        <td colspan="4" align="right">
                            <input
                            jsfc="h:commandButton" type="submit" id="butt1"
                            value="Download all selected audit files to review"
                            action="#{uploadViewer.downloadFiles}" /></td>
                    </tr>
                </tbody>
            </table>
        </ui:define>
    </ui:composition>
</f:view>

My bean is managed on the request level. The funny thing is that when I run this (the more complete code which spans several pages) the download works (JSF passes back the information about which element is checked). However when I disable any of the checkboxes (with either render or disable attribute for matching certain criteria) it no longer works for the rest of the enabled checkboxes. Any help to how to resolve this (being able to not show every checkbox) and still work for the other ones will be grately appreciated

N.B. the code given is not the full code and I rather not post pages and pages of code for something that only concerns one part of it.