You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Donny Nadolny (JIRA)" <ji...@apache.org> on 2010/08/27 02:30:53 UTC

[jira] Updated: (TAP5-1259) When the type of a component in the page class and tml don't match, the tml type is silently ignored

     [ https://issues.apache.org/jira/browse/TAP5-1259?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donny Nadolny updated TAP5-1259:
--------------------------------

    Description: 
When you have a component in the tml with any type, for example:
<input t:type="PasswordField" t:id="password"/>

And you have the component type specified differently in the page class, for example:
	@Component(id = "password")
	private TextField passwordField;

Tapestry will silently ignore the type specified in the tml. In this case, it will create a normal text field, even though it is a password field in the tml.

I think this should be an error if the tml and java have a component with the same id but a different type, or at least generate a warning (maybe with a page verification step when production mode is false), rather than ignoring the type in the tml.


Edit: Tried to attach a full example of this, but it kept giving me an error. Here are the files to reproduce this:
TAP1259.tml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
	<body>
		<t:form id="form">
			<input t:type="PasswordField" t:id="password"/>
		</t:form>
	</body>
</html>

TAP1259.java:
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.corelib.components.TextField;

public class TAP1259 {
	@Component(id = "password")
	private TextField passwordField;
	
	@Property
	private String password;
}

  was:
When you have a component in the tml with any type, for example:
<input t:type="PasswordField" t:id="password"/>

And you have the component type specified differently in the page class, for example:
	@Component(id = "password")
	private TextField passwordField;

Tapestry will silently ignore the type specified in the tml. In this case, it will create a normal text field, even though it is a password field in the tml.

I think this should be an error if the tml and java have a component with the same id but a different type, or at least generate a warning (maybe with a page verification step when production mode is false), rather than ignoring the type in the tml.


> When the type of a component in the page class and tml don't match, the tml type is silently ignored
> ----------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1259
>                 URL: https://issues.apache.org/jira/browse/TAP5-1259
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.2.1, 5.2, 5.1.0.5
>            Reporter: Donny Nadolny
>            Priority: Minor
>
> When you have a component in the tml with any type, for example:
> <input t:type="PasswordField" t:id="password"/>
> And you have the component type specified differently in the page class, for example:
> 	@Component(id = "password")
> 	private TextField passwordField;
> Tapestry will silently ignore the type specified in the tml. In this case, it will create a normal text field, even though it is a password field in the tml.
> I think this should be an error if the tml and java have a component with the same id but a different type, or at least generate a warning (maybe with a page verification step when production mode is false), rather than ignoring the type in the tml.
> Edit: Tried to attach a full example of this, but it kept giving me an error. Here are the files to reproduce this:
> TAP1259.tml:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
> 	<body>
> 		<t:form id="form">
> 			<input t:type="PasswordField" t:id="password"/>
> 		</t:form>
> 	</body>
> </html>
> TAP1259.java:
> import org.apache.tapestry5.annotations.Component;
> import org.apache.tapestry5.annotations.Property;
> import org.apache.tapestry5.corelib.components.TextField;
> public class TAP1259 {
> 	@Component(id = "password")
> 	private TextField passwordField;
> 	
> 	@Property
> 	private String password;
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.