TheCoder4eu / BootsFaces-OSP

BootsFaces - Open Source Project
Apache License 2.0
246 stars 102 forks source link

Ajax Update for SelectBooleanCheckbox is wrong #1069

Closed ElectroStar closed 5 years ago

ElectroStar commented 5 years ago

In Bootsfaces 1.4.1: When you use a selectBooleanCheckbox with the a fixed Value (value="true") it isn't fix. When changing the Value and trigger an ajax-request with onchange="ajax:controller.function())" update="@parent" the response will have the "new" value (checked if it was unchecked before the change OR unchecked if it was checked before the change).

According to the standard h:selectBooleanCheckbox this behaviour is an error.

<h:panelGroup id="blup">
    <b:selectBooleanCheckbox value="true" caption="Test" update="@parent" ajax="true" onchange="ajax:testController.action()" /> 
    <!-- The Checked Value will change and isnt fix to true -->
</h:panelGroup>
<h:panelGroup id="blup">
  <h:selectBooleanCheckbox value="true">
    <f:ajax render="blup" event="change" listener="#{testController.action()}"/>  
  </h:selectBooleanCheckbox> <!-- The Checked Value is fix as it should be -->
</h:panelGroup>
stephanrauh commented 5 years ago

Strange bug. I can see how and when it hurts.

What I can't confirm is that the checkbox works any different with standard JSF. I've tried both Mojarra and PrimeFaces, and they show the same bug.

stephanrauh commented 5 years ago

I've also tested Liberty Profile, which uses MyFaces. Same result.

stephanrauh commented 5 years ago

I'm closing the ticket now because I don't see any point in fixing a bug when the bug fix makes BootsFaces differently than any other JSF framework. I'm just confused why the h:selectBooleanCheckbox behaves different on your machine.