You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ed...@marsh.com on 2003/08/08 22:32:41 UTC

Hidden component - bug or feature?

Is the value that is rendered for a Hidden component supposed to be
prefaced with a lowercase "l" (el) when the mapped object is of type
java.lang.Long?
I just placed a Hidden component in my html file <input type="hidden" jwcid
="dCash@Hidden" value="ognl:visit.dCash">.  dCash is of type
java.lang.Long.
I have a ValidField component that is mapped to "ognl:visit.cash".  cash is
also of type java.lang.Long.  I set an initial dummy value for both
attributes to 999101.
The ValidField rendered an input tag with type="text" and value="999101",
but the Hidden component rendered an input tag with type="hidden" (as
expected) and value="l999101" (the "l" prefix not expected).

Has anyone else encountered this?  Is it expected behavior?

Regards,
Ed




Re: Hidden component - bug or feature?

Posted by Geoff Longman <gl...@intelligentworks.com>.
feature.

Tapestry uses a DataSqueezer to encode objects in a Hidden field. You can
register DataSqueezers for your own classes to optimize the 'squeezing'.

from the src...

/**
* A class used to convert arbitrary objects to Strings and back.
* This has particular uses involving HTTP URLs and Cookies.
*
* @author Howard Lewis Ship
* @version $Id: DataSqueezer.java,v 1.3 2003/05/28 13:41:47 hlship Exp $
*
**/
public class DataSqueezer .......


Geoff



----- Original Message -----
From: <Ed...@marsh.com>
To: <ta...@jakarta.apache.org>
Sent: Friday, August 08, 2003 4:32 PM
Subject: Hidden component - bug or feature?


> Is the value that is rendered for a Hidden component supposed to be
> prefaced with a lowercase "l" (el) when the mapped object is of type
> java.lang.Long?
> I just placed a Hidden component in my html file <input type="hidden"
jwcid
> ="dCash@Hidden" value="ognl:visit.dCash">.  dCash is of type
> java.lang.Long.
> I have a ValidField component that is mapped to "ognl:visit.cash".  cash
is
> also of type java.lang.Long.  I set an initial dummy value for both
> attributes to 999101.
> The ValidField rendered an input tag with type="text" and value="999101",
> but the Hidden component rendered an input tag with type="hidden" (as
> expected) and value="l999101" (the "l" prefix not expected).
>
> Has anyone else encountered this?  Is it expected behavior?
>
> Regards,
> Ed
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


RE: Hidden component - bug or feature?

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
The Hidden component does, by default, encode the object type with its value,using a standard
approach used in Tapestry (see the DataSqueezer javadoc).  Same approach is used for encoding
parameters for a DirectLink.

There's a parameter, raw I believe, used to turn this off when you are assured that the value will
always be a string ... but that's mostly for use when client-side JavaScript is using the hidden
field to communcate with the application.  Normally, just let the value be.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Ed.Trembicki-Guy@marsh.com [mailto:Ed.Trembicki-Guy@marsh.com] 
> Sent: Friday, August 08, 2003 4:33 PM
> To: tapestry-user@jakarta.apache.org
> Subject: Hidden component - bug or feature?
> 
> 
> Is the value that is rendered for a Hidden component supposed 
> to be prefaced with a lowercase "l" (el) when the mapped 
> object is of type java.lang.Long? I just placed a Hidden 
> component in my html file <input type="hidden" jwcid 
> ="dCash@Hidden" value="ognl:visit.dCash">.  dCash is of type 
> java.lang.Long. I have a ValidField component that is mapped 
> to "ognl:visit.cash".  cash is also of type java.lang.Long.  
> I set an initial dummy value for both attributes to 999101. 
> The ValidField rendered an input tag with type="text" and 
> value="999101", but the Hidden component rendered an input 
> tag with type="hidden" (as
> expected) and value="l999101" (the "l" prefix not expected).
> 
> Has anyone else encountered this?  Is it expected behavior?
> 
> Regards,
> Ed
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>