You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Shing Hing Man <ma...@yahoo.com> on 2010/04/18 17:15:16 UTC

Embedded Tapestry DateField is rendered when Tapx DataField component is used in template

Originally, I have a Tapestry5 DateField component in a page tml and it  is also specified in the corresponding 
page Java class.

tml file :

  <t:DateField t:id="startDate"  validate="required" 
                      format="literal:dd MMM yyyy" value="bean.startDate" style="width:7em" />

Java class:
@Component
	private DateField startDate; // DateField from tapestry 5 corelib package
	
	
When I switch to using the DateField component from Tapx 
(http://tapestry.formos.com/nightly/tapx/tapx-datefield/ ),
I only changed the namespace of DateField from t to tx in the template, and forgot to
update DateField in the Java class to refer to the one in Tapx package. 

However, the page rendered without error, but with DateField component from Tapestry 5 being rendered.
It has taken me awhile to figure out  it is caused by the embedded DateField component in the page Java class
still referring to the Tapestry 5 DateField component.
   
It would be great if an error message is shown when the namespace of the embedded component 
in the tml is inconsistent with the java package of the embedded component in the page Java class. 

Shing  

	



      

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


Re: Embedded Tapestry DateField is rendered when Tapx DataField component is used in template

Posted by Howard Lewis Ship <hl...@gmail.com>.
This is supposed to be an error given that there are conflicting types
for component (one from the template, one from the Java class). It's
supposed to reject this out right, even if the types agree (which they
don't in this case).  I'm not sure why this no longer works, because I
remember coding this up with a test several years ago.

On Sun, Apr 18, 2010 at 8:15 AM, Shing Hing Man <ma...@yahoo.com> wrote:
> Originally, I have a Tapestry5 DateField component in a page tml and it  is also specified in the corresponding
> page Java class.
>
> tml file :
>
>  <t:DateField t:id="startDate"  validate="required"
>                      format="literal:dd MMM yyyy" value="bean.startDate" style="width:7em" />
>
> Java class:
> @Component
>        private DateField startDate; // DateField from tapestry 5 corelib package
>
>
> When I switch to using the DateField component from Tapx
> (http://tapestry.formos.com/nightly/tapx/tapx-datefield/ ),
> I only changed the namespace of DateField from t to tx in the template, and forgot to
> update DateField in the Java class to refer to the one in Tapx package.
>
> However, the page rendered without error, but with DateField component from Tapestry 5 being rendered.
> It has taken me awhile to figure out  it is caused by the embedded DateField component in the page Java class
> still referring to the Tapestry 5 DateField component.
>
> It would be great if an error message is shown when the namespace of the embedded component
> in the tml is inconsistent with the java package of the embedded component in the page Java class.
>
> Shing
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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