JSF selectCheckBoxMenu not working properly in IE

前端 未结 2 378
太阳男子
太阳男子 2021-01-16 16:22

I am facing an issue with my jsf application while running it on IE.

The selectcheckboxmenu on jsf behaves faulty and has the checkboxes of the menu it

2条回答
  •  鱼传尺愫
    2021-01-16 16:39

    There is compatibility problem with IE. Primefaces runs good on IE9 compatibility. And your check box is not working beacause of this.

    I had gone through the same issues. So you have to set the Compatibility view by using the life cycle of jsf

    public class UACompatibleHeaderPhaseListener implements PhaseListener {
    @Override
    public void afterPhase(PhaseEvent arg0){}
    
    @Override
    public void beforePhase(PhaseEvent event){
        final FacesContext facesContext = event.getFacesContext();
        final HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
        response.addHeader("X-UA-Compatible", "IE=edge");
    }
    
    @Override
    public PhaseId getPhaseId() {
         return PhaseId.RENDER_RESPONSE;
    }
    }
    

    And in your Faces-config.xml just place the class with the packagename

    
       
         com.jsf.listener.UACompatibleHeaderPhaseListener
       
    
    

提交回复
热议问题