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
| HtmlSelectManyCheckbox list = (HtmlSelectManyCheckbox)app.createComponent(HtmlSelectManyCheckbox.COMPONENT_TYPE);
compSetValue( list, "#{candidatCtr.nouvellelist}" );
UISelectItems selectItems = (UISelectItems)app.createComponent(UISelectItems.COMPONENT_TYPE);
List<SelectItem> options = new ArrayList<SelectItem>();
//Afficher les test du candidat lors de son authentification
listtestcandidat = testcandidatBuss.consulterTestsCandidatSelonId(candidatloginForTest.getIdcandidat());
for(int i = 0 ; i<listtestcandidat.size();i++){
options.add(new SelectItem(i, listtestcandidat.get(i).getTests().getLibelle()));
}
selectItems.setValue(options);
list.getChildren().add(selectItems);
grid.getChildren().add(list);
Random rnd = new Random();
int random = rnd.nextInt( 200000 );
HtmlOutputText lineavantbreakfinish = new HtmlOutputText();
lineavantbreakfinish.setValue("</br>");
lineavantbreakfinish.setEscape(false);
compSetId( lineavantbreakfinish, "linebreakavantfinish"+random );
grid.getChildren().add(lineavantbreakfinish);
CommandButton monbutton = new CommandButton();
monbutton.setValue("Finish");
monbutton.setStyle("border-radius:7px;margin-left:872px;color:#8B4513");
compSetId( monbutton, "monbutton");
grid.getChildren().add(monbutton);
monbutton.addActionListener(new ActionListener() {
public void processAction(ActionEvent event) throws AbortProcessingException {
System.out.println("button clicked");
System.out.println(nouvellelist.size());
for(int i = 0 ; i< nouvellelist.size();i++){
System.out.println(nouvellelist.get(i).toString());
System.out.println(nouvellelist.size());
}
}
});...return grid |
Partager