0

Hi i am developping a jsf spring application and i am using primefaces library what i found is that ajax calls <p:ajax listener="#{etatTest.onClientChange}" update="pret"/> <p:ajax listener="#{etatTest.onEntiteChange}" update="clients"/> <are not firing at all , i tried to debug but nothing this is my bean

@Named
@ViewScoped
public class EtatTest implements Serializable{
    @Autowired
    private IEntiteManager entiteManager;
    private Integer idEntite;
    private List<Entites> ents;
    private Entites entite;
    
    @Autowired
    private ICrmClientManager clientManager;
    private Crmclients crmClient;
    private List<Crmclients> crmClients;
      

    @Autowired
    private IBqPretManager bqpretManager;
    private Bqpret pret;
    private List<Bqpret> listPret;
     @PostConstruct
    public void init() {
           ents =entiteManager.AllEntites("03052021105404", 1);
    }
     
      
    
    public void onEntiteChange() 
    {
        if(entite !=null && !entite.equals(null)) {
            crmClients=clientManager.getByEntite(entite);
        }else {
            crmClients=new ArrayList<Crmclients>();
        }
    }
    
    public void onClientChange() {
        if(crmClient==null && !crmClient.equals(null)) {
            listPret = bqpretManager.listBqpret(null,null,null ,crmClient.getId(),null,null, null,null,null, null);
        }else {
            listPret=new ArrayList<Bqpret>();
        }
    }

    //getters and setters 
     <h:form>
        <p:growl id="msgs" showDetail="true" skipDetailIfEqualsSummary="true"/>

        <p:panel header="Select a Location" style="margin-bottom:10px;">
            <h:panelGrid columns="2" cellpadding="5">
         <p:outputLabel for="entite" value="Entity: "/>
                <p:selectOneMenu id="entite" value="#{etatTest.entite}" style="width:150px">
                    <p:ajax listener="#{etatTest.onEntiteChange}" update="clients"/>
                    <f:selectItem itemLabel="Select Entite" itemValue="" noSelectionOption="true"/>
                    <f:selectItems value="#{etatTest.ents}" var="p" itemLabel="#{p.libelle}" itemValue="#{p.id}"/>
                </p:selectOneMenu>
                
                <p:outputLabel for="clients" value="Client: "/>
                <p:selectOneMenu id="clients" value="#{etatTest.crmClient}" style="width:150px">
                <p:ajax listener="#{etatTest.onClientChange}" update="pret"/>
                    <f:selectItem itemLabel="Select client" itemValue="" noSelectionOption="true"/>
                    <f:selectItems value="#{etatTest.crmClients}" var="p" itemLabel="#{p.libelle}" itemValue="#{p.id}"/>
                </p:selectOneMenu>



      <p:outputLabel for="pret" value="Pret: "/>
                <p:selectOneMenu id="pret" value="#{etatTest.pret}" style="width:150px">
                    <f:selectItem itemLabel="Select pret" itemValue="" noSelectionOption="true"/>
                    <f:selectItems value="#{etatTest.listPret}" var="p" itemLabel="#{p.libelle}" itemValue="#{p.id}"/>
                </p:selectOneMenu>
                
            </h:panelGrid>
        </p:panel>
    </h:form>
Ismail Bouaddi
  • 165
  • 1
  • 9

0 Answers0