0
I’ve created JSF forms several times, but I’m not understanding why value
that selectOneMenu
not being defined ("set").
<h:form>
<h:selectOneMenu id="nova-matriz-select"
value="#{historicoMatrizMatriculaBean.novaMatrizCurricular}"
required="true"
styleClass="uniformselect">
<f:selectItem itemLabel="-- Selecione --" noSelectionOption="true" />
<f:selectItems value="#{historicoMatrizMatriculaBean.matrizesCurriculares}"
var="mc" itemValue="#{mc}" itemLabel="#{mc.opcaoCurricular.complementoSigla} - #{mc.nome}" />
</h:selectOneMenu>
<h:commandButton id="salvar-btn"
action="list.xhtml?faces-redirect=true"
actionListener="#{historicoMatrizMatriculaBean.salvarAlteracao()}"
value="Salvar"
styleClass="stdbtn btn_orange submitbtn" />
</h:form>
Can anyone see the problem here?
NOTE: Attribute getters/setters novaMatrizCurricular
were created.
EDITED
@Named
@ConversationScoped
public class HistoricoMatrizMatriculaBean {
private MatrizCurricular novaMatrizCurricular;
private List<MatrizCurricular> matrizesCurriculares;
public void init() {
this.matrizesCurriculares = service.obterMatrizes();
}
public List<MatrizCurricular> getMatrizesCurriculares() {
return matrizesCurriculares;
}
public void setMatrizesCurriculares(List<MatrizCurricular> matrizesCurriculares) {
this.matrizesCurriculares = matrizesCurriculares;
}
public MatrizCurricular getNovaMatrizCurricular() {
return novaMatrizCurricular;
}
public void setNovaMatrizCurricular(MatrizCurricular novaMatrizCurricular) {
this.novaMatrizCurricular = novaMatrizCurricular;
}
}
Post Managedbean code to help analysis
– Marquezani
I added what I found more pertinent from Managedbean @Marquezani...
– rogerio_gentil