You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Erich Gormann <e....@gormann.de> on 2014/05/27 14:33:42 UTC

Grids Bean Model does not support "is" methods

Hi all,

in my grid I want to display a bean containig a property of type Boolean,
which has not getter, but an "is" method. 
The grids reports the error, that the property is missing in the bean to
render. 

How to get grid working with "is" methods? 

Thanks in advance for your help 
Eric

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


Re: Grids Bean Model does not support "is" methods

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Sat, 31 May 2014 07:51:56 -0300, Muhammad Gelbana <m....@gmail.com>  
wrote:

> I don't see a reason why Tapestry doesn't support such a case. Unless
> Tapestry uses a 3rd party library that strictly complies with the java
> beans specifications to read getters\setters,

Tapestry doesn't use a 3rd party library. It uses the classes in the  
java.beans package. That's a 1st party library in the Java world. Classes  
 from Java itself. So the source code generator is actually wrong (at least  
in the configuration that generated isXXX() methods returning Boolean).

In this very specific case, I think the JavaBeans specification is  
correct: Boolean isn't actually a boolean type, because it has three  
values: true, false and null. So it doesn't make any sense an isXXX()  
method which can return something which isn't true nor false.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: Grids Bean Model does not support "is" methods

Posted by Muhammad Gelbana <m....@gmail.com>.
I don't see a reason why Tapestry doesn't support such a case. Unless
Tapestry uses a 3rd party library that strictly complies with the java
beans specifications to read getters\setters, It would be a pleasure for
Tapestry users to find Tapestry going an extra mile to make their lives
easier, that's why we are using Tapestry in the first place, Its awesome.

I personally don't see a reason why a "is" methods should support primitive
boolean only. I won't be surprised if the specs change in the future to
support Boolean objects too, but should we wait for that to happen to
change how Tapestry works ?!

*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana


On Fri, May 30, 2014 at 9:29 PM, Erich Gormann <e....@gormann.de> wrote:

> Thanks Howard,
>
> we fixed the way CXF generates our webservice types and now we have the
> desired getter.
> Of course it was not compliant to the bean spec before, but I saw no way
> to change the generation behavior.
>
> Regards
> Eric
>
> Am 30.05.2014 18:43, schrieb Howard Lewis Ship:
>
>  If you getter method is "is", not "get", prefixed then the type MUST be
>> boolean, not Boolean.  That's well defined in the Java Beans
>> specification.
>>
>>
>> On Thu, May 29, 2014 at 12:41 AM, Lance Java<la...@googlemail.com>
>> wrote:
>>
>>  Eg: https://gist.github.com/uklance/0d461f9618b3a131ca3b
>>>   On 28 May 2014 12:43, "Lance Java"<la...@googlemail.com>  wrote:
>>>
>>>  Another solution is to override / decorate BeanModelSource. The easiest
>>>> solution is call the default implementation then add the extra
>>>> PropertyModel(s) to the BeanModel.
>>>>
>>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Grids Bean Model does not support "is" methods

Posted by Erich Gormann <e....@gormann.de>.
Thanks Howard,

we fixed the way CXF generates our webservice types and now we have the 
desired getter.
Of course it was not compliant to the bean spec before, but I saw no way 
to change the generation behavior.

Regards
Eric

Am 30.05.2014 18:43, schrieb Howard Lewis Ship:
> If you getter method is "is", not "get", prefixed then the type MUST be
> boolean, not Boolean.  That's well defined in the Java Beans specification.
>
>
> On Thu, May 29, 2014 at 12:41 AM, Lance Java<la...@googlemail.com>
> wrote:
>
>> Eg: https://gist.github.com/uklance/0d461f9618b3a131ca3b
>>   On 28 May 2014 12:43, "Lance Java"<la...@googlemail.com>  wrote:
>>
>>> Another solution is to override / decorate BeanModelSource. The easiest
>>> solution is call the default implementation then add the extra
>>> PropertyModel(s) to the BeanModel.
>>>
>
>


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


Re: Grids Bean Model does not support "is" methods

Posted by Howard Lewis Ship <hl...@gmail.com>.
If you getter method is "is", not "get", prefixed then the type MUST be
boolean, not Boolean.  That's well defined in the Java Beans specification.


