You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lance Arlaus <la...@codeberet.com> on 2005/08/02 02:45:52 UTC

Possible to omit value attribute?

I'm just getting started with Tapestry 4.0 and had a quick question:

Is it possible to omit the value attribute on a component and still have
Tapestry intelligently bind to a corresponding property on my page class.

In other words, given the following, will Tapestry successfully bind?

 

Page:

.

<input jwcid='email@TextField'/>

.

 

Page Class

public abstract class MyPage extends BasePage {

            public abstract String getEmail();

            .

}

 

I'd give it a shot, but I don't have a working installation yet (working on
my first page) and this seemed like a simple question.


Re: Possible to omit value attribute?

Posted by Adam Greene <ag...@iq-2000.com>.
You could always put in a feature request and let the maintainers decide if 
it would be viable, doable, or logical.

----- Original Message ----- 
From: "Lance Arlaus" <la...@codeberet.com>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Monday, August 01, 2005 10:14 PM
Subject: RE: Possible to omit value attribute?


> Robert-
>
> True, and I like that feature (decoupling properties from parameter 
> names),
> but I thought Tapestry might have default logic that used a default
> ognl:<field_name> if no value attribute was supplied (less typing :).
>
> Thanks for the reply
>
> -----Original Message-----
> From: Robert Zeigler [mailto:robertz@scazdl.org]
> Sent: Monday, August 01, 2005 8:56 PM
> To: Tapestry users
> Subject: Re: Possible to omit value attribute?
>
> Lance,
>
> Tapestry does not do this at present.
> (Sounds a bit like the struts mechanisms.:)
> Rather than using reflection to examine the name of the form field
> and find an associated property name, tapestry relies on bindings to
> do the job.  Which is nice, really, because you don't /have/ to
> have a property on your page called e-mail.  You could have a user
> object as a property, and then bind the text field to user.email.
> Since tapestry is not looking for properties based on parameter names,
> you don't have the worries of malicious users tinkering with parameter
> names to see what properties are available/settable. ;)
>
> Robert
>
> Lance Arlaus wrote:
>> I'm just getting started with Tapestry 4.0 and had a quick question:
>>
>> Is it possible to omit the value attribute on a component and still have
>> Tapestry intelligently bind to a corresponding property on my page class.
>>
>> In other words, given the following, will Tapestry successfully bind?
>>
>>
>>
>> Page:
>>
>> .
>>
>> <input jwcid='email@TextField'/>
>>
>> .
>>
>>
>>
>> Page Class
>>
>> public abstract class MyPage extends BasePage {
>>
>>             public abstract String getEmail();
>>
>>             .
>>
>> }
>>
>>
>>
>> I'd give it a shot, but I don't have a working installation yet (working
> on
>> my first page) and this seemed like a simple question.
>>
>>
>
>
> ---------------------------------------------------------------------
> 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: Possible to omit value attribute?

Posted by Lance Arlaus <la...@codeberet.com>.
Robert-

True, and I like that feature (decoupling properties from parameter names),
but I thought Tapestry might have default logic that used a default
ognl:<field_name> if no value attribute was supplied (less typing :).

Thanks for the reply

-----Original Message-----
From: Robert Zeigler [mailto:robertz@scazdl.org] 
Sent: Monday, August 01, 2005 8:56 PM
To: Tapestry users
Subject: Re: Possible to omit value attribute?

Lance,

Tapestry does not do this at present.
(Sounds a bit like the struts mechanisms.:)
Rather than using reflection to examine the name of the form field
and find an associated property name, tapestry relies on bindings to
do the job.  Which is nice, really, because you don't /have/ to
have a property on your page called e-mail.  You could have a user
object as a property, and then bind the text field to user.email.
Since tapestry is not looking for properties based on parameter names,
you don't have the worries of malicious users tinkering with parameter
names to see what properties are available/settable. ;)

Robert

Lance Arlaus wrote:
> I'm just getting started with Tapestry 4.0 and had a quick question:
> 
> Is it possible to omit the value attribute on a component and still have
> Tapestry intelligently bind to a corresponding property on my page class.
> 
> In other words, given the following, will Tapestry successfully bind?
> 
>  
> 
> Page:
> 
> .
> 
> <input jwcid='email@TextField'/>
> 
> .
> 
>  
> 
> Page Class
> 
> public abstract class MyPage extends BasePage {
> 
>             public abstract String getEmail();
> 
>             .
> 
> }
> 
>  
> 
> I'd give it a shot, but I don't have a working installation yet (working
on
> my first page) and this seemed like a simple question.
> 
> 


---------------------------------------------------------------------
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: Possible to omit value attribute?

Posted by Robert Zeigler <ro...@scazdl.org>.
Lance,

Tapestry does not do this at present.
(Sounds a bit like the struts mechanisms.:)
Rather than using reflection to examine the name of the form field
and find an associated property name, tapestry relies on bindings to
do the job.  Which is nice, really, because you don't /have/ to
have a property on your page called e-mail.  You could have a user
object as a property, and then bind the text field to user.email.
Since tapestry is not looking for properties based on parameter names,
you don't have the worries of malicious users tinkering with parameter
names to see what properties are available/settable. ;)

Robert

Lance Arlaus wrote:
> I'm just getting started with Tapestry 4.0 and had a quick question:
> 
> Is it possible to omit the value attribute on a component and still have
> Tapestry intelligently bind to a corresponding property on my page class.
> 
> In other words, given the following, will Tapestry successfully bind?
> 
>  
> 
> Page:
> 
> .
> 
> <input jwcid='email@TextField'/>
> 
> .
> 
>  
> 
> Page Class
> 
> public abstract class MyPage extends BasePage {
> 
>             public abstract String getEmail();
> 
>             .
> 
> }
> 
>  
> 
> I'd give it a shot, but I don't have a working installation yet (working on
> my first page) and this seemed like a simple question.
> 
> 


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