3 Replies Latest reply on Aug 28, 2015 6:01 AM by Michal Petrov

    CommandButton not invoked in Richfaces Popup Window when doing edit

    Subodh Joshi Newbie

      In a Parent Window i have a List and two commandButton

      1. First commandButton will add a new record in the table.When user will click on this button a popup Window will open, user will give value and submit list will render again and new record will be added .
      2. By second commandButton User can edit the added record by click on this commandbutton for that in parent Window i did below code

      Include Popup Like this

       <rich: panel id = "includePandel" > < ui: include src = "CfsGroupFeature-Add.xhtml" > < ui: param name = "parentBean" value = "#{cfsBean}" / > < /ui:include> </rich: panel >

      Here is the Edit button in Parent class which will call popup bean method

      action = "#{addFeaturePopUpBean.updateCfsGroupFeature(itemsComp,tableIndex.index)}"

      <a4j: commandButton id ="editAlarm" image = "/resources/images/table_edit.png" immediate = "false" 
      execute = "@this" actionListener = "#{cfsBean.updateCfsGroupFeature(itemsComp,tableIndex.index)}" 
      action = "#{addFeaturePopUpBean.updateCfsGroupFeature(itemsComp,tableIndex.index)}" 
      oncomplete = "#{rich:component('popup')}.show(true)" render = "includePandel" > < /a4j:commandButton>

      and i wrote this code in PopupBean or AddFeaturePopUpBean.java

      public void  updateCfsGroupFeature(CompositeCharGroupVo compositeCharGroupVo,Integer row) { 
      ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
       Map<String, Object> sessionMap = externalContext.getSessionMap(); 
      if(sessionMap.get("cfsBean") != null){ 
      CfsBean cfsBean = (CfsBean) sessionMap.get("cfsBean");
       selectionRfsGroupFeature = cfsBean.getSelectionRfsGroupFeature(); 
      for (Object object : selectionRfsGroupFeature) { 
      if(object instanceof Integer){ 
      indexValue = (Integer) object;
       if(compositeCharGroupVo != null && compositeCharGroupVo.getFeaturesList() != null && compositeCharGroupVo.getFeaturesList().get(indexValue) != null){ 
      featuesObj = compositeCharGroupVo.getFeaturesList().get(indexValue);
       }  } } }  }

      Upto here everything working fine and i am able to see the selected row values in popup .


      Now in Popup Window if i am clicking on save button then commandButton not invoked ,its just reset(Removed) the pre populated values. Now if again i will submit the form then its working.

      Note:- I am using same popup Window for Add new Record and Edit ..Save working fine issue is coming only when i am doing edit.


      Message was edited by: Michal Petrov