0

I'm using a triStateCheckbox element with primefaces-extensions 6.0.0 and primefaces 6.0 and it's not renderering the initial value. I created an example view with the three possible values and I still get three empty checkboxes.

This is the example:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:pe="http://primefaces.org/ui/extensions"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">
<f:view locale="#{localeBean.locale}" contentType="text/html">
    <h:head>
        <h:outputStylesheet library="css" name="standard.css" />
    </h:head>
    <body>

        <h:form id="dataForm" prependId="false" >
            <pe:triStateCheckbox value="2" />
            <pe:triStateCheckbox value="1" />
            <pe:triStateCheckbox value="0" />
        </h:form>
    </body>
</f:view>
</html>

This is what I get: link to image

sagoca
  • 1
  • 1
  • 1
    We also need the code of your anexo7bean to find the issue. Why you added `immediate="true"` to your first option and why you're using `binding` instead of `value`? Note: Why you're using primefaces extensions? The Checkbox is also available without extensions: https://www.primefaces.org/showcase/ui/input/triStateCheckbox.xhtml – lastresort Oct 16 '18 at 10:25
  • For immediate also see: https://stackoverflow.com/questions/12960718/trying-to-understand-immediate-true-skipping-inputs-when-it-shouldnt – lastresort Oct 16 '18 at 10:26
  • I edited the code in order to keep it as simple as possible. I get the same output. – sagoca Oct 16 '18 at 10:44
  • Offtopic (but please read): https://stackoverflow.com/questions/11988415/what-is-the-jsf-resource-library-for-and-how-should-it-be-used/ and https://stackoverflow.com/questions/7415230/uiform-with-prependid-false-breaks-fajax-render – Kukeltje Oct 16 '18 at 11:05
  • @sagoca you should be using PrimeFaces TriStateCheckbox not the PF Extensions one as it has been promoted to core PF. See here: https://www.primefaces.org/showcase/ui/input/triStateCheckbox.xhtml – Melloware Oct 22 '18 at 19:39

0 Answers0