You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Maarten Billemont (JIRA)" <ji...@apache.org> on 2009/12/29 11:58:29 UTC
[jira] Created: (WICKET-2650) Consistently create body for short
tags.
Consistently create body for short tags.
----------------------------------------
Key: WICKET-2650
URL: https://issues.apache.org/jira/browse/WICKET-2650
Project: Wicket
Issue Type: Bug
Components: wicket
Affects Versions: 1.4.0
Reporter: Maarten Billemont
When the Wicket HTML contains a tag such as <a wicket:id="foo" /> and the component bound to that tag uses replaceComponentTagBody to write a string to the tag's body, currently nothing happens.
Either a text node should be added to the component tag and the body written to it;
Or a warning/exception should occur if for some reason it is preferred to not let this method succeed when the component tag has no body yet.
I don't see the use of the latter, so I recommend the former be implemented.
For now it's just confusing and dangerous. If I give my HTML to a web designed and he changes a few empty HTML tags to short tags, I'll never be warned, but my output WILL be broken.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2650) Consistently create body for short
tags.
Posted by "Maarten Billemont (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836890#action_12836890 ]
Maarten Billemont commented on WICKET-2650:
-------------------------------------------
So; what is the reason to not add this one automatically? I see a lot of benefit from it and not sure I can see any reason why it would be disadvantageous.
> Consistently create body for short tags.
> ----------------------------------------
>
> Key: WICKET-2650
> URL: https://issues.apache.org/jira/browse/WICKET-2650
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.4.0
> Reporter: Maarten Billemont
> Assignee: Juergen Donnerstag
> Fix For: 1.4.6, 1.5-M1
>
>
> When the Wicket HTML contains a tag such as <a wicket:id="foo" /> and the component bound to that tag uses replaceComponentTagBody to write a string to the tag's body, currently nothing happens.
> Either a text node should be added to the component tag and the body written to it;
> Or a warning/exception should occur if for some reason it is preferred to not let this method succeed when the component tag has no body yet.
> I don't see the use of the latter, so I recommend the former be implemented.
> For now it's just confusing and dangerous. If I give my HTML to a web designed and he changes a few empty HTML tags to short tags, I'll never be warned, but my output WILL be broken.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2650) Consistently create body for short
tags.
Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795039#action_12795039 ]
Juergen Donnerstag commented on WICKET-2650:
--------------------------------------------
It is not that simple.
1) Obviously open/close tags are perfectly valid.
2) We check the tag and if it is open than we render the body - whatever that body is and which ever way the user wants to do it.
How shall Wicket know upfornt that you'll be rendering the body yourself? Without a better reason I'm not in favor to switch to "always render the body and than based on the text generate determine what to do...".
Some Components require a body text and thus accept open/close tags which the Component itself manually changes via subclassing onComponentTagBody.
If you want ALL your wicket tags to have a body, simply create a filter and add it to your application. You may copy and modify OpenCloseTagExpander for that purpose
I can imagine there are specific use cases (like <a wicket:id= >/) currently not automatically covered by Wicket and I'm more than open to adjust any of the existing filters or add a new one. But I'm -1 on changing all <xxx wicket:id= ../> to open-body-close.
May be you can provide a filter implementation which implements these use cases and I'm more than happy to take a look.
BTW, via the filter you can implement both: automatically change open-close to open-body-close, throw an exception or log a warning.
> Consistently create body for short tags.
> ----------------------------------------
>
> Key: WICKET-2650
> URL: https://issues.apache.org/jira/browse/WICKET-2650
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.4.0
> Reporter: Maarten Billemont
>
> When the Wicket HTML contains a tag such as <a wicket:id="foo" /> and the component bound to that tag uses replaceComponentTagBody to write a string to the tag's body, currently nothing happens.
> Either a text node should be added to the component tag and the body written to it;
> Or a warning/exception should occur if for some reason it is preferred to not let this method succeed when the component tag has no body yet.
> I don't see the use of the latter, so I recommend the former be implemented.
> For now it's just confusing and dangerous. If I give my HTML to a web designed and he changes a few empty HTML tags to short tags, I'll never be warned, but my output WILL be broken.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-2650) Consistently create body for short
tags.
Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2650?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Juergen Donnerstag resolved WICKET-2650.
----------------------------------------
Resolution: Fixed
Fix Version/s: 1.5-M1
1.4.6
Assignee: Juergen Donnerstag
Added ExtendedOpenCloseTagExpander to core which is NOT automatically added. Please see the javadocs for how to do it.
> Consistently create body for short tags.
> ----------------------------------------
>
> Key: WICKET-2650
> URL: https://issues.apache.org/jira/browse/WICKET-2650
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.4.0
> Reporter: Maarten Billemont
> Assignee: Juergen Donnerstag
> Fix For: 1.4.6, 1.5-M1
>
>
> When the Wicket HTML contains a tag such as <a wicket:id="foo" /> and the component bound to that tag uses replaceComponentTagBody to write a string to the tag's body, currently nothing happens.
> Either a text node should be added to the component tag and the body written to it;
> Or a warning/exception should occur if for some reason it is preferred to not let this method succeed when the component tag has no body yet.
> I don't see the use of the latter, so I recommend the former be implemented.
> For now it's just confusing and dangerous. If I give my HTML to a web designed and he changes a few empty HTML tags to short tags, I'll never be warned, but my output WILL be broken.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2650) Consistently create body for short
tags.
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12837557#action_12837557 ]
Igor Vaynberg commented on WICKET-2650:
---------------------------------------
we cannot change the behavior in wicket-1.4.x but in trunk i changed the default to work like extended
> Consistently create body for short tags.
> ----------------------------------------
>
> Key: WICKET-2650
> URL: https://issues.apache.org/jira/browse/WICKET-2650
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.4.0
> Reporter: Maarten Billemont
> Assignee: Juergen Donnerstag
> Fix For: 1.4.6, 1.5-M1
>
>
> When the Wicket HTML contains a tag such as <a wicket:id="foo" /> and the component bound to that tag uses replaceComponentTagBody to write a string to the tag's body, currently nothing happens.
> Either a text node should be added to the component tag and the body written to it;
> Or a warning/exception should occur if for some reason it is preferred to not let this method succeed when the component tag has no body yet.
> I don't see the use of the latter, so I recommend the former be implemented.
> For now it's just confusing and dangerous. If I give my HTML to a web designed and he changes a few empty HTML tags to short tags, I'll never be warned, but my output WILL be broken.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2650) Consistently create body for short
tags.
Posted by "Maarten Billemont (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795036#action_12795036 ]
Maarten Billemont commented on WICKET-2650:
-------------------------------------------
I believe the short tag is already expanded for certain components/tags, such as div/span? Either way; this should be consistent across all of the tag handling and be taken out where it exists currently.
> Consistently create body for short tags.
> ----------------------------------------
>
> Key: WICKET-2650
> URL: https://issues.apache.org/jira/browse/WICKET-2650
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.4.0
> Reporter: Maarten Billemont
>
> When the Wicket HTML contains a tag such as <a wicket:id="foo" /> and the component bound to that tag uses replaceComponentTagBody to write a string to the tag's body, currently nothing happens.
> Either a text node should be added to the component tag and the body written to it;
> Or a warning/exception should occur if for some reason it is preferred to not let this method succeed when the component tag has no body yet.
> I don't see the use of the latter, so I recommend the former be implemented.
> For now it's just confusing and dangerous. If I give my HTML to a web designed and he changes a few empty HTML tags to short tags, I'll never be warned, but my output WILL be broken.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2650) Consistently create body for short
tags.
Posted by "Maarten Billemont (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795266#action_12795266 ]
Maarten Billemont commented on WICKET-2650:
-------------------------------------------
Hmm; I hadn't seen OpenCloseTagExpander yet. Interesting approach; but appears to be lacking a few tags.
Perhaps we should just add all HTML elements which are designed to have a body to it, such as:
a, q, sub, sup, abbr, acronym, cite, code, del, dfn, em, ins, kbd, samp, var, label, textarea, tr, td, th, caption, thead, tbody, tfoot, dl, dt, dd, li, ol, ul, h1-6, pre, title
For these elements, there is no advantage whatsoever to keeping them open/close rather than open/body/close, while there is advantage to converting them to open/body/close. In that light I don't see why we should not do this.
Currently, OpenCloseTagExpander seems like a nice but very incomplete filter. The approach it takes is one to change a set of tags, but there is no logic or consistency behind what tags are in the set.
> Consistently create body for short tags.
> ----------------------------------------
>
> Key: WICKET-2650
> URL: https://issues.apache.org/jira/browse/WICKET-2650
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.4.0
> Reporter: Maarten Billemont
>
> When the Wicket HTML contains a tag such as <a wicket:id="foo" /> and the component bound to that tag uses replaceComponentTagBody to write a string to the tag's body, currently nothing happens.
> Either a text node should be added to the component tag and the body written to it;
> Or a warning/exception should occur if for some reason it is preferred to not let this method succeed when the component tag has no body yet.
> I don't see the use of the latter, so I recommend the former be implemented.
> For now it's just confusing and dangerous. If I give my HTML to a web designed and he changes a few empty HTML tags to short tags, I'll never be warned, but my output WILL be broken.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-2650) Consistently create body for short
tags.
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795257#action_12795257 ]
Martin Grigorov commented on WICKET-2650:
-----------------------------------------
As far as I remember expanding of div and span was added to overcome a bug in Firefox (maybe version 2.x). So Wicket is trying to help the user here.
I don't agree that Wicket should fix developer/webdesigner errors, like <a href="" ... />. Especially I don't want to see any of my <img /> or <input /> expanded.
There are helper utils in Wicket like devutils' Filter for <img src="" /> (image empty source location) which are there to help me and extending them to warn me about my coding mistakes would be great.
> Consistently create body for short tags.
> ----------------------------------------
>
> Key: WICKET-2650
> URL: https://issues.apache.org/jira/browse/WICKET-2650
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.4.0
> Reporter: Maarten Billemont
>
> When the Wicket HTML contains a tag such as <a wicket:id="foo" /> and the component bound to that tag uses replaceComponentTagBody to write a string to the tag's body, currently nothing happens.
> Either a text node should be added to the component tag and the body written to it;
> Or a warning/exception should occur if for some reason it is preferred to not let this method succeed when the component tag has no body yet.
> I don't see the use of the latter, so I recommend the former be implemented.
> For now it's just confusing and dangerous. If I give my HTML to a web designed and he changes a few empty HTML tags to short tags, I'll never be warned, but my output WILL be broken.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.