4
I have the following code snippet:
<p:selectOneMenu id="agencia" converter="agenciasConverter"
value="#{agenciasMB.agencias.agencia}" style="width:150px">
<f:selectItem itemLabel="Selecione a Agência" itemValue="" noSelectionOption="true" />
<f:selectItems value="#{agenciasMB.lista}" var="org"
itemValue="#{org}" itemLabel="#{org.agencia}" />
</p:selectOneMenu>
<p:fileUpload id="fileIdPhoto" mode="advanced" dragDropSupport="false"
fileUploadListener="#{fileUploadBean.uploadPhoto}" fileLimit="3"
multiple="true" update="messages" sizeLimit="10000000000"
label="Escolha o arquivo" allowTypes="/(\.|\/)(pdf)$/">
<f:attribute name="agencia" value="#{org}" />
</p:fileUpload>
How to pass the object agência
selected and recover in fileUploadBean.uploadPhoto
?
I’d do it to get a variable back:
<f:attribute name="agencia" value="minhavariavel" />
In the Managedbean:
e.getComponent().getAttributes().get("agencia")
How to use the f:attribute
to pass object that was selected in the select
to the backbean?
Have you tried creating a method that receives this object or some attribute in which you can set it?
– HDeiro