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

Développement Web en Java Discussion :

Rechercher les composants dans une autre interface selon id selectionné


Sujet :

Développement Web en Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2015
    Messages
    87
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2015
    Messages : 87
    Par défaut Rechercher les composants dans une autre interface selon id selectionné
    Bonjour ,
    j'ai deux interface comme il est indiqué ci dessous
    interface 1 : affiche la liste de hardware
    interface 2 : affiche la liste de tous les composants et les item liés au Hard

    mon objectif est :
    je veux quand je sélectionne le nom d'un hardware dans interface 1 ( qui est un commandLink en bleu comme vous voyez ) il se navigue vers l'interface 2 et filtré tous les autre tables pour avoir seulement qu’il sont les composants lié à ce hardware sélectionne

    sachant que le class hardware de l'interface 1 à un attribut nommé " id"
    et les autre class de l'interface 2 ont un attribut nommé " HARDWARE_ID "
    donc il faut chercher les HARDWARE_ID qui = ID slectionné dans interface 1 pour filtré les tables de l'interface 1 et sachant que pas de ralation entre hardware et les autre table

    est ce que je dois faire ça avec jointure ou envoyer le paramétré de id selectionné de la l'interface 1 dans url vers interface 2 avec le ViewParam ou quoi exactement

    Interface 1 :

    Nom : interface1.PNG
Affichages : 105
Taille : 86,4 Ko

    Interfrace 2 : ( comme vous voyez ici tout les item liés à hardware . je dois afficher seulement les information liés à un hardware sélectioné )

    Nom : interface2.PNG
