The context is as follows, I have a list of objects AvaliaProjeto
, which contains:
- Project
- Criteria
- Scale
- Value
The project is selected from the outside, the criteria are listed for their scales to be chosen. That is, each AvaliaProjeto
object contains a relation between scale and criterion.
I created this dialog to register AvaliaProjeto
(which is actually a sequence of evaluations), but ready the criteria and their potential scales via ui:repeat
. The problem is that at the time of registering, Escala
attributes are null.
Below are POJO, View and Print dialogs.
VIEW
<table id="table">
<tr>
<td><h:outputText value="Critério"
class="componentePF label bold" /></td>
<td><h:outputText value="Valor Numérico"
class="componentePF label bold" /></td>
<td><h:outputText value="Valor ou Impacto"
class="componentePF label bold" /></td>
</tr>
<ui:repeat var="a" value="#{topsisBean.avaliaProjetosPD}">
<tr>
<td><h:outputText value="#{a.criterio.nomeCriterio}"
class="componentePF label" /></td>
<td><p:selectBooleanCheckbox /></td>
<td><p:selectOneMenu converter="generic" value="#{a.escala}"
class="componentePF text">
<f:selectItem itemLabel="Escolha um Impacto de Escala"
itemDisabled="true" noSelectionOption="true" />
<f:selectItems value="#{topsisBean.escalas}" var="e"
itemLabel="#{e.impactoEscala}" itemValue="#{e}"
converter="generic" />
</p:selectOneMenu></td>
</tr>
</ui:repeat>
</table>
POJO
@Entity
@Table(name="avaliaprojeto", schema="somore")
public class AvaliaProjeto implements Serializable, SampleEntity {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int idAvaliaProjeto;
@OneToOne
@JoinColumn(name="idProjeto")
private Projeto projeto;
@OneToOne
@JoinColumn(name="idCriterio")
private Criterio criterio;
@OneToOne
@JoinColumn(name="idEscala")
private Escala escala;
double valorCriterio;
//gets sets equals e hash
}
Anyone with any idea what the problem was?