1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| //affiche_detail permet d'afficher la page de details
public void affiche_detail()
{
//On instancie une deuxieme forme
Form secondeForm = new Form("Détails");
//On instancie 5 TextField
txt_pseudo = new TextField("", "", 20,0);
txt_prenom = new TextField("", "", 20,0);
txt_telephone = new TextField("", "", 20,0);
txt_mobile = new TextField("", "", 20,0);
txt_Author = new TextField("", "", 20,0);
String[] type = getType(false);
drp_type_details = new ChoiceGroup("Choisir le Type",ChoiceGroup.POPUP,type,null);
if(liste_contact.getSelectedIndex() == 0)
{
//Si on ajoute un utilisateur
new_value = true;
}
else
{
//Si on modifie un utilisateur
new_value = false;
//On recupere l'id
int selected_id = Integer.parseInt(tab_id[liste_contact.getSelectedIndex()]);
//On recupere les infos de l'utilisateur a modifier
String[] info = getInfo(selected_id);
txt_pseudo.setString(info[0]);
txt_prenom.setString(info[1]);
txt_telephone.setString(info[2]);
txt_mobile.setString(info[3]);
txt_Author.setString(info[4]);
drp_type_details.setSelectedIndex(Integer.parseInt(info[4])-1,true);
System.out.println("get info "+getInfo(selected_id));
} |
Partager