I am trying to perform ajax on selecting any element in selectCheckBoxMenu primefaces. But ajax event fires only if itemValue is equal to String. If i am passing object then not event is fired. Please have a look.
package com.gsep.utility.bean;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@ManagedBean
@Entity
@ViewScoped
public class Tool {
    @Id @GeneratedValue
    @Column(name="tool_id")
    private int toolId;
    @Column(name="tool_name")
    private String toolName;
    public int getToolId() {
        return toolId;
    }
    public void setToolId(int toolId) {
        this.toolId = toolId;
    }
    public String getToolName() {
        return toolName;
    }
    public void setToolName(String toolName) {
        this.toolName = toolName;
    }
}
Above is my bean class which i am iterating to display values in selectCheckboxMenu. Below is jsf code
        <p:selectCheckboxMenu id="multiple" value="#{projectBean.selectedToolList}" label="Tools" multiple="true"
                              filter="true" filterMatchMode="startsWith" panelStyle="width:250px" >
                                    <f:selectItems value="#{projectBean.toolList}" var="toolObject" itemLabel="#{toolObject.toolName}" itemValue="#{toolObject}" />
                                    <p:ajax  update="projectRequestForm:testTabView" listener="#{projectBean.addTab(requestBean,projectBean)}" />
                            </p:selectCheckboxMenu>
Here if i am changing itemValue attribute to toolObject.toolName then ajax call is happening but i want the selectedToolList as a Tool collection of objects instead of toolName collection of Strings.
@ManagedBean(name = "projectBean")
@ViewScoped
public class ProjectBeanCompUI {    
    @ManagedProperty(value="#{jiraDao}")
    private JiraProjectDAO jiraDao;
    private List<Tool> toolList;
    private List<String> selectedToolList;
    public List<Tool> getToolList() {
        toolList = getTools();
        return toolList;
    }
    public void setToolList(List<Tool> toolList) {
        this.toolList = toolList;
    }   
    public List<String> getSelectedToolList() {
        return selectedToolList;
    }
    public void setSelectedToolList(List<String> selectedToolList) {
        this.selectedToolList = selectedToolList;
        public List<Tool> getTools()
    {
        List<Tool> toolList = new ArrayList<>();
        Tool tool = new Tool();
        tool.setToolId(1);
        tool.setToolName("Eclipse");
        Tool tool1 = new Tool();
        tool1.setToolId(2);
        tool1.setToolName("Jira");
        toolList.add(tool);
        toolList.add(tool1);
        return toolList;
    }
}