On Thu, May 29, 2014 at 12:41 AM, Lance Java <la...@googlemail.com>
wrote:

> Eg: https://gist.github.com/uklance/0d461f9618b3a131ca3b
>  On 28 May 2014 12:43, "Lance Java" <la...@googlemail.com> wrote:
>
> > Another solution is to override / decorate BeanModelSource. The easiest
> > solution is call the default implementation then add the extra
> > PropertyModel(s) to the BeanModel.
> >
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com
@hlship

Re: Grids Bean Model does not support "is" methods

Posted by Lance Java <la...@googlemail.com>.
Eg: https://gist.github.com/uklance/0d461f9618b3a131ca3b
 On 28 May 2014 12:43, "Lance Java" <la...@googlemail.com> wrote:

> Another solution is to override / decorate BeanModelSource. The easiest
> solution is call the default implementation then add the extra
> PropertyModel(s) to the BeanModel.
>

Re: Grids Bean Model does not support "is" methods

Posted by Lance Java <la...@googlemail.com>.
Another solution is to override / decorate BeanModelSource. The easiest
solution is call the default implementation then add the extra
PropertyModel(s) to the BeanModel.

Re: Grids Bean Model does not support "is" methods

Posted by Lance Java <la...@googlemail.com>.
Exactly... And specifying an "add" parameter adds it to the model thus
working around the issue.
On 28 May 2014 07:35, "Erich Gormann" <e....@gormann.de> wrote:

> Theoretically yes, but the problem is, that the property is not even in the
> grids bean model present. Nothing doing.
>
>
> On Tue, 27 May 2014 17:40:56 +0100, Lance Java <la...@googlemail.com>
> wrote:
> > As a quick workaround you can use the grid's "add" parameter to add the
> > property and provide a custom block to render the column.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Grids Bean Model does not support "is" methods

Posted by Erich Gormann <e....@gormann.de>.
Theoretically yes, but the problem is, that the property is not even in the
grids bean model present. Nothing doing. 


On Tue, 27 May 2014 17:40:56 +0100, Lance Java <la...@googlemail.com>
wrote:
> As a quick workaround you can use the grid's "add" parameter to add the
> property and provide a custom block to render the column.

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


Re: Grids Bean Model does not support "is" methods

Posted by Lance Java <la...@googlemail.com>.
As a quick workaround you can use the grid's "add" parameter to add the
property and provide a custom block to render the column.

Re: Grids Bean Model does not support "is" methods

Posted by Erich Gormann <e....@gormann.de>.
Hi,

yes I know this but I forgot to tell that the bean is generated from a WSDL
file and the generation process seems not to "know" about the bean spec ;-)

Thanks for your help. 

Regards
Eric




On Tue, 27 May 2014 14:18:28 +0100, Lance Java <la...@googlemail.com>
wrote:
> If you read the java beans spec, you'll see that "is" can only be used
for
> primitive boolean, not java.lang.Boolean.
> 
> I remember this was discussed in the past that tapestry could be a bit
more
> lenient here and support Boolean but I don't think anything done. Please
> file a jira.
> On 27 May 2014 13:34, "Erich Gormann" <e....@gormann.de> wrote:
> 
>> Hi all,
>>
>> in my grid I want to display a bean containig a property of type
Boolean,
>> which has not getter, but an "is" method.
>> The grids reports the error, that the property is missing in the bean to
>> render.
>>
>> How to get grid working with "is" methods?
>>
>> Thanks in advance for your help
>> Eric
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>

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


Re: Grids Bean Model does not support "is" methods

Posted by Lance Java <la...@googlemail.com>.
If you read the java beans spec, you'll see that "is" can only be used for
primitive boolean, not java.lang.Boolean.

I remember this was discussed in the past that tapestry could be a bit more
lenient here and support Boolean but I don't think anything done. Please
file a jira.
On 27 May 2014 13:34, "Erich Gormann" <e....@gormann.de> wrote:

> Hi all,
>
> in my grid I want to display a bean containig a property of type Boolean,
> which has not getter, but an "is" method.
> The grids reports the error, that the property is missing in the bean to
> render.
>
> How to get grid working with "is" methods?
>
> Thanks in advance for your help
> Eric
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>