Rendered does not let the button work

Asked

Viewed 49 times

0

I have the code below it only renders if the.aditivopdf contracts are 1

only with this code he does not enter the actionlistener method only that if I remove that rendered, the actionlistener calls normal

what I’m missing?

<p:commandButton id="downloadAditivo"
                        icon="ui-icon-arrowthickstop-1-s" value="Download" ajax="false"
                        actionListener="#{fileUploadBean.prepDownloadAditivo}"
                        rendered="#{contratosMB.contratos.aditivopdf eq 1}"
                        >
                        <f:attribute name="codigo" value="#{contratosMB.contratos.id}" />
                        <p:fileDownload value="#{fileUploadBean.download}" />
                    </p:commandButton>
                    <p:message for="downloadAditivo" />
  • Have you tried using the action ? Post the Controller code also.

2 answers

0


solved guys, was without scoped upon the Managed Bean

0

Sorry, I don’t know the syntax very well, in this section of rendered code="#{contratosMB.contratos.aditivopdf eq 1}", is the syntax "eq 1" correct? Shouldn’t it be something like "== 1"? Another thing, I don’t know your business rule, but it would not be preferable to use a boolean attribute to render or not the component?

Browser other questions tagged

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