dropDownChoice.setRequired(false);
final TextField email = new TextField("email");
//Gestion des inscriptions pour les membres d'un club dont la personne actuelle est le coach.
Radio radioCoach = new Radio("coachClubsMembers", new Model(
DelegateRegistrationMode.COACH));
List<Personne> clubMembers;
Compte coach = this.getXRaceSession().getCompte();
final DropDownChoice dropDownChoiceMembresClub;
final Label labelNomClub;
if (coach.getCoachOf() != null)
{
labelNomClub = new Label("clubName", coach.getCoachOf()
.getNomComplet());
radioCoach.setVisible(true);
clubMembers = clubService.find(coach.getCoachOf().getId())
.getMembres();
dropDownChoiceMembresClub = new DropDownChoice("ddcClubMembers",
new PropertyModel(this, "personneAInscrire"), clubMembers,
new PersonneChoiceRenderer());
}
else
{
labelNomClub = new Label("clubName", "");
radioCoach.setVisible(false);
clubMembers = null;
dropDownChoiceMembresClub = new DropDownChoice("ddcClubMembers",
new Model());
dropDownChoiceMembresClub.setVisible(false);
}
dropDownChoiceMembresClub.setRequired(false);
final RadioGroup radioGroup = new RadioGroup("mode")
{
private static final long serialVersionUID = 1L;
@Override
protected boolean wantOnSelectionChangedNotifications()
{
return true;
}
@Override
protected void onSelectionChanged(Object arg0)
{
updateFields(email, dropDownChoice, dropDownChoiceMembresClub);
}
};
Radio rdPersonneAssociee = new Radio("rdbPersonneAssociee", new Model(
DelegateRegistrationMode.PERSONNEASSOCIEE));
if (personnesAssociees.size() < 1)
{
rdPersonneAssociee.setEnabled(false);
}
radioGroup.add(labelNomClub);
radioGroup.add(rdPersonneAssociee);
radioGroup.add(email);
radioGroup.add(dropDownChoice);
radioGroup.add(new Radio("manual", new Model(
DelegateRegistrationMode.MANUAL)));
radioGroup.add(new Radio("lookup", new Model(
DelegateRegistrationMode.LOOKUP)));
radioGroup.add(radioCoach);
radioGroup.add(dropDownChoiceMembresClub);