I have JSF: Primefaces SelectCheckBoxMenu
<p:selectCheckboxMenu value="#{domain.listaa}" label="Chooese!" style="height:25px" showCheckbox="true"> <p:ajax update="records" listener="#{domain.muti}" /> <f:selectItems value="#{domain.recLabels}"/> </p:selectCheckboxMenu>
In managed beans:
private boolean[] recFlags = new boolean[]{true,true,true,true,true,true,true}; private String[] recLabels = new String[]{"A","AAAA","MX","NS","SOA","CNAME","TXT"}; private List<String> listaa = new ArrayList<>(); public void muti(AjaxBehaviorEvent event){ Arrays.fill(recFlags, false); for(int i=0;i<recLabels.length;i++){ if(listaa.contains(recLabels[i])){ recFlags[i]=true; } } System.out.println(listaa.toString()); }
So, in SelectCheckBoxMenu I press any button, the ajax call works and the muti () function starts. No problems. But if I click the "select all" button (most of the above) in SelectCheckboxMenu, the ajax call will not work, the muti () function will not be launched, and the list (list of checked flags) will not change. What for? How can I decide that the Select All button works?
source share