tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard Lewis Ship" <hls...@gmail.com>
Subject Re: T5: default binding is prop even in template
Date Sat, 13 Jan 2007 04:38:25 GMT
I'm still trying different things with this.

What I'd really like to do is bring back the idea of default binding
prefix PER PARAMETER from Tapestry 4.0 (you know, the idea that got
shot down).  This, combined with component type deduction (i.e.,
<input type="text"> means TextField, even if t:type not specified)
leads to templates like:

<input type="text" t:id="userName" size="30" class="highlight"
onchange="this.form.submit();" validate="required"/>

... just working, which is what I'd like.

With that in place, plus the idea that informal parameters default to
the "literal:" prefix, then I think we have a best of both worlds

We *could* get rid of <t:comp>.  I'd like to keep it around.  From T4:
 If and Loop and a few others would render a tag if the element
parameter was set.  Having <t:comp> AND invisible instrumentation
allows the developer to accomplish the same thing without binding a
parameter repetatively. It also clearly distinguishes between visual
components (TextArea) and non-visual components (an If that doesn't
render an element).

On 1/12/07, Kent Tong <kent@cpttm.org.mo> wrote:
> Hi,
> I noticed that
> > Default to the "prop:" binding prefix for attributes of invisibly instrumented
> > elements (for consistency with <t:comp>).
> This will make it harder to use the Any component as most likely all we
> want is to determine one attribute value at runtime, while everything else
> remains static. Now in order to use the Any component, one has to quote
> all the attribute values.
> It also makes it impossible to write a TemplateRelativeResource component
> as I suggested earlier to take care of previewable images or style sheets:
>   <img src="../images/f.gif" t:type="TemplateRelativeResource"/>
> As now one has to quote the "src":
>   <img src="'../images/f.gif'" t:type="TemplateRelativeResource"/>
> Or you have something better in mind to solve this problem?
> I understand that defaulting to prop is to remain consistent with <t:comp>.
> However, I don't really understand why we need two ways to do the same
> thing (<t:comp> and invisible instrumentation). There seems to more flexibility
> than required. Further, there are two ways to specify parameter bindings (in
> the template or in Java code). Again, why not just standardize on specifying
> the t:id in the template and everything else in Java code? Then we can use
> the Java type in the code to determine t:type and we can use the Java import
> statements to qualify the component types.
> --
> Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org

Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org

View raw message