I have a InfosPatient class which contains the informations of a patient: His different names (birth name, official name...), different address (primary, work...), different phone numbers and other informations (sexe, birth date)
Here's is the class:
public class InfosPatient {
private Identity[] identities;
private String birthDate="";
private String sexe="";
private Adresse[] adresse;
private NumeroTelephone[] telephones;
private String numeroCafat="",numeroMed="";}
Here's the Identity class:
public class Identity {
private String prenom,nom;
private TypeNom typeNom;
TypeNom is an enumeration with 2 different values: Usuel (official name) and Naissance (birth name).
The address and phones classes are similar (with enumerations).
So my question is:
How to add in a TableView row the different identities in different columns?
I want to have a column with the birth name and another with the official name. Like this:
One column with the official name and surname, a second with the birth name and surname.
Thank you for your help.
PS: To access a specific identity, I use this:
public Identity getIdentity(TypeNom typeNom) {
for (Identity identity:this.identities) {
if (identity.getTypeNom() == typeNom){
return identity;
}
}
return null;
}
TableColumn, set the appropriatecellValueFactory. Inside this factory you'd grab the correctIdentitybased on theTableColumnsaid factory is for.birthDate.setCellValueFactory(new PropertyValueFactory<>("birthDate"));