0

So. I have a selectBooleanCheckbox in my JSF web application.

           <h:form id="settings">
                <div class="col-xs-8">
                    <label for="settings:check1" class="control-label">Email
                        reports</label>
                </div>
                <div class="col-xs-4 text-center">
                    <h:selectBooleanCheckbox id="check1" class="js-switch"
                        valueChangeListener="#{companyBean.emailReportsChange()}"
                        type="checkbox" value="#{companyBean.settingsEmail}">
                        <p:ajax event="change" update="settings" />
                    </h:selectBooleanCheckbox>
                </div>
            </h:form>

This is working, the problem is.

Before submit look like this Very well

after submit ajax look like this Very bad

Why is this hapenning? After I submit the boolean change well, the method in bean is working fine. But I lost my style of my boolean checkbox

Instead of using PrimeFaces <p:ajax> i already used <f:ajax>. Same result.

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
drupal2me
  • 69
  • 4
  • So the only thing from PrimeFaces here is the `p:ajax` and it also fails with `f:ajax`... So how is this PrimeFaces related? Removing the PrimeFaces tag, changing the code and maybe 'reverse' the comment about the two ajax tags is an improvement of your question – Kukeltje Jan 12 '16 at 19:25
  • Step 1: create an [mcve] (it is a great exercise in getting to the root cause). Also read http://www.stackoverflow.com/tags/jsf/info. I suspect (looking at the images) you use some javascript framework (which you did not post) that 'enhances' plain html and it 'runs' at page load time and not again after the update. That leads me to think you are in general very new to all the web technologies, right? – Kukeltje Jan 12 '16 at 19:29

0 Answers0