You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Robert Binna <r....@synedra.com> on 2007/11/13 15:54:57 UTC

Interesting Behaviour of Boolean Paramter in tapestry 4

Hi

We are using tapestry 4.1.3. We have a component that displays a select 
box where you are able to select, true, false and null. So the obvious 
choice for a value parameter would be Boolean.

Therefor in our component we have a parameter called value defined like 
in the example below.

@Parameter(name = "value", required = true)
public abstract Boolean getValue();
public abstract void setValue(Boolen value);

A problem occurs if we bind a null value to the value parameter, because 
the value at parameter access gets magically converted to false.

At the moment our only solution to solve this problem is to set the 
parametertype to Object.  It works but it feels a bit suboptimal.

@Parameter(name = "value", required = true)
public abstract Object getValue();
public abstract void setValue(Object value);

Does anybody know if the behaviour described above is intended or how it 
is possible to get around it without changing the parameter type to Object.

Kind regards,
             Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org