You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jim O'Callaghan <ji...@peritussolutions.com> on 2010/07/01 10:14:03 UTC

Replacing Date Selector

I have used the jQuery date selector in non-Tapestry projects previously and
would like to use it as the default for my current Tapestry application -
can anyone advise the shortest path to achieving this?  I have already
decorated ClientInfrastructure and jQuery / jQuery UI is visible / usable in
my app.

 

Regards,

Jim.


RE: Replacing Date Selector

Posted by Jim O'Callaghan <jc...@yahoo.co.uk>.
Alejandro,

That's exactly what I am looking for - I'm sure I can adapt it to pull in whatever date library I want - I like the facility in the jQuery date picker to display say three months at a time - it seems much faster to navigate to specific date using it - thanks.

Regards,
Jim.

-----Original Message-----
From: Alejandro Scandroli [mailto:alejandroscandroli@gmail.com] 
Sent: 07 July 2010 00:11
To: Tapestry users
Subject: Re: Replacing Date Selector

Hi Jim

I'm using ChenilleKit's DateTimeField component as a replacement for
the Tapestry's default date component.
To use it as the default editor for all your date properties you just need to:

Create your Editor page:

public class EditBlocks
{

	@Environmental
	@Property(write = false)
	private PropertyEditContext propertyEditContext;

	@Component(parameters = {"value=propertyEditContext.propertyValue",
"label=prop:propertyEditContext.label",
			"clientId=propertyEditContext.propertyid",
"validate=prop:dateFieldValidator"})
	private DateTimeField dateField;

	public FieldValidator getDateFieldValidator()
	{
		return propertyEditContext.getValidator(dateField);
	}


And it's template:

<div xml:space="default"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">

	<t:block id="date">
		<t:label for="dateField"/>
		<input t:id="dateField"/>
	</t:block>

And then contribute your own BeanBlockContribution with the name "date"

	public static void
contributeBeanBlockSource(Configuration<BeanBlockContribution>
configuration)
	{
		configuration.add(new BeanBlockContribution("date", "EditBlocks",
"date", true));

It will override the one used by default.


Is this what you were looking for? or your question was about jQuery's
date component in particular?


Saludos.
Alejandro.

On Thu, Jul 1, 2010 at 10:14 AM, Jim O'Callaghan
<ji...@peritussolutions.com> wrote:
> I have used the jQuery date selector in non-Tapestry projects previously and
> would like to use it as the default for my current Tapestry application -
> can anyone advise the shortest path to achieving this? �I have already
> decorated ClientInfrastructure and jQuery / jQuery UI is visible / usable in
> my app.
>
>
>
> Regards,
>
> Jim.
>
>

---------------------------------------------------------------------
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


Re: Replacing Date Selector

Posted by Alejandro Scandroli <al...@gmail.com>.
Hi Jim

I'm using ChenilleKit's DateTimeField component as a replacement for
the Tapestry's default date component.
To use it as the default editor for all your date properties you just need to:

Create your Editor page:

public class EditBlocks
{

	@Environmental
	@Property(write = false)
	private PropertyEditContext propertyEditContext;

	@Component(parameters = {"value=propertyEditContext.propertyValue",
"label=prop:propertyEditContext.label",
			"clientId=propertyEditContext.propertyid",
"validate=prop:dateFieldValidator"})
	private DateTimeField dateField;

	public FieldValidator getDateFieldValidator()
	{
		return propertyEditContext.getValidator(dateField);
	}


And it's template:

<div xml:space="default"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">

	<t:block id="date">
		<t:label for="dateField"/>
		<input t:id="dateField"/>
	</t:block>

And then contribute your own BeanBlockContribution with the name "date"

	public static void
contributeBeanBlockSource(Configuration<BeanBlockContribution>
configuration)
	{
		configuration.add(new BeanBlockContribution("date", "EditBlocks",
"date", true));

It will override the one used by default.


Is this what you were looking for? or your question was about jQuery's
date component in particular?


Saludos.
Alejandro.

On Thu, Jul 1, 2010 at 10:14 AM, Jim O'Callaghan
<ji...@peritussolutions.com> wrote:
> I have used the jQuery date selector in non-Tapestry projects previously and
> would like to use it as the default for my current Tapestry application -
> can anyone advise the shortest path to achieving this?  I have already
> decorated ClientInfrastructure and jQuery / jQuery UI is visible / usable in
> my app.
>
>
>
> Regards,
>
> Jim.
>
>

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