You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "S. Pieper (JIRA)" <ji...@apache.org> on 2014/02/03 13:28:09 UTC
[jira] [Comment Edited] (WICKET-1877) Provide Option to Specify XML
Attribute Name in getDebugSettings().setOutputComponentPath(true);
[ https://issues.apache.org/jira/browse/WICKET-1877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13889437#comment-13889437 ]
S. Pieper edited comment on WICKET-1877 at 2/3/14 12:26 PM:
------------------------------------------------------------
This issue has cropped up in our project because the attribute name "wicket-path" or "wicketpath" is not compliant with html5.
Custom attributes need to start with "data" as in "data-wicket-path"
http://www.w3.org/TR/2010/WD-html5-20101019/elements.html#embedding-custom-non-visible-data-with-the-data-attributes
It would be appreciated if this could be made configurable. It is possible to write a custom implementation of the DebugSettings interface, however, the problem lies in the Component class, where currently the string wicketpath is hardcoded.
If Component could be adapted like this:
{{if (getApplication().getDebugSettings().isOutputComponentPath()) {
String path = getPageRelativePath();
path = path.replace( "_" , "__" );
path = path.replace( ":" , "_" );
tag.put(getApplication().getDebugSettings().getOutputComponentPath() , path);
}
}}
The interface IDebugSettings would need two additional methods:
{{String getOutputComponentPath();}}
{{setOutputComponentPath(boolean enabled,String outputComponentPath);}}
And the implementation of IDebugSettings in the class DebugSettings would of course have to implement these methods and store the outputComponentpath in a field.
This would make it possible to use wicketpath and be html5 compliant.
was (Author: spieper):
This issue has cropped up in our project because the attribute name "wicket-path" or "wicketpath" is not compliant with html5.
Custom attributes need to start with "data" as in "data-wicket-path"
http://www.w3.org/TR/2010/WD-html5-20101019/elements.html#embedding-custom-non-visible-data-with-the-data-attributes
It would be appreciated if this could be made configurable. It is possible to write a custom implementation of the DebugSettings interface, however, the problem lies in the Component class, where currently the string wicketpath is hardcoded.
If Component could be adapted like this:
if (getApplication().getDebugSettings().isOutputComponentPath()) {
String path = getPageRelativePath();
path = path.replace( "_" , "__" );
path = path.replace( ":" , "_" );
tag.put(getApplication().getDebugSettings().getOutputComponentPath() , path);
}
The interface IDebugSettings would need two additional methods:
String getOutputComponentPath();
setOutputComponentPath(boolean enabled,String outputComponentPath);
And the implementation of IDebugSettings in the class DebugSettings would of course have to implement these methods and store the outputComponentpath in a field.
This would make it possible to use wicketpath and be html5 compliant.
> Provide Option to Specify XML Attribute Name in getDebugSettings().setOutputComponentPath(true);
> ---------------------------------------------------------------------------------------------------
>
> Key: WICKET-1877
> URL: https://issues.apache.org/jira/browse/WICKET-1877
> Project: Wicket
> Issue Type: New Feature
> Components: wicket
> Environment: Any
> Reporter: Carlo M. Camerino
> Assignee: Igor Vaynberg
> Priority: Minor
> Fix For: 1.4-RC1
>
>
> Hi ,
> I'm having trouble using selenium because it doesn't recognize the colon (:) character properly.
> I can't use this in my tests. //input[@wicket:path='loginPanel_loginForm_cd'] because XPath Has A hard time recognizing it.
> Can you provide an option say, getDebugSettings.setOutputComponentPath(true, "compname")
> so that it will be easier to test
> Thanks
> Carlo
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)