You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vinicius Carvalho <ja...@gmail.com> on 2006/08/09 20:14:05 UTC
Creating a dateTime component
Hello there folks. I need to create a datetime component composed of
textfields and selects (text for hours, and selects for
days/months/years).
What's really tricking me is how can I be able to convert 5 fields
into a date object? My first Idea was to create a
AbstractFormComponent and user the writer to write everything, but it
occurred to me that use a html template like this:
<input jwcid="day@PropertySelection" model="daysInMonth"/> <input
jwcid="month@PropertySelection" model="monthsInYear"/> <input
jwcid="year@PropertySelection" model="years"/> <input
jwcid="hour@TextField"/> <input jwcid="minutes@TextField"/>
And on my component I'd provide the models for everything. But how to
bind 5 fields into one object?
Could someone point me the directions, I promise as soon I finish it
I'll post it here, I believe its an good addition to the framework (if
it don't stinks too much).
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Creating a dateTime component
Posted by an...@di.uoa.gr.
Αρχικό μήνυμα από Vinicius Carvalho <ja...@gmail.com>:
> Hello there folks. I need to create a datetime component composed of
> textfields and selects (text for hours, and selects for
> days/months/years).
> What's really tricking me is how can I be able to convert 5 fields
> into a date object? My first Idea was to create a
> AbstractFormComponent and user the writer to write everything, but it
> occurred to me that use a html template like this:
>
> <input jwcid="day@PropertySelection" model="daysInMonth"/> <input
> jwcid="month@PropertySelection" model="monthsInYear"/> <input
> jwcid="year@PropertySelection" model="years"/> <input
> jwcid="hour@TextField"/> <input jwcid="minutes@TextField"/>
>
> And on my component I'd provide the models for everything. But how to
> bind 5 fields into one object?
Bind them to 5 objects.
Then add a "date" parameter to your component.
On render, read the date parameter and 'extract' the values
that those 5 objects should have.
On rewind, read the 5 objects and use them to update the
date parameter.
Tapestry In Action contains a similar example ... a credit card
component is created from 4 textfields.
>
> Could someone point me the directions, I promise as soon I finish it
> I'll post it here, I believe its an good addition to the framework (if
> it don't stinks too much).
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org