Re: little extension of BLink
Jacob Kjome <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Thorsten, At 09:41 AM 10/29/2003 +0100, you wrote: >Hello! > >It would be useful to have some new constants in BLink component for >convenience on get/setTarget(): >public static final String TARGET_BLANK = "_blank"; >public static final String TARGET_PARENT = "_parent"; >public static final String TARGET_SELF = "_self"; >public static final String TARGET_TOP = "_top"; I can kind of see the point of this. However, these values are not defined by the HTML4.01 spec that I can find. They seem to be supported by the various browsers, but are not a standard. In most cases, this use of the target attribute should be replaced with scripting anyway, especially in the case of "_blank" such as... <a href="foo.html" onclick="window.open(this.href);return false;">Foo</a> Also note that the case for having get/setTarget() in BLink is a questionable one. Take note of the examples described (in the Javadoc) for BLink's use; <a>, <input>, and <button>. Now look at what the W3C says where the "target" attribute can be used; <a>, <area>, <base>, <form>, <link>. Notice the absence of <input> and <button> in that list and the inclusion of <form>. So, two of the main cases for using BLink don't allow for using the "target" attribute, even though BLink supports setting it and one of the places that isn't mentioned for using BLink (<form>) suppports the "target" attribute, but it doesn't make sense to get/setText() on a <form>. In fact, the only tag that matches up completely with BLink's full functionality is <a>. With the rest of them, it either doesn't make sense to use get/setText() or get/setTarget(). Well, I suppose it is a compromise to be able to reuse BComponents rather than having a BComponent for every tag, but it does require diligence on the developer's part to keep from generating illegal markup. Anyway, Christian, what do you think about adding these to BLink? I wouldn't oppose it if it is wanted by others on the list, but I also don't see the necessity of it. Jake