You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Norris <CN...@widen.com> on 2004/01/29 22:36:32 UTC

Two components modifying the same property?

Is it possible to have to components modify a single property?  I have a
page with a modified DatePicker component.  I'm trying to write a separate
component that will modify the time part of the date.  We were doing it
before with just a drop down list of string times that came from an array
setting a string property.  We'd set the hour (using the Calendar class)
based on the string property's index in the array.  Is this even possible?
Or do I have to make one component that will do both things?

 


Re: Two components modifying the same property?

Posted by Paul Ferraro <pm...@columbia.edu>.
I don't think so.  If two components are bound to the same property, 
then the second binding will overwrite the first.  As you guesses, 
you'll have to create a single component that contains a 
java.util.Calendar property.  The component's "value" parameter (of type 
java.util.Date) would have to be bound to a synthesized property that 
exposes the internal date.  The component would contain a date picker 
(bound to ognl:calendar.time), and time field dropdowns (bound to 
synthesized properties that modify the time fields of the calendar).
You'll also have the constraint that the DatePicker component will have 
to come before your time field dropdowns - but that seems natural anyway.

Paul Ferraro

Chris Norris wrote:

>Is it possible to have to components modify a single property?  I have a
>page with a modified DatePicker component.  I'm trying to write a separate
>component that will modify the time part of the date.  We were doing it
>before with just a drop down list of string times that came from an array
>setting a string property.  We'd set the hour (using the Calendar class)
>based on the string property's index in the array.  Is this even possible?
>Or do I have to make one component that will do both things?
>
> 
>
>
>  
>


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