Coincidentally we're having the same issues where we're trying to create 
reusable sections of forms as components that we'll use on lots of different 
forms. The information from these components is aggregated into a single value 
object which needs to get back into the parent page. For example, a date input 
component with day, month & year select boxes. The parent is only interested in 
a Date object which we want to be a bound parameter which works both ways.

The only way I've found to get this working so far is to inject the component 
and use a getter in the form submission event handler. Binding a parameter 
doesn't seem to work, because the properties updated within the component are 
not bound parameters and the bound parameter is never updated directly. I could 
update it for each of the properties, but I don't really want to do this as 
many times as I have properties that make up the single value object parameter. 
If the order that the properties are updated is predictable in some way, I 
could make the last setter called update the parameter.

I hope this makes sense, and makes the crux of this issue clear.

Andy.

> -----Original Message-----
> From: Jonathan Barker [mailto:[EMAIL PROTECTED]
> Sent: 07 October 2008 21:18
> To: 'Tapestry users'
> Subject: RE: Treating a Component Like a Form Field
>
>
> Yup, completely.
>
> This is just an issue of getting @Parameter working properly then.  I
> defer
> to Thiago.
>
> Jonathan
>
>
> > -----Original Message-----
> > From: Keith Bottner [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, October 07, 2008 15:42
> > To: Tapestry users
> > Subject: Re: Treating a Component Like a Form Field
> >
> > Jonathan,
> >
> > Actually I use an underlying select with an Encoder, OptionModel and
> > SelectionModel, I just wrap it all into a single component because it
> > gets used in a number of places and it is easier to set the Encoder,
> > OptionModel and SelectionModel once then to have multiple developers
> > remember what to set each time they want a select control with a list
> > of countries.
> >
> > Make sense?
> >
> >
> > On Oct 7, 2008, at 2:40 PM, Jonathan Barker wrote:
> >
> > > Keith,
> > >
> > > Is there a particular reason that you created a custom component
> for
> > > the
> > > Country selection rather than just using the standard Select
> > > component?  Is
> > > it just that it gets used in a number of places, or was there
> another
> > > reason?
> > >
> > > Jonathan
> > >
> > >
> > >> -----Original Message-----
> > >> From: Keith Bottner [mailto:[EMAIL PROTECTED]
> > >> Sent: Tuesday, October 07, 2008 14:59
> > >> To: Tapestry users
> > >> Subject: Re: Treating a Component Like a Form Field
> > >>
> > >> I have used @Parameter before but never like this. I am unsure how
> > >> this would work.
> > >>
> > >> Right now inside of my component I have a field named selection
> and I
> > >> have a public getter and setter so that I can retrieve this value
> > >> from
> > >> within the page that is using the component. I also have a
> @Property
> > >> private Country country in a page that uses the component along
> > >> with a
> > >> @Component( id = "country" ) private CountrySelect countrySelect.
> > >> After submitting the form the only way to retrieve what the user
> > >> selected in the select drop down is to do
> > >> countrySelect.getSelection(). The country field that is in the
> field
> > >> does not get field. What I would like is to be able to NOT include
> > >> the
> > >> CountrySelect and just use the @Property Country country like the
> > >> standard form controls.
> > >>
> > >> With all of that said, I do not see how @Parameter will make a
> > >> difference. Is there some other use then the standard use
> supplying a
> > >> parameter in a component template?
> > >>
> > >> Keith
> > >>
> > >> On Oct 6, 2008, at 5:22 PM, Thiago H. de Paula Figueiredo wrote:
> > >>
> > >>> Em Mon, 06 Oct 2008 18:03:13 -0300, Keith Bottner
> > >>> <[EMAIL PROTECTED]> escreveu:
> > >>>
> > >>>> I created a custom component for displaying a selection list of
> > >>>> countries. However, I have found that the only way for me to
> > >>>> retrieve what the selection is from the component is to declare
> a
> > >>>> @Component to that particular field and then request the value
> > >>>> directly from the component. Is there no way to have a custom
> > >>>> component act like a typical text field and have it assign the
> > >>>> selection to a @Property without having to have a @Component
> > >>>> designator?
> > >>>
> > >>> Have you tried adding a @Parameter to your component? This way,
> you
> > >>> could bind it to page property (or page property property and so
> on
> > >>> recursively).
> > >>>
> > >>> --
> > >>> Thiago H. de Paula Figueiredo
> > >>> Independent Java consultant, developer, and instructor
> > >>> Consultor, desenvolvedor e instrutor em Java
> > >>> http://www.arsmachina.com.br/thiago
> > >>>
> > >>> -----------------------------------------------------------------
> ----
> > >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >>> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>>
> > >>
> > >>
> > >> ------------------------------------------------------------------
> ---
> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > > -------------------------------------------------------------------
> --
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to