RE: little extension of BLink
"Christian Cryder" <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
> >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'm not opposed to this, as these seem pretty standard even though they are not defined in the spec. They're just constants, after all, and they are pretty standard among browsers. Jakes other comments are all more or less valid - BLink (and all Barracuda components for that matter) is really designed as a convenience mechanism to make a variety of underlying markup structures look similar: in this case, a "link". In the case of <a> elements, a target is an important feature, so we added support for it. If there are other elements where it would make sense to support target (or other elements), I'm not opposed to adding functionality there as well. The key ingredient is really just "what is most useful to most developers". So I think the underlying "inconsistency" is probably fine in this case. +1 for me on making these changes (it'll be a bit before I can get to it though)...anyone have any strong objections? Christian ---------------------------------------------- Christian Cryder Internet Architect, ATMReports.com Project Chair, BarracudaMVC - http://barracudamvc.org ---------------------------------------------- "Coffee? I could quit anytime, just not today" > -----Original Message----- > From: [email protected] > [mailto:[email protected]]On Behalf Of Jacob Kjome > Sent: Wednesday, October 29, 2003 1:10 PM > To: [email protected] > Subject: Re: [Barracuda] little extension of BLink > > > 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 > > _______________________________________________ > Barracuda mailing list > [email protected] > http://barracudamvc.org/lists/listinfo/barracuda