On 26 Jun 2008, at 23:31, Geoff Callender wrote:

Are you sure?  What about...
<span t:type="output" value="student.grade">A</span>

The core Output component in T5 has a required format parameter, so the above will throw an exception. The Output component is useful for things like dates and interpolating values into messages, but a slightly bigger beast than I was talking about. I have a simpler Text component of my own but felt that at some stage I'll probably rip out all occurrences and replace with whatever the core T5 equivalent is.

Really there are 3 styles and I think the doco has slipped up on them. Weren't these the terms being used a while back...

- Components as elements, eg. <t:pagelink page="Index">Home</ t:pagelink> - Embedded components, eg. <a t:type="pagelink" t:page="Index" href="#">Home</a>
- Invisible instrumentation, eg.  <a t:id="index" href="#">Home</a>
        with
        @Component(id = "index", parameters = {"page=Index"})
        @SuppressWarnings("unused")
        private PageLink _index;

I don't recall this three-way split being introduced. In fact, the second and third are, to my understanding, both examples of what has been termed "invisible instrumentation". You can add just a t:id or just a t:type or you can add both. In cases where you have added a t:id without the t:type, you must include the annotated field in the page class.

But really, my point here was to that I think the terminology needs to be improved, to help newcomers get to grips with the framework more quickly. (There's nothing like a slightly inaccurate piece of terminology to cause newbies to hit roadblocks.) I would contend that the above three terms are all quite poor: "Components as elements". Well, all components correspond to some element in the template, so this isn't being specific at all. The issue is whether they're Tapestry elements or HTML elements. "Embedded components". Embedded in what? The template? Then ditto as to the previous point. "Invisible instrumentation". As I pointed out in my previous post, both techniques for instrumenting a Tapestry template are invisible in a rendered browser view, so this is again a bad piece of terminology.

I think that the Component Templates page in the User's Guide could do with a re-write to reflect the two possible ways of instrumenting a template:
(i) Adding Tapestry elements
(ii) Adding attributes to HTML elements
These two terms are the best I can come up with to express the fact that there are two ways of doing it. (Maybe someone can be more succinct and accurate.) Also, I think this should be near the top of the Component Templates page, rather than explaining templates in terms of Tapestry elements and then have a quick "oh, by the way, there's also another way of doing it..." near the bottom. I'd be happy to contribute a draft.

Don.
This message has been scanned for content and viruses by the DIT Information 
Services E-Mail Scanning Service, and is believed to be clean. http://www.dit.ie

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to