You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Harish Krishnaswamy <hk...@comcast.net> on 2003/08/01 02:30:35 UTC

Are primitive attributes taboo in Tapestry?

Hi,

I wonder why blank form components cannot update properties of primitive 
type (throws a "NoSuchMethodException setProperty(null)"). Why can't 
blanks be converted to the default primitive values before a set method 
is invoked? I had a lot of primitive attributes in my DTOs that were 
bound to form components and I had to change these attributes to be 
their corresponding object types to beat this problem. What is the 
design that other people are using in this basic situation, I wonder. 
Are primitives attributes taboo in Tapestry? Can someone shed some light 
here, please?

Thanks
Harish


Re: Are primitive attributes taboo in Tapestry?

Posted by Harish Krishnaswamy <hk...@comcast.net>.
Hi mb,

Very simple situation. I have a query form where the criteria can be 
specified via a number of non-required fields. Some of these fields are 
bound to primitive types. Now let's say the user wishes to specify a 
criteria via an int field (id) and then changes his/her mind and 
specifies the criteria via another field and wipes out the id field, 
this throws a NoSuchMethodException because Tapestry tries to set the id 
property via setId(null) while there is only setId(int) available.

-Harish

Mindbridge wrote:

>Sorry, still asleep. This is about component _parameter_ types -- their
>primitives are limited to boolean, int, and double (a restriction that can,
>and should be lifted, I think, but using the Object type for the others is a
>workaround).
>
>Component _properties_ should work with all primitive types.
>
>If you could give some more details on what you are doing, that will be
>great.
>
>Best regards,
>-mb
>
>
>----- Original Message ----- 
>From: "Mindbridge" <mi...@yahoo.com>
>To: "Tapestry users" <ta...@jakarta.apache.org>
>Sent: Friday, August 01, 2003 9:14 AM
>Subject: Re: Are primitive attributes taboo in Tapestry?
>
>
>  
>
>>Hi,
>>
>>The primitive types boolean, int, and double are definitely supported as
>>component properties types.
>>What are you using?
>>
>>-mb
>>
>>
>>----- Original Message ----- 
>>From: "Harish Krishnaswamy" <hk...@comcast.net>
>>To: <ta...@jakarta.apache.org>
>>Sent: Friday, August 01, 2003 3:30 AM
>>Subject: Are primitive attributes taboo in Tapestry?
>>
>>
>>    
>>
>>>Hi,
>>>
>>>I wonder why blank form components cannot update properties of primitive
>>>type (throws a "NoSuchMethodException setProperty(null)"). Why can't
>>>blanks be converted to the default primitive values before a set method
>>>is invoked? I had a lot of primitive attributes in my DTOs that were
>>>bound to form components and I had to change these attributes to be
>>>their corresponding object types to beat this problem. What is the
>>>design that other people are using in this basic situation, I wonder.
>>>Are primitives attributes taboo in Tapestry? Can someone shed some light
>>>here, please?
>>>
>>>Thanks
>>>Harish
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>

Re: Are primitive attributes taboo in Tapestry?

Posted by Mindbridge <mi...@yahoo.com>.
Sorry, still asleep. This is about component _parameter_ types -- their
primitives are limited to boolean, int, and double (a restriction that can,
and should be lifted, I think, but using the Object type for the others is a
workaround).

Component _properties_ should work with all primitive types.

If you could give some more details on what you are doing, that will be
great.

Best regards,
-mb


----- Original Message ----- 
From: "Mindbridge" <mi...@yahoo.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Friday, August 01, 2003 9:14 AM
Subject: Re: Are primitive attributes taboo in Tapestry?


> Hi,
>
> The primitive types boolean, int, and double are definitely supported as
> component properties types.
> What are you using?
>
> -mb
>
>
> ----- Original Message ----- 
> From: "Harish Krishnaswamy" <hk...@comcast.net>
> To: <ta...@jakarta.apache.org>
> Sent: Friday, August 01, 2003 3:30 AM
> Subject: Are primitive attributes taboo in Tapestry?
>
>
> > Hi,
> >
> > I wonder why blank form components cannot update properties of primitive
> > type (throws a "NoSuchMethodException setProperty(null)"). Why can't
> > blanks be converted to the default primitive values before a set method
> > is invoked? I had a lot of primitive attributes in my DTOs that were
> > bound to form components and I had to change these attributes to be
> > their corresponding object types to beat this problem. What is the
> > design that other people are using in this basic situation, I wonder.
> > Are primitives attributes taboo in Tapestry? Can someone shed some light
> > here, please?
> >
> > Thanks
> > Harish
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Are primitive attributes taboo in Tapestry?

Posted by Mindbridge <mi...@yahoo.com>.
Hi,

The primitive types boolean, int, and double are definitely supported as
component properties types.
What are you using?

-mb


----- Original Message ----- 
From: "Harish Krishnaswamy" <hk...@comcast.net>
To: <ta...@jakarta.apache.org>
Sent: Friday, August 01, 2003 3:30 AM
Subject: Are primitive attributes taboo in Tapestry?


> Hi,
>
> I wonder why blank form components cannot update properties of primitive
> type (throws a "NoSuchMethodException setProperty(null)"). Why can't
> blanks be converted to the default primitive values before a set method
> is invoked? I had a lot of primitive attributes in my DTOs that were
> bound to form components and I had to change these attributes to be
> their corresponding object types to beat this problem. What is the
> design that other people are using in this basic situation, I wonder.
> Are primitives attributes taboo in Tapestry? Can someone shed some light
> here, please?
>
> Thanks
> Harish
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org