IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JSF Java Discussion :

Petit problème JSF icefaces


Sujet :

JSF Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Décembre 2009
    Messages
    68
    Détails du profil
    Informations forums :
    Inscription : Décembre 2009
    Messages : 68
    Par défaut Petit problème JSF icefaces
    Salut je suis desolé si je me trompe de forum mais voilà je suis entrain de développer une application web avec Icefaces tout fonctionne très bien sauf que quand on clique sur un bouton pour faire un traitement ca fonctionne mais il faut rafraichir la page pour voir le resultat. Je voudrai savoir s'il y aurait un moyen que le rafraichissement se fait automatiquement après le traitement.
    Merci

  2. #2
    Rédacteur

    Profil pro
    Inscrit en
    Juin 2003
    Messages
    4 184
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 4 184
    Par défaut
    non c'est le bon forum..
    par contre, un bout de code serait utile pour t'apporter de l'aide.

  3. #3
    Membre confirmé
    Inscrit en
    Décembre 2009
    Messages
    68
    Détails du profil
    Informations forums :
    Inscription : Décembre 2009
    Messages : 68
    Par défaut
    ok je vous poste mes page(Ui)
    et puis mes managedBean merci
    Code java : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    package com.sungard.beans;
     
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Collections;
    import java.util.Comparator;
    import java.util.Date;
     
    import javax.faces.event.AbortProcessingException;
    import javax.faces.event.ValueChangeEvent;
    import javax.faces.event.ValueChangeListener;
    import javax.faces.model.SelectItem;
    import javax.servlet.jsp.PageContext;
     
    import net.sf.click.Page;
     
     
    import com.icesoft.faces.component.ext.RowSelectorEvent;
    import com.sungard.persistence.Employe;
    import com.sungard.service.IEmployeService;
     
     
    public class EmployeBean {
     
    	Employe employee;
    	private static int idf;
     
    	private static String name;
    	private static String prenoms;
    	private static Date date;
    	private static float sal;
    	private static String fct;
     
    	private  String nom;
    	private  String prenom;
    	private  Date date_embauche;
    	private  float salaire;	
    	private String fonction;
    	private ArrayList<SelectItem> Fonctions;
     
    	private IEmployeService empServ;
    	public ArrayList<Employe> employes;
    	public  ArrayList<Employe> emps;
    	private boolean ascending = true;
    	private boolean visible=false;
     
    	public EmployeBean() {
    		emps=new ArrayList<Employe>();
    	}
    	public Employe getEmployee() {
    		return employee;
    	}
    	public void setEmployee(Employe employee) {
    		this.employee = employee;
    	}
     
    	public IEmployeService getEmpServ() {
    		return empServ;
    	}
    	public void setEmpServ(IEmployeService empServ) {
    		this.empServ = empServ;
    	}
    	public ArrayList<Employe> getEmployes() {
    		if(employes==null){
    			employes=new ArrayList<Employe>();
    			employes = empServ.findEmployes();
    		}
    		if(!isAscending()){
    		Collections.sort(employes, new Employe2Comparator());
    		}else{
    		Collections.sort(employes, new EmployeComparator());
    		}
    		System.out.println(employes);
    		return employes;
    	}
    	public void setEmployes(ArrayList<Employe> employes) {
    		this.employes = employes;
    	}
     
    	public String addBoutonAction(){
    		return "JETON_CREATE";
    	}	
     
    	public ArrayList<Employe> getEmps() {
    		return emps;
    	}
    	public void setEmps(ArrayList<Employe> emps) {
    		this.emps = emps;
    	}
    	public void rowSelectionListener(RowSelectorEvent event){
     
    		for (Employe emp : emps) {
    			emp.setSelected(null);
    		}
     
    		emps.clear();
     
    		for(int i = 0; i <employes.size(); i++){
    	        employee = (Employe)employes.get(i);
     
    	        if(employee.getSelected()){
     
    	        	emps.add(employee);
    	        	break;
    	        }
    	        }
    		idf=emps.get(0).getId();
    		System.out.println(idf);
     
    		name=emps.get(0).getNom();
    		System.out.println(name);
     
    		prenoms=emps.get(0).getPrenom();
    		System.out.println(prenoms);
     
    		date=emps.get(0).getDate_embauche();
     
    		sal=emps.get(0).getSalaire();
     
     
    		fct=emps.get(0).getFonction();
     
    		System.out.println(emps.size());
    	}
    	public boolean isAscending() {
    		return ascending;
    	}
    	public void setAscending(boolean ascending) {
    		this.ascending = ascending;
    	}
    	public String deleteEmployeAction(){
    		Employe employe=new Employe();
    		try{
    			employe=empServ.getEmployeById(idf);
    			employe.setSelected(true);
    			this.empServ.deleteEmploye(employe);
    			return "success";
    		}catch(Exception e){
    			e.printStackTrace();
    			return "failure";
    		}
    	}
    	public void closePopup(){
    		setVisible(false);
    	}
    	public void modifierEmploye(){
     
    		setVisible(true);
    	}
    	public String updateEmployeAction(){
    		Employe employe=new Employe();
    		try{
    			employe=empServ.getEmployeById(idf);
     
    			employe.setSelected(false);
     
    			employe.setNom(nom);
     
    			employe.setPrenom(prenom);
     
    			employe.setDate_embauche(date_embauche);
     
    			employe.setSalaire(salaire);
     
    			employe.setFonction(fonction);
     
    			this.empServ.updateEmploye(employe);
     
    			setVisible(false);
    			return "success";
    		}catch(Exception e){
    			e.printStackTrace();
    			return "failure";
    		}
     
    	}
    	public boolean isVisible() {
    		return visible;
    	}
    	public void setVisible(boolean visible) {
    		this.visible = visible;
    	}
    	public String getFonction() {
    		fonction=fct;
    		return fonction;
    	}
    	public void setFonction(String fonction) {
    		this.fonction = fonction;
    	}
    	public ArrayList<SelectItem> getFonctions() {
    		if(Fonctions==null){
    			Fonctions=new ArrayList<SelectItem>();
    		SelectItem f0=new SelectItem();
    		f0.setLabel("------ Poste ------");
    		f0.setValue("------ Poste ------");
    		SelectItem f1=new SelectItem();
    		f1.setLabel("Stagiaire");
    		f1.setValue("Stagiaire");
    		SelectItem f2=new SelectItem();
    		f2.setLabel("Ingenieur");
    		f2.setValue("Ingenieur");
    		SelectItem f3=new SelectItem();
    		f3.setLabel("Chef De Projet");
    		f3.setValue("Chef De Projet");
    		SelectItem f4=new SelectItem();
    		f4.setLabel("Chef D'equipe");
    		f4.setValue("Chef D'equipe");
    		SelectItem f5=new SelectItem();
    		f5.setLabel("Agent");
    		f5.setValue("Agent");
    		Fonctions.add(f0);
    		Fonctions.add(f1);
    		Fonctions.add(f2);
    		Fonctions.add(f3);
    		Fonctions.add(f4);
    		Fonctions.add(f5);
    		}
    		return Fonctions;
    	}
    	public void setFonctions(ArrayList<SelectItem> fonctions) {
    		Fonctions = fonctions;
    	}
    	public static int getIdf() {
    		return idf;
    	}
    	public void setIdf(int idf) {
    		EmployeBean.idf = idf;
    	}
    	public String getNom() {
    		nom=name;
    		return nom;
    	}
    	public void setNom(String nom) {
    		this.nom = nom;
    	}
    	public String getPrenom() {
    		prenom=prenoms;
    		return prenom;
    	}
    	public void setPrenom(String prenom) {
    		this.prenom = prenom;
    	}
    	public Date getDate_embauche() {
    		date_embauche=date;
    		return date_embauche;
    	}
    	public void setDate_embauche(Date date_embauche) {
    		this.date_embauche = date_embauche;
    	}
    	public  float getSalaire() {
    		salaire=sal;
    		return salaire;
    	}
    	public void setSalaire(float salaire) {
    		this.salaire = salaire;
    	}
     
     
    }
    Code java : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    package com.sungard.beans;
     
    import java.util.ArrayList;
    import java.util.Date;
     
    import javax.faces.model.SelectItem;
     
     
     
    import com.sungard.persistence.Employe;
    import com.sungard.service.IEmployeService;
     
    public class EmployeBean2 {
     
    	Employe employe;
    	private String nom;
    	private String prenom;
    	private Date date_embauche;
    	private float salaire;
    	private String fonction;
    	private ArrayList<SelectItem> Fonctions;
    	private IEmployeService empServ;
     
    	public EmployeBean2() {
    	employe=new Employe();
     
    	}
     
    	public String addEmployeAction(){
    		try{
     
    			employe.setNom(nom);
    			System.out.println(nom);
     
    			employe.setPrenom(prenom);
    			System.out.println(prenom);
     
    			employe.setDate_embauche(date_embauche);
    			System.out.println(date_embauche);
     
    			employe.setSalaire(salaire);
    			System.out.println(salaire);
     
    			employe.setFonction(fonction);
    			System.out.println(fonction);
     
    			employe.setSelected(false);
     
    			this.empServ.addEmploye(employe);
    			return "success";
    		}catch(Exception e){
    			e.printStackTrace();
    			return "failure";
    		}		
    	}
     
    	public void setEmpServ(IEmployeService empServ) {
    		this.empServ = empServ;
    	}
     
    	public String getNom() {
    		return nom;
    	}
    	public void setNom(String nom) {
    		this.nom = nom;
    	}
    	public String getPrenom() {
    		return prenom;
    	}
    	public void setPrenom(String prenom) {
    		this.prenom = prenom;
    	}
    	public Date getDate_embauche() {
    		return date_embauche;
    	}
    	public void setDate_embauche(Date date_embauche) {
    		this.date_embauche = date_embauche;
    	}
    	public float getSalaire() {
    		return salaire;
    	}
    	public void setSalaire(float salaire) {
    		this.salaire = salaire;
    	}
     
    	public ArrayList<SelectItem> getFonctions() {
    		if(Fonctions==null){
    			Fonctions=new ArrayList<SelectItem>();
    		SelectItem f0=new SelectItem();
    		f0.setLabel("------ Poste ------");
    		f0.setValue("------ Poste ------");
    		SelectItem f1=new SelectItem();
    		f1.setLabel("Stagiaire");
    		f1.setValue("Stagiaire");
    		SelectItem f2=new SelectItem();
    		f2.setLabel("Ingenieur");
    		f2.setValue("Ingenieur");
    		SelectItem f3=new SelectItem();
    		f3.setLabel("Chef De Projet");
    		f3.setValue("Chef De Projet");
    		SelectItem f4=new SelectItem();
    		f4.setLabel("Chef D'equipe");
    		f4.setValue("Chef D'equipe");
    		SelectItem f5=new SelectItem();
    		f5.setLabel("Agent");
    		f5.setValue("Agent");
    		Fonctions.add(f0);
    		Fonctions.add(f1);
    		Fonctions.add(f2);
    		Fonctions.add(f3);
    		Fonctions.add(f4);
    		Fonctions.add(f5);
    		}
    		return Fonctions;
    	}
     
    	public void setFonctions(ArrayList<SelectItem> fonctions) {
    		Fonctions = fonctions;
    	}
     
    	public IEmployeService getEmpServ() {
    		return empServ;
    	}
     
    	public String getFonction() {
    		return fonction;
    	}
     
    	public void setFonction(String fonction) {
    		this.fonction = fonction;
    	}
    }
    et puis mon interface principale
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    <f:view xmlns:h="http://java.sun.com/jsf/html"
    	xmlns:f="http://java.sun.com/jsf/core"
    	xmlns:ice="http://www.icesoft.com/icefaces/component">
     
    	<ice:outputDeclaration doctypeRoot="HTML"
    		doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
    		doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />
     
    	<html>
    	<head>
    	<meta http-equiv="refresh" content="text/html; charset=iso-8859-1"></meta>
    	<title>Gestion des Employes</title>
    	<link href="./xmlhttp/css/xp/xp.css" rel="stylesheet" type="text/css" />
    	</head>
     
    	<body>
    	<h2>Gestion Des Employes</h2>
     
    	<p>Ici vous pouvez ajouter, supprimer et mettre a jour tous vos
    	employes</p>
    	<ice:form>
    		<ice:panelGrid>
    			<ice:dataTable rows="5" id="Employes" var="employe"
    				value="#{employeBean.employes}"
    				sortAscending="#{employeBean.ascending}">
     
     
    				<!-- ID -->
    				<ice:column>
    					<ice:rowSelector value="#{employe.selected}" multiple="single"
    						selectionListener="#{employeBean.rowSelectionListener }"
    						preStyleOnSelection="true" />
    					<f:facet name="header">
    						<ice:commandSortHeader columnName="ID #" arrow="true">
    							<ice:outputText value="ID #" />
    						</ice:commandSortHeader>
    					</f:facet>
    					<ice:outputText value="#{employe.id}" />
    				</ice:column>
     
    				<!-- Nom -->
    				<ice:column>
    					<f:facet name="header">
    						<ice:outputText value="Nom" />
    					</f:facet>
    					<ice:outputText value="#{employe.nom}" />
    				</ice:column>
     
    				<!-- Prenom  -->
    				<ice:column>
    					<f:facet name="header">
    						<ice:outputText value="Prenom" />
    					</f:facet>
    					<ice:outputText value="#{employe.prenom}" />
    				</ice:column>
     
    				<!-- Date -->
    				<ice:column>
    					<f:facet name="header">
    						<ice:outputText value="Date D'embauche" />
    					</f:facet>
    					<ice:outputText value="#{employe.date_embauche}" />
    				</ice:column>
     
    				<!-- Salaire -->
    				<ice:column>
    					<f:facet name="header">
    						<ice:outputText value="Salaire" />
    					</f:facet>
    					<ice:outputText value="#{employe.salaire}" />
    				</ice:column>
    				<!-- Fonction -->
    				<ice:column>
    					<f:facet name="header">
    						<ice:outputText value="Fonction" />
    					</f:facet>
    					<ice:outputText value="#{employe.fonction}" />
    				</ice:column>
    			</ice:dataTable>
    			<ice:commandButton value="Ajout"
    				action="#{employeBean.addBoutonAction}"></ice:commandButton>
    		</ice:panelGrid>
    		<ice:dataPaginator id="Data_Page" for="Employes" paginator="true"
    			fastStep="3" paginatorMaxPages="4">
    			<f:facet name="first">
    				<ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-first.gif"
    					style="border:none;" title="First Page" />
    			</f:facet>
    			<f:facet name="last">
    				<ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-last.gif"
    					style="border:none;" title="Last Page" />
    			</f:facet>
    			<f:facet name="previous">
    				<ice:graphicImage
    					url="./xmlhttp/css/xp/css-images/arrow-previous.gif"
    					style="border:none;" title="Previous Page" />
    			</f:facet>
    			<f:facet name="next">
    				<ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-next.gif"
    					style="border:none;" title="Next Page" />
    			</f:facet>
    			<f:facet name="fastforward">
    				<ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-ff.gif"
    					style="border:none;" title="Fast Forward" />
    			</f:facet>
    			<f:facet name="fastrewind">
    				<ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-fr.gif"
    					style="border:none;" title="Fast Backwards" />
    			</f:facet>
    		</ice:dataPaginator>
    		<ice:dataPaginator id="EmpPag" for="Employes" rowsCountVar="rowsCount"
    			displayedRowsCountVar="displayedRowsCount"
    			firstRowIndexVar="firstRowIndex" lastRowIndexVar="lastRowIndex"
    			pageCountVar="pageCount" pageIndexVar="pageIndex">
    			<ice:outputFormat
    				value="{0} employes trouves, {1} employes affiches, du {2} au {3}. Page {4} / {5}."
    				styleClass="standard">
    				<f:param value="#{rowsCount}" />
    				<f:param value="#{displayedRowsCount}" />
    				<f:param value="#{firstRowIndex}" />
    				<f:param value="#{lastRowIndex}" />
    				<f:param value="#{pageIndex}" />
    				<f:param value="#{pageCount}" />
    			</ice:outputFormat>
    		</ice:dataPaginator>
     
     
    		<ice:panelGrid border="1" columns="4">
    			<ice:dataTable rows="1" id="Emps" var="emp"
    				value="#{employeBean.emps}">
     
    				<!-- ID -->
    				<ice:column>
     
    					<f:facet name="header">
     
    						<ice:outputText value="ID #" />
     
    					</f:facet>
    					<ice:outputText value="#{emp.id}" />
    				</ice:column>
     
    				<!-- Nom -->
    				<ice:column>
    					<f:facet name="header">
    						<ice:outputText value="Nom" />
    					</f:facet>
    					<ice:outputText value="#{emp.nom}" />
    				</ice:column>
     
    				<!-- Prenom  -->
    				<ice:column>
    					<f:facet name="header">
    						<ice:outputText value="Prenom" />
    					</f:facet>
    					<ice:outputText value="#{emp.prenom}" />
    				</ice:column>
     
    				<!-- Date -->
    				<ice:column>
    					<f:facet name="header">
    						<ice:outputText value="Date D'embauche" />
    					</f:facet>
    					<ice:outputText value="#{emp.date_embauche}" />
    				</ice:column>
     
    				<!-- Salaire -->
    				<ice:column>
    					<f:facet name="header">
    						<ice:outputText value="Salaire" />
    					</f:facet>
    					<ice:outputText value="#{emp.salaire}" />
    				</ice:column>
    				<!-- Fonction -->
    				<ice:column>
    					<f:facet name="header">
    						<ice:outputText value="Fonction" />
    					</f:facet>
    					<ice:outputText value="#{emp.fonction}" />
    				</ice:column>
    			</ice:dataTable>
    			<ice:commandButton panelConfirmation="Delete" value="Supprimer"
    				action="#{employeBean.deleteEmployeAction}"></ice:commandButton>
    			<ice:commandButton value="Modifier"
    				action="#{employeBean.modifierEmploye}"></ice:commandButton>
    			<ice:commandButton value="Appliquer"
    				action="#{employeBean.updateEmployeAction}"></ice:commandButton>
     
     
     
     
    		</ice:panelGrid>
    		<ice:panelConfirmation id="Delete" title="Supprimer"
    			message="Vous etes sur(e) de vouloir supprimer cet(te) employe(e)"
    			acceptLabel="Yes" cancelLabel="No" />
     
     
    		<ice:panelPopup draggable="true" modal="false" autoCentre="true"
    			visible="#{employeBean.visible}" styleClass="panelPopup"
    			style="z-index:999; top: 400px; left: 400px; width: 310px; height: 200px; position:absolute; background: #FFFFFF;">
    			<f:facet name="header">
     
    				<ice:panelGrid id="popupHeader" width="100%" cellpadding="0"
    					cellspacing="0" columns="3"
    					columnClasses="popupIcon,popupTitle,popupButton"
    					style="width:310px; height=40px">
     
    					<h:graphicImage id="popupIcon" value="images/icon.jpg"
    						style="width: 40px; height: 27px; " />
    					<h:outputText value="Maj des employes   "
    						style="height: 26px;font-weight:bold" />
    					<h:commandButton id="popupClose" type="button"
    						image="images/close2.gif" action="#{employeBean.closePopup}"
    						style="cursor: pointer; width: 30px; height: 24px; " />
     
     
     
     
    				</ice:panelGrid>
     
    			</f:facet>
     
    			<f:facet name="body">
    			<ice:panelGroup>
    				<ice:panelGrid border="1" columns="2">
     
    					<ice:outputText value="Nom"></ice:outputText>
    					<ice:inputText id="nom" value="#{employeBean.nom}"></ice:inputText>
     
    					<ice:outputText value="Prenom"></ice:outputText>
    					<ice:inputText id="prenom" value="#{employeBean.prenom }"></ice:inputText>
     
     
    					<ice:outputText value="Salaire"></ice:outputText>
    					<ice:panelGrid border="1" columns="2">
    						<ice:inputText id="salaire" value="#{employeBean.salaire}"></ice:inputText>
    						<ice:message for="salaire" style="color:red" />
    					</ice:panelGrid>
     
    					<ice:outputText value="Date d'embauche"></ice:outputText>
    					<ice:selectInputDate id="date" value="#{employeBean.date_embauche}"
    						renderAsPopup="true">
    						<f:convertDateTime pattern="dd/MM/yyyy" />
    					</ice:selectInputDate>
     
    					<ice:outputText value="Fonction"></ice:outputText>
    					<ice:selectOneMenu onchange="submit()"
    						value="#{employeBean.fonction}">
    						<f:selectItems value="#{employeBean.fonctions}" />
    					</ice:selectOneMenu>
     
    				</ice:panelGrid>
    				<ice:panelGrid border="1" columns="1" style="width:292px">
    					<ice:commandButton value="Appliquer"
    						action="#{employeBean.updateEmployeAction}" style="width:290px"></ice:commandButton>
    				</ice:panelGrid>
    				</ice:panelGroup>
    			</f:facet>
    		</ice:panelPopup>
     
    	</ice:form>
    	</body>
    	</html>
    </f:view>
    Tout fonctionne nikel sauf que par exemple je selectionne un employe et je le supprime il faudrait que j'appuies sur F5 pour qu'il soit supprimé du dataTable.
    Moi ce que je voudrai c'est que quand je clique sur supprimer la page se recharge d'elle même et que l'employé soit enlevé du dataTable.
    En tout cas Merci de votre aide

  4. #4
    Membre confirmé
    Inscrit en
    Décembre 2009
    Messages
    68
    Détails du profil
    Informations forums :
    Inscription : Décembre 2009
    Messages : 68
    Par défaut
    Personne n'a d'idées

  5. #5
    Inactif  
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    2 189
    Détails du profil
    Informations personnelles :
    Âge : 45
    Localisation : Suisse

    Informations forums :
    Inscription : Mai 2006
    Messages : 2 189
    Par défaut
    Hello,

    Y a plusieurs choses que tu pourrais faire :

    1) Pourquoi utiliser un bean EmployeBean2 un seul suffit

    2) Lorsque tu utilises un ice:commandButton utilise un actionListener tu n'as pas besoin d'utiliser avec ceci un return "success" et donc pas besoin de mapper les action dans ton faces-config.xml

    3)Lorsque tu supprimes un employé supprime le également dans ta liste employes

  6. #6
    Membre confirmé
    Inscrit en
    Décembre 2009
    Messages
    68
    Détails du profil
    Informations forums :
    Inscription : Décembre 2009
    Messages : 68
    Par défaut
    J'ai pas bien saisi l'EmployeBean2 c'est le bean nécessaire pour ma page d'ajout.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. un petit problème d'algo
    Par supertramp dans le forum Algorithmes et structures de données
    Réponses: 22
    Dernier message: 12/10/2004, 20h13
  2. Petit problème de décimales !
    Par ridan dans le forum Langage SQL
    Réponses: 5
    Dernier message: 11/09/2004, 21h24
  3. Réponses: 17
    Dernier message: 13/07/2004, 20h37
  4. petit problème premier plan, arrière plan
    Par gros bob dans le forum OpenGL
    Réponses: 4
    Dernier message: 19/04/2004, 12h00
  5. [jointure] Petit problème sur le type de jointure...
    Par SteelBox dans le forum Langage SQL
    Réponses: 13
    Dernier message: 13/02/2004, 18h55

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo