4
I have the following problem:
I need a form to submit questions of evidence. Therefore, the form should contain a field for the question (question statement), and several fields for the alternatives.
With this, I wanted the input values of the alternatives to go straight to a list of instantiated alternatives in the respective bean.
So we have the Option class:
public class Opcao {
private int idOpcao;
private String nomeOpcao;
public int getIdOpcao() {
return idOpcao;
}
public void setIdOpcao(int idOpcao) {
this.idOpcao = idOpcao;
}
public String getNomeOpcao() {
return nomeOpcao;
}
public void setNomeOpcao(String nomeOpcao) {
this.nomeOpcao = nomeOpcao;
}
}
And the bean containing the list of options:
@ManagedBean
@ViewScoped
public class QuestaoBean {
private List<Opcao> opcoes;
public List<Opcao> getOpcoes() {
return opcoes;
}
public void setOpcoes(List<Opcao> opcoes) {
this.opcoes = opcoes;
}
}
And how’s your .
xhtml
?– Luídne
@Luídne I have no idea how to create the
<h:inputText>
referencing that list. You don’t even need to have the.xhtml.
, I just need to know how the<h:inputText>
.– Felipe Nascimento