Affichages : 93
Taille : 80,9 Ko

  2. #2
    Membre confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2015
    Messages
    87
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2015
    Messages : 87
    Par défaut
    le problème persiste

  3. #3
    Membre chevronné
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Juillet 2013
    Messages
    269
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2013
    Messages : 269
    Par défaut
    Bonjour,
    au niveau de tes contrôleurs es tu en @Named ou en @ManagedBean ?

  4. #4
    Membre confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2015
    Messages
    87
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2015
    Messages : 87
    Par défaut
    Citation Envoyé par VirgApps Voir le message
    Bonjour,
    au niveau de tes contrôleurs es tu en @Named ou en @ManagedBean ?

    je suis tjs avec @ManagedBean

  5. #5
    Membre confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2015
    Messages
    87
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2015
    Messages : 87
    Par défaut
    bean de l'interface 1 (hardware )


    Code : 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
     
    package sungard_web.mbeans;
     
    import java.io.Serializable;
    import java.util.List;
     
    import javax.annotation.PostConstruct;
    import javax.ejb.EJB;
    import javax.faces.application.FacesMessage;
    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.ViewScoped;
    import javax.faces.context.FacesContext;
    import javax.faces.event.ActionEvent;
     
    import persistence.Hardware;
     
    import persistence.User;
     
     
    import service.serviceHardRemote;
     
     
     
     
    @ManagedBean
    @ViewScoped
    public class HardBean implements Serializable {
     
    	/**
             * 
             */
    	private static final long serialVersionUID = 1L;
     
     
    	@EJB
    	serviceHardRemote serviceHardRemote ;
     
     
     
     
     
     
    	private Hardware hardware;
    	private Hardware selectedHard;
    	private List<Hardware> hardwares;
    	private User selectedUser;
     
     
    	public HardBean() {
     
    	}
    	@PostConstruct
    	public void init(){
    		hardware = new Hardware();
    		selectedHard = new Hardware();
    		hardwares = serviceHardRemote.getAll();
     
    	}
     
    	public void addHardware() {
    		System.out.println("addHard invoked ");
     
    		serviceHardRemote.insertHard(hardware);
     
    		hardwares = serviceHardRemote.getAll();
     
    	}
    		public void addInfo(ActionEvent actionEvent) {
    			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO,"Sample info message", "Hard added !!"));
    		}
     
     
    		public void reset() {
     
    			this.hardware = new Hardware();
    		}
     
     
    		public void updateHard()
    		{
    	    System.out.println("updateHard invoked");
     
     
     
     
     
     
    		serviceHardRemote.updateHard(selectedHard);
    		hardwares = serviceHardRemote.getAll();
    		}
     
    		public void deletePlayer() {
     
    			 System.out.println("deleteHard invoked");
    			 Hardware hardware = serviceHardRemote.getByIdHard(selectedHard.getId());
    			 serviceHardRemote.deleteHard(hardware);
    			 hardwares = serviceHardRemote.getAll();
    			}
     
     
    		public Hardware getHardware() {
    			return hardware;
    		}
    		public void setHardware(Hardware hardware) {
    			this.hardware = hardware;
    		}
    		public Hardware getSelectedHard() {
    			return selectedHard;
    		}
    		public void setSelectedHard(Hardware selectedHard) {
    			this.selectedHard = selectedHard;
    		}
    		public List<Hardware> getHardwares() {
    			return hardwares;
    		}
    		public void setHardwares(List<Hardware> hardwares) {
    			this.hardwares = hardwares;
    		}
    		public User getSelectedUser() {
    			return selectedUser;
    		}
    		public void setSelectedUser(User selectedUser) {
    			this.selectedUser = selectedUser;
    		}
     
     
     
    	}


    bean de l'interface 2

    Code : 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
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
     
    package sungard_web.mbeans;
     
    import java.io.Serializable;
    import java.util.List;
     
    import javax.annotation.PostConstruct;
    import javax.ejb.EJB;
    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.ViewScoped;
     
     
     
     
     
     
    import javax.faces.context.FacesContext;
     
    import persistence.Bios;
    import persistence.Controllers;
    import persistence.Cpus;
    import persistence.Drives;
    import persistence.Inputs;
    import persistence.Memories;
    import persistence.Modems;
    import persistence.Monitors;
    import persistence.Networks;
    import persistence.Ports;
    import persistence.Slots;
    import persistence.Softwares;
    import service.ServiceSoftwareRemote;
     
     
     
    @ManagedBean
    @ViewScoped
     
    public class SoftBean implements Serializable{
     
    	/**
             * 
             */
    	private static final long serialVersionUID = 1L;
     
     
    	@EJB
    	ServiceSoftwareRemote serviceSoftwareRemote ;
     
     
    	private List <Softwares> Listsoftwares ;
    	private List <Softwares> NonInstalled ;
    	private List <Softwares> Installed ;
    	///////////////////////////////////
    	private List <Controllers> ListControl ;
     
    	private List <Slots> ListSlot ;
    	private List <Bios> ListBios ;
    	private List <Ports> ListPorts ;
     
    	private List <Modems> ListModems ;
    	private List <Cpus> ListCpu ;
    	private List <Monitors> ListMonitor ;
     
    	private List <Memories> ListMemories ;
    	private List <Networks> ListNetwork ;
     
    	private List <Inputs> ListInputs ;
    	private List <Drives> Listdriver ;
     
     
    	private Softwares softw ;
    	private Controllers contorller ;
    	private Slots slot ;
    	private Bios bios ;
    	private Ports port ;
    	private Modems modem ;
    	private Cpus cpu ;
    	private Monitors monitor ;
    	private Memories memoire ;
    	private Networks network ;
    	private Inputs input ;
    	private Drives drives ;
     
    	public SoftBean() {
     
    	}
     
     
    	@PostConstruct
    	public void init(){
     
    //		 FacesContext.getCurrentInstance().getExternalContext().getSession(true);
    //		softw = new Softwares();
     
    	NonInstalled = serviceSoftwareRemote.getDesitalled();
    	Installed=serviceSoftwareRemote.getInstalled();
     
    		Listsoftwares = serviceSoftwareRemote.getAll();
     
    		ListControl = serviceSoftwareRemote.getAllC();
    		ListSlot = serviceSoftwareRemote.getAllS();
     
    		ListBios = serviceSoftwareRemote.getAllBiso();
    		ListPorts = serviceSoftwareRemote.getAllP();
     
    	ListModems = serviceSoftwareRemote.getAllM();
    		ListCpu = serviceSoftwareRemote.getAllCpu();
     
    		ListMonitor = serviceSoftwareRemote.getAllMonit();
    		ListMemories = serviceSoftwareRemote.getAllMemory();
    		ListNetwork = serviceSoftwareRemote.getAllNetwork();
     
    		ListInputs = serviceSoftwareRemote.getAllInput();
    		Listdriver = serviceSoftwareRemote.getAllDrives();
     
     
     
    	}
     
    	public void show () {
     
    		Listsoftwares = serviceSoftwareRemote.getAll();
     
    	}
     
     
    	public ServiceSoftwareRemote getServiceSoftwareRemote() {
    		return serviceSoftwareRemote;
    	}
     
     
    	public void setServiceSoftwareRemote(ServiceSoftwareRemote serviceSoftwareRemote) {
    		this.serviceSoftwareRemote = serviceSoftwareRemote;
    	}
     
     
     
     
     
    	public List<Softwares> getListsoftwares() {
    		return Listsoftwares;
    	}
     
     
    	public void setListsoftwares(List<Softwares> listsoftwares) {
    		Listsoftwares = listsoftwares;
    	}
     
     
    	public Softwares getSoftw() {
    		return softw;
    	}
     
     
    	public void setSoftw(Softwares softw) {
    		this.softw = softw;
    	}
     
     
    	public List <Softwares> getNonInstalled() {
    		return NonInstalled;
    	}
     
     
    	public void setNonInstalled(List <Softwares> nonInstalled) {
    		NonInstalled = nonInstalled;
    	}
     
     
    	public List <Softwares> getInstalled() {
    		return Installed;
    	}
     
     
    	public void setInstalled(List <Softwares> installed) {
    		Installed = installed;
    	}
     
     
    	public List<Controllers> getListControl() {
    		return ListControl;
    	}
     
     
    	public void setListControl(List<Controllers> listControl) {
    		ListControl = listControl;
    	}
     
     
    	public List<Slots> getListSlot() {
    		return ListSlot;
    	}
     
     
    	public void setListSlot(List<Slots> listSlot) {
    		ListSlot = listSlot;
    	}
     
     
    	public List<Bios> getListBios() {
    		return ListBios;
    	}
     
     
    	public void setListBios(List<Bios> listBios) {
    		ListBios = listBios;
    	}
     
     
    	public List<Ports> getListPorts() {
    		return ListPorts;
    	}
     
     
    	public void setListPorts(List<Ports> listPorts) {
    		ListPorts = listPorts;
    	}
     
     
    	public List<Modems> getListModems() {
    		return ListModems;
    	}
     
     
    	public void setListModems(List<Modems> listModems) {
    		ListModems = listModems;
    	}
     
     
    	public List<Cpus> getListCpu() {
    		return ListCpu;
    	}
     
     
    	public void setListCpu(List<Cpus> listCpu) {
    		ListCpu = listCpu;
    	}
     
     
    	public List<Monitors> getListMonitor() {
    		return ListMonitor;
    	}
     
     
    	public void setListMonitor(List<Monitors> listMonitor) {
    		ListMonitor = listMonitor;
    	}
     
     
    	public List<Memories> getListMemories() {
    		return ListMemories;
    	}
     
     
    	public void setListMemories(List<Memories> listMemories) {
    		ListMemories = listMemories;
    	}
     
     
    	public List<Networks> getListNetwork() {
    		return ListNetwork;
    	}
     
     
    	public void setListNetwork(List<Networks> listNetwork) {
    		ListNetwork = listNetwork;
    	}
     
     
    	public List<Inputs> getListInputs() {
    		return ListInputs;
    	}
     
     
    	public void setListInputs(List<Inputs> listInputs) {
    		ListInputs = listInputs;
    	}
     
     
    	public List<Drives> getListdriver() {
    		return Listdriver;
    	}
     
     
    	public void setListdriver(List<Drives> listdriver) {
    		Listdriver = listdriver;
    	}
     
     
    	public Controllers getContorller() {
    		return contorller;
    	}
     
     
    	public void setContorller(Controllers contorller) {
    		this.contorller = contorller;
    	}
     
     
    	public Slots getSlot() {
    		return slot;
    	}
     
     
    	public void setSlot(Slots slot) {
    		this.slot = slot;
    	}
     
     
    	public Bios getBios() {
    		return bios;
    	}
     
     
    	public void setBios(Bios bios) {
    		this.bios = bios;
    	}
     
     
    	public Ports getPort() {
    		return port;
    	}
     
     
    	public void setPort(Ports port) {
    		this.port = port;
    	}
     
     
    	public Modems getModem() {
    		return modem;
    	}
     
     
    	public void setModem(Modems modem) {
    		this.modem = modem;
    	}
     
     
    	public Cpus getCpu() {
    		return cpu;
    	}
     
     
    	public void setCpu(Cpus cpu) {
    		this.cpu = cpu;
    	}
     
     
    	public Monitors getMonitor() {
    		return monitor;
    	}
     
     
    	public void setMonitor(Monitors monitor) {
    		this.monitor = monitor;
    	}
     
     
    	public Memories getMemoire() {
    		return memoire;
    	}
     
     
    	public void setMemoire(Memories memoire) {
    		this.memoire = memoire;
    	}
     
     
    	public Networks getNetwork() {
    		return network;
    	}
     
     
    	public void setNetwork(Networks network) {
    		this.network = network;
    	}
     
     
    	public Inputs getInput() {
    		return input;
    	}
     
     
    	public void setInput(Inputs input) {
    		this.input = input;
    	}
     
     
    	public Drives getDrives() {
    		return drives;
    	}
     
     
    	public void setDrives(Drives drives) {
    		this.drives = drives;
    	}
     
     
     
     
     
    }

  6. #6
    Membre confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2015
    Messages
    87
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2015
    Messages : 87
    Par défaut
    tu propose quelque chose ?

Discussions similaires

  1. chercher les composants dans une autre interface selon id selectionné
    Par monta_amri dans le forum Développement Web en Java
    Réponses: 0
    Dernier message: 28/04/2015, 11h14
  2. [Toutes versions] Recherche de données dans une feuille pour les copier dans une autre
    Par mattdogg97 dans le forum Macros et VBA Excel
    Réponses: 6
    Dernier message: 07/02/2011, 14h22
  3. Réponses: 3
    Dernier message: 11/04/2007, 14h01
  4. [SWT] centrer les composants dans une vue
    Par LoloBebop dans le forum SWT/JFace
    Réponses: 2
    Dernier message: 07/06/2006, 10h34

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