You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vjeran Marcinko <vj...@tis.hr> on 2005/05/11 06:20:52 UTC

Default binding recap [WAS: 4.0: listeners]

Hi all.

I posted about this recently on dev list, but I think I know how to express
myself better now...

Anyway, in 4.0 we now have multiple choices :
1. listener="ognl:listeners.formSubmit"
2. listener="listeners:formSubmit"
3. listener="formSubmit"

First one is 3.0 compatibile, second and third have apeared in 4.0, and
beside being shorter, they also use reflection less, thus are probably a bit
faster.
IMHO, although the shortest, problematic is third one.
Why? Because it is the only one that is not self-descriptive. I requires you
to switch to .jwc file to know what type of value that is. True, nobody
forces me to use that style, but thing is that I won't be looking only at
things developed by myself, but also at other's stuff, and that will force
me to switch files.

And I think that "listener" example isn't a good one, because whenever we
see parameter called "listener", it's a kinda standardized name, and we all
know it's a listener parameter, thus default binding has much more sense for
that than normally.
Let's say you have stumbled upon some .html developed by your co-worker who
loves default bindings, and all you see is:
<span jwcid="@AttributePresenter" attribute="shortVersion" />
<span jwcid="@Shotter" character="simple" value="parent" />

And although you remember these AttributePresenter and Shotter components
because you worked with them 3 weeks ago, you cannot exactly remember now
what types of parameters these attribute/character/value are, and you forced
to look at their .jwc files :-(

Regards,
Vjeran

----- Original Message ----- 
From: "Howard Lewis Ship" <hl...@gmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, May 10, 2005 11:15 PM
Subject: Re: 4.0: listeners


In the old DTD, there was <binding name="..." expression="..."/>

If you are updating the DTDs, you'll have to change <binding>,
<static-binding>, <message-binding>, <inherited-binding> to the new,
simple <binding>

You get to use the same prefixing in the XML file that is used in the
HTML.  Consistency!

But if you go to the trouble of changing your XML files and using the
4.0 DTDs, you have to be aware that the <binding> value attribute is
interpreted differently than the 3.0 <binding> expression attribute.

On 5/10/05, Patrick Casey <pa...@adelphia.net> wrote:
>
>         Didn't "listeners.formSubmitted" work in 3.0 though?
>
>         So in 3.0:
>
>         <binding name="listener" value="listeners.formSubmitted"/>
>         <binding name="listener" value="ognl:listeners.formSubmitted"/>
>
>         Both worked.
>
>         In 4.0:
>
>         <binding name="listener" value="formSubmitted"/>
>         <binding name="listener" value="ognl:listeners.formSubmitted"/>
>
>         So unless I'm misunderstanding this change, we deprecated one of
two
> 3.0 formats, and introduced one new one. So if you happened to use the old
> format (listneres.formSubmitted) and upgraded to 4.0 it'd stop working,
> wouldn't it?



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 10.5.2005


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


Message, format and single quotes

Posted by Oscar Picasso <os...@yahoo.com>.
Hi

I have a problem with formatting text and single quotes.

Lets's say I have the following property file:

username = nom d'utilisateur
required = Le champ {0} est requis

In my validator bean specification I have: 
<set-property name="requiredMessage" 
              expression="format('required', getMessage('username'))"/>

In the html file:
<label for="username"><span jwcid="@FieldLabel"
field="ognl:components.username"/></label>
<input jwcid="username@ValidField" displayName="message:username" 
       validator="ognl:beans.usernameValidator" value="ognl:user.username"/>

The error message is then:
Le champ nom dutilisateur est requis
[single quote removed]

and the label:
nom d'utilisateur
[correct]

Any idea ?

I have tried to add a single quote:
username = nom d''utilisateur

I then get:

error message -> Le champ nom d'utilisateur est requis
label -> nom d''utilisateur


Thanks


Oscar


	
		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail

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


Re: Default binding recap [WAS: 4.0: listeners]

Posted by Vjeran Marcinko <vj...@tis.hr>.
----- Original Message ----- 
From: "Howard Lewis Ship" <hl...@gmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, May 11, 2005 1:23 PM
Subject: Re: Default binding recap [WAS: 4.0: listeners]


> I see this as like the split between implicit and declared components.
> Implicit components open up the possiblity of a lot of absuses and
> people were initially worried. Once they started building apps with
> implicit components, they set individual standards and practices for
> when to use implicit vs. when to use declared.

Yes Howard, I thought about the same thing. That's my hope about default
parameter types, that my hunch will turn out wrong.
Because, if I was subscribed to mailing list when implicit components were
being discussed about, I would probably be against it, because it really
looks much more dirty then declared components. When using declared
components, you are not confused with informal parameters, and since
.page/.jwc file often already contains some meta about page/component, why
make possibility to users for defining components outside of it. So I guess
I would definetly be against that.

BUT, in practice, it turned out that implicit components saved plenty of
switching between .html and .page, that I really consider other way only in
rare cases. Shame on me :-(

-Vjeran



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 10.5.2005


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


Re: Default binding recap [WAS: 4.0: listeners]

Posted by Howard Lewis Ship <hl...@gmail.com>.
I see this as like the split between implicit and declared components.
 Implicit components open up the possiblity of a lot of absuses and
people were initially worried. Once they started building apps with
implicit components, they set individual standards and practices for
when to use implicit vs. when to use declared.

The practice for default bindings will be the same.

Basically, there has to be a compelling reason *not* to use ognl as
the default binding. In fact, there has to be a compelling reason to
specify a default binding.

In only a few cases, the default binding should not be ognl (or
unspecified).  Listener parameters, validator parameters, asset
parameters. I think those will tend to be obvious and your nightmare
scenario won't happen.

On 5/11/05, Patrick Casey <pa...@adelphia.net> wrote:
> 
>         I don't have quite as much to say on the subject, but I will chime
> in to say I'm not a big fan of default binding either. I know what I was
> learning tapestry it was very confusing to figure out whether I should be
> typing "ognl:foo" or just plain "foo" and whether just plain foo was going
> to be parsed or a literal.
> 
>         I don't really mind typing an extra five characters if it makes my
> code more consistent and readable, so I at least would rather that ognl
> always meant ognl, and a literal always be a literal. For me, having these
> sorts of context specific behaviors just makes the product harder to learn
> and harder to debug later for no real benefit (does skipping 5 characters
> while typing *really* make much of a difference in the grand scheme of
> things? If so, shouldn't we all use single character variable names
> exclusively?)
> 
>         I guess I did have something to say on the topic after all ...
> 
>         --- Pat
> 
> > -----Original Message-----
> > From: Vjeran Marcinko [mailto:vjeran@tis.hr]
> > Sent: Tuesday, May 10, 2005 9:21 PM
> > To: Tapestry users; Howard Lewis Ship
> > Subject: Default binding recap [WAS: 4.0: listeners]
> >
> > Hi all.
> >
> > I posted about this recently on dev list, but I think I know how to
> > express
> > myself better now...
> >
> > Anyway, in 4.0 we now have multiple choices :
> > 1. listener="ognl:listeners.formSubmit"
> > 2. listener="listeners:formSubmit"
> > 3. listener="formSubmit"
> >
> > First one is 3.0 compatibile, second and third have apeared in 4.0, and
> > beside being shorter, they also use reflection less, thus are probably a
> > bit
> > faster.
> > IMHO, although the shortest, problematic is third one.
> > Why? Because it is the only one that is not self-descriptive. I requires
> > you
> > to switch to .jwc file to know what type of value that is. True, nobody
> > forces me to use that style, but thing is that I won't be looking only at
> > things developed by myself, but also at other's stuff, and that will force
> > me to switch files.
> >
> > And I think that "listener" example isn't a good one, because whenever we
> > see parameter called "listener", it's a kinda standardized name, and we
> > all
> > know it's a listener parameter, thus default binding has much more sense
> > for
> > that than normally.
> > Let's say you have stumbled upon some .html developed by your co-worker
> > who
> > loves default bindings, and all you see is:
> > <span jwcid="@AttributePresenter" attribute="shortVersion" />
> > <span jwcid="@Shotter" character="simple" value="parent" />
> >
> > And although you remember these AttributePresenter and Shotter components
> > because you worked with them 3 weeks ago, you cannot exactly remember now
> > what types of parameters these attribute/character/value are, and you
> > forced
> > to look at their .jwc files :-(
> >
> > Regards,
> > Vjeran
> >
> <snip>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

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

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


RE: Default binding recap [WAS: 4.0: listeners]

Posted by Patrick Casey <pa...@adelphia.net>.
	I don't have quite as much to say on the subject, but I will chime
in to say I'm not a big fan of default binding either. I know what I was
learning tapestry it was very confusing to figure out whether I should be
typing "ognl:foo" or just plain "foo" and whether just plain foo was going
to be parsed or a literal.

	I don't really mind typing an extra five characters if it makes my
code more consistent and readable, so I at least would rather that ognl
always meant ognl, and a literal always be a literal. For me, having these
sorts of context specific behaviors just makes the product harder to learn
and harder to debug later for no real benefit (does skipping 5 characters
while typing *really* make much of a difference in the grand scheme of
things? If so, shouldn't we all use single character variable names
exclusively?)
	
	I guess I did have something to say on the topic after all ...

	--- Pat

> -----Original Message-----
> From: Vjeran Marcinko [mailto:vjeran@tis.hr]
> Sent: Tuesday, May 10, 2005 9:21 PM
> To: Tapestry users; Howard Lewis Ship
> Subject: Default binding recap [WAS: 4.0: listeners]
> 
> Hi all.
> 
> I posted about this recently on dev list, but I think I know how to
> express
> myself better now...
> 
> Anyway, in 4.0 we now have multiple choices :
> 1. listener="ognl:listeners.formSubmit"
> 2. listener="listeners:formSubmit"
> 3. listener="formSubmit"
> 
> First one is 3.0 compatibile, second and third have apeared in 4.0, and
> beside being shorter, they also use reflection less, thus are probably a
> bit
> faster.
> IMHO, although the shortest, problematic is third one.
> Why? Because it is the only one that is not self-descriptive. I requires
> you
> to switch to .jwc file to know what type of value that is. True, nobody
> forces me to use that style, but thing is that I won't be looking only at
> things developed by myself, but also at other's stuff, and that will force
> me to switch files.
> 
> And I think that "listener" example isn't a good one, because whenever we
> see parameter called "listener", it's a kinda standardized name, and we
> all
> know it's a listener parameter, thus default binding has much more sense
> for
> that than normally.
> Let's say you have stumbled upon some .html developed by your co-worker
> who
> loves default bindings, and all you see is:
> <span jwcid="@AttributePresenter" attribute="shortVersion" />
> <span jwcid="@Shotter" character="simple" value="parent" />
> 
> And although you remember these AttributePresenter and Shotter components
> because you worked with them 3 weeks ago, you cannot exactly remember now
> what types of parameters these attribute/character/value are, and you
> forced
> to look at their .jwc files :-(
> 
> Regards,
> Vjeran
> 
<snip>



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