DEV Community

aristides villarreal
aristides villarreal

Posted on

Error con < p:selectBooleanCheckbox /> en datatable < p:cellEditor />

Para corregir el comportamiento de un un selectBooleanCheckBox en un datatable editable mediante p:cellEditor recurrimos a algo muy simple.

  • Utilizar un elemento hthml de tipo checbox.

Agregar un css para establecer el alto y ancho del componente

 <style type="text/css">
 input.htmlCheckbox {
            width: 20px;
            height: 20px;
        }
</style>
Enter fullscreen mode Exit fullscreen mode

Ahora en el datatable

<p:column headerText="#{msg['field.active']}">
    <p:cellEditor >
         <f:facet name="output">
                                              <p:selectBooleanCheckbox value="#{item.active}" readonly="true"/>
         </f:facet>

         <f:facet name="input">
           <input type="checkbox" jsf:value="#{item.active}"                                                       
                  class="htmlCheckbox"/>                                                                            


         </f:facet>


    </p:cellEditor >
 </p:column>

Enter fullscreen mode Exit fullscreen mode

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

AWS GenAI Live!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️