Attributes are usually coded as (JDK 1.5 syntax):

private Boolean rendered;

public boolean isRendered()
{
 if (this.rendered != null) return this.rendered;
 ValueBinding vb = getValueBinding("rendered");
 return (vb == null) ? return true : (Boolean)vb.getValue(getFacesContext());
}

Basically, if the value binding is null, you get the property's
default value. In the case of rendered, the default is true. If you
want null to be not rendered use:

<t:column rendered="#{empty myprop ? false : myprop}" />

-Andrew

On 6/20/06, Michael Heinen <[EMAIL PROTECTED]> wrote:




I am a little bit surprised that the rendered attribute of t:column
evaluates to true for null values.

e.g. <t:column rendered="#{null}"> means that the column is rendered.



I expected a behaviour like in Boolean.parseBoolean(String) method.

'The boolean returned represents the value true if the string argument is
not null and is equal, ignoring case, to the string "true"'



It is ok that true is the default value of this attribute but if the
rendered attribute is specified and the value could not be evaluated to a
boolean

then I would expect false as result.



Why does this differ and is it expected to work this way?

I think it causes additional work because null checks have to be added.



Michael

Reply via email to