method picking up wrong value

0

Look, I have this button in a datatable

<p:commandButton id="prepDownloadAditivoNovo" style="float:left;"
                        icon="ui-icon-arrowthickstop-1-s" value="Download" ajax="false"
                        actionListener="#{fileUploadBean.prepDownloadAditivoNovo}"
                        disabled="#{con.pdf}" >
                        <f:attribute name="codigo" value="#{con.id}" />
                        <p:fileDownload value="#{fileUploadBean.download}" />
                    </p:commandButton>

then there in my fileUploadBean.prepDownloadAditivoNew I get that code

I just need to sort this datatable by date, and I use a sortby in the datatable

It displays everything right, but when you click on the button, instead of passing the code that has been reordered, it passes the code in the original order, as if there was no reordering

Has anyone seen this yet?

    
asked by anonymous 19.05.2017 / 21:19

1 answer

0

Try to create the 'prepDownloadAditivoNovo' method by passing the id through it, without using f: attribute,
Ex: '# {fileUploadBean.prepDownloadAditivoNew (con.id)}' and you get the id in the done method.

    
02.06.2017 / 19:32