method picking wrong value

Asked

Viewed 45 times

0

Check it out, I got this boot on 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

only that I need to sort this datatable by date, and use a sortby on the datatable

it displays everything neat, but when clicking the button, instead of it passing the code that was reordered, it passes the code in the original order, as if there was no reordering

someone has seen this?

1 answer

0

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.