Rendered does not let the button work

0

I have the code below it only renders if the contracts.adminopdf is 1

But with this code it does not go into the method of the actionlistener but if I remove this rendered, the actionlistener calls normal

What am I 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" />
    
asked by anonymous 06.01.2017 / 19:28

2 answers

0

Personally solved, I was scoped over the Managed Bean

    
11.01.2017 / 12:46
0

Sorry, I do not know the syntax very well, in this excerpt from the code rendered="# {contractsMB.contratos.aditivopdf eq 1}", is the syntax "eq 1" correct? Should not it be something like "== 1"? Another thing, I do not know your business rule, but would not it be preferable to use a boolean attribute to render the component?

    
10.01.2017 / 11:44