Não estou conseguindo pegar o valor do meu selectOneMenu, ele sempre retorna zero, segue código:
.XHTML
[code]<p:fileUpload auto=“true” label=“Selecionar…”
allowTypes="*.jpg" multiple=“false” description=“Imagem”
update=“idNameImage,idSizeImage,idImage,newIdImage”
fileUploadListener="#{imageOptimizationBean.handleFileUpload}" />
<h:selectOneMenu id="idNivel" value="#{imageOptimizationBean.valueNivel}">
<f:selectItem id="fraco" itemLabel="Fraco" itemValue="1"/>
<f:selectItem id="medio" itemLabel="Médio" itemValue="2"/>
<f:selectItem id="forte" itemLabel="Forte" itemValue="3"/>
</h:selectOneMenu> [/code]
MB
[code]private int valueNivel;
public void handleFileUpload(FileUploadEvent event) throws IOException{
if (log.isDebugEnabled()) {
log.debug("Uploaded: " + event.getFile().getFileName());
}
log.debug(valueNivel);
}
public int getValueNivel() {
return valueNivel;
}
public void setValueNivel(int valueNivel) {
this.valueNivel = valueNivel;
}
[/code]
Obrigado.