1053,133 → 1053,6 |
|
} |
|
public void ajouterTelephone(String strTelephone, String strValeurTypeTel, String idTel) { |
|
|
//Ajout d'un champ à la liste |
String strIdTelephone = idTel + "##" + strTelephone + ";;"; |
|
FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel"); |
|
LayoutContainer lcTelephone = new LayoutContainer(); |
lcTelephone.setLayout(new ColumnLayout()); |
|
Text tTypeTelephone = new Text(); |
tTypeTelephone.setText(strValeurTypeTel+":"); |
|
hmIdentite.put("type-" + strIdTelephone, tTypeTelephone); |
lcTelephone.add(tTypeTelephone, new ColumnData(0.40)); |
|
Text tTelephone = new Text(); |
tTelephone.setText(strTelephone); |
hmIdentite.put("tel-" + strIdTelephone, tTelephone); |
lcTelephone.add(tTelephone, new ColumnData(0.40)); |
|
Button bSupprimer = new Button(); |
bSupprimer.setIcon(Images.ICONES.supprimer()); |
bSupprimer.setId(strIdTelephone); |
|
bSupprimer.addSelectionListener(new SelectionListener<ButtonEvent>() { |
public void componentSelected(ButtonEvent ce) { |
|
String strIdTelephone = ce.getComponent().getId(); |
LayoutContainer lcContactTel = (LayoutContainer) hmIdentite.get("lc-"+strIdTelephone); |
|
lcContactTel.remove(hmIdentite.get("type-" + strIdTelephone)); |
hmIdentite.remove("type-" + strIdTelephone); |
|
lcContactTel.remove(hmIdentite.get("tel-" + strIdTelephone)); |
hmIdentite.remove("tel-" + strIdTelephone); |
|
lcContactTel.remove(ce.getComponent()); |
|
FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel"); |
fsContactTel.remove(lcContactTel); |
|
HiddenField<String> hfTelephone = (HiddenField) hmIdentite.get("hfTelephone"); |
String strValeurTelephone = hfTelephone.getValue(); |
strValeurTelephone = strValeurTelephone.replace(strIdTelephone, ""); |
hfTelephone.setValue(strValeurTelephone); |
|
layout(); |
|
} |
}); |
|
lcTelephone.add(bSupprimer, new ColumnData(0.15)); |
|
hmIdentite.put("lc-"+strIdTelephone, lcTelephone); |
fsContactTel.add(lcTelephone); |
|
HiddenField<String> hfTelephone = (HiddenField) hmIdentite.get("hfTelephone"); |
String strValeurTelephone = hfTelephone.getValue(); |
if (strValeurTelephone==null) { |
strValeurTelephone = ""; |
} |
strValeurTelephone += strIdTelephone; |
hfTelephone.setValue(strValeurTelephone); |
|
layout(); |
|
|
|
|
} |
|
public void ajouterUrlLogo(String strUrl) { |
|
LayoutContainer lcUrlContainer = (LayoutContainer) hmIdentite.get("lcAutreInformations2"); |
|
LayoutContainer lcUrl = new LayoutContainer(); |
lcUrl.setLayout(new RowLayout()); |
hmIdentite.put("lc-" + strUrl, lcUrl); |
|
Image logo = new Image(strUrl); |
logo.setHeight("150px"); |
logo.setTitle(strUrl); |
lcUrl.add(logo); |
|
Button ibSupprimerUrl = new Button(); |
ibSupprimerUrl.setIcon(Images.ICONES.supprimer()); |
ibSupprimerUrl.setText("Supprimer"); |
ibSupprimerUrl.setId(strUrl); |
ibSupprimerUrl.addSelectionListener(new SelectionListener<ButtonEvent>() { |
|
public void componentSelected(ButtonEvent ce) { |
|
//Suppression url |
String strUrl = ce.getComponent().getId(); |
LayoutContainer lcUrl = (LayoutContainer) hmIdentite.get("lc-" + strUrl); |
LayoutContainer lcUrlContainer = (LayoutContainer) hmIdentite.get("lcAutreInformations2"); |
|
lcUrlContainer.remove(lcUrl); |
|
HiddenField<String> hfUrlLogo = (HiddenField<String>) hmIdentite.get("hfUrlLogo"); |
String strValeurUrl = hfUrlLogo.getValue(); |
strValeurUrl = strValeurUrl.replace(strUrl, ""); |
|
hfUrlLogo.setValue(strValeurUrl); |
} |
}); |
|
lcUrl.add(ibSupprimerUrl); |
lcUrlContainer.add(lcUrl); |
|
|
|
HiddenField<String> hfUrlLogo = (HiddenField<String>) hmIdentite.get("hfUrlLogo"); |
String strValeurUrl = hfUrlLogo.getValue(); |
if (strValeurUrl == null) { |
strValeurUrl = ""; |
} |
|
strValeurUrl += strUrl + ";;"; |
|
hfUrlLogo.setValue(strValeurUrl); |
|
layout(); |
} |
|
public void reinitialiser() { |
|
mediateur.afficherPopinChargement(); |