Hi,

Tapestry's t:checkbox parameter uses the "value" parameter to determine if
the checkbox should be rendered as checked or not. the "value" parameter
supposed to be a boolean, but if you provide anything else, Tapestry will
attempt to coerce the provided argument to boolean.  There are multiple
built-in Tapestry coercions from various Java types to boolean, some
examples:

   - String - if it is empty or null or equal to "false" (case insensitive)
   is coerced false, otherwise true.
   - Numbers (int, long, etc.) - non-zero values are true;
   - Collections (lists, maps) - non-empty are true;
   - Any other generic object, not coerced otherwise - non-null values are
   true;

So, in your case, "acronyms" is something that Tapestry coerces to Boolean
as the "true" value. If you need to make the checkbox unchecked, provide
the "value" parameter that evaluates as "false".

About coercions you can read here:
https://tapestry.apache.org/parameter-type-coercion.html
https://tapestry.apache.org/type-coercion.html

Details about default type coercions can be found here:
https://github.com/apache/tapestry-5/blob/master/commons/src/main/java/org/apache/tapestry5/ioc/internal/BasicTypeCoercions.java

Cezary


On Tue, Oct 6, 2020 at 9:33 PM marwa hussein <marwa.huss...@gmail.com>
wrote:

> On Tue, Oct 6, 2020 at 5:17 PM Nathan Quirynen <
> nat...@pensionarchitects.be>
> wrote:
>
> > Is it possible that your "acronyms" property has a value of true when
> > rendering ?
> >
> > No it is not. Also I am wondering what could make the "checked" attribute
> default to be true!!
> Also I cant find in tapestry API how to change the attribute checked value
> to false!!
>
>
> >
> > Op 6/10/2020 om 14:42 schreef marwa hussein:
> > > Hi all,
> > >
> > > I am trying to populate a grid with some values and add a column with a
> > > checkbox to select a value..
> > >
> > > <t:grid t:source="OntologyInfoList"  row="OntologyInfo" add="Select">
> > >
> > >            <p:selectcell>
> > >          <t:checkbox t:id="select" value="acronyms"/>
> > >
> > > The problem when the grid is populated I found the Checkbox checked by
> > > default, although I didn't use the "check" attribute (which suppose to
> be
> > > "false" by default)!!
> > > how can I make solve this and make it unchecked in the begining??
> > >
> > > Regards,
> > > Marwa
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
> --
>
>
>
> *Marwa Hussein M. TA @ Information Systems Department Faculty of Computers
> & Information Assuit University*
> <imanhe...@yahoo.com>
>

Reply via email to