You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jim Menard <ji...@io.com> on 2004/02/25 17:30:32 UTC

message-binding

Based on previous help, I'm trying to use message-binding to localize 
the name of a ValidField. Here's what I'm trying:

   <bean name="usernameValidator"
         class="org.apache.tapestry.valid.StringValidator">
     <set-property name="required" expression="true"/>
     <set-property name="maximum" expression="255"/>
   </bean>

   <component id="username" type="ValidField">
     <binding name="value" expression="member.username"/>
     <binding name="validator" expression="beans.usernameValidator"/>
     <message-binding name="displayName" key="username"/>
   </component>

The error I see is

	Element "component" does not allow "message-binding" here.

Where do I put the message-binding so that the name of the field gets 
set from the .properties file?

Thanks for any suggestions you may have.

Jim
-- 
Jim Menard, jimm@io.com, http://www.io.com/~jimm/
"I used to have a Heisenbergmobile. Every time I looked at the 
speedometer, I got lost." -- Critical Path in alt.geek


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


Re: message-binding

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 25, 2004, at 11:30 AM, Jim Menard wrote:
>   <component id="username" type="ValidField">
>     <binding name="value" expression="member.username"/>
>     <binding name="validator" expression="beans.usernameValidator"/>
>     <message-binding name="displayName" key="username"/>
>   </component>
>
> The error I see is
>
> 	Element "component" does not allow "message-binding" here.
>
> Where do I put the message-binding so that the name of the field gets 
> set from the .properties file?

This looks correct.  Is there possibly more information in the error 
message that is relevant?  I don't see the string "does not all" in 
Tapestry's codebase.  Is it an XML parsing error?

	Erik


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


Re: message-binding

Posted by Jim Menard <ji...@io.com>.
On Feb 25, 2004, at 12:20 PM, Howard M. Lewis Ship wrote:

> The key thing is to change the public ID, the URL is ignored.
>
> <!DOCTYPE page-specification PUBLIC
>   "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
>   "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">

That did it. It forced me to update all of my .page and .jwc files too, 
changing things like component-alias to component-type and java-type to 
java.

I feel so modern, fresh, and clean now :-)

Thank you, everyone.

Jim
-- 
Jim Menard, jimm@io.com, http://www.io.com/~jimm/
"The 'inverse Dilbert correlation factor'--the more Dilbert cartoons 
pasted
on office doors and bulletin boards, the less well off the project is."
     -- Yourdon, "Death March"


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


RE: message-binding

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
The key thing is to change the public ID, the URL is ignored.

<!DOCTYPE page-specification PUBLIC 
  "-//Apache Software Foundation//Tapestry Specification 3.0//EN" 
  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">


--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components 
http://howardlewisship.com


> -----Original Message-----
> From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net] 
> Sent: Wednesday, February 25, 2004 12:14 PM
> To: Tapestry users
> Subject: Re: message-binding
> 
> 
> 
> 
> Jim Menard wrote:
> 
> > On Feb 25, 2004, at 11:45 AM, Howard M. Lewis Ship wrote:
> >
> >> Make sure you are using the 3.0 DTD (check the DOCTYPE). 
> Chances are, 
> >> you are using a 1.X DTD, where
> >> the element was <string-binding>.
> >
> >
> > Indeed, I was using
> >
> >     http://tapestry.sf.net/dtd/Tapestry_1_3.dtd
> >
> > instead of
> >
> >     http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd
> >
> > When I changed the DTD on just that page, I still saw the error
> >
> >     Element "component" does not allow "message-binding" here.
> >
> > I have the sneaking suspicion that I have to change the same DTD in 
> > all my pages (the user hits the home page first, which 
> still uses the 
> > old DTD). Do I have to update every page first? (I plan to; 
> I'm just 
> > asking before I make a sweeping change.)
> >
> > It looks like Tapestry may use the first DTD it sees instead of 
> > reading different DTDs from differnet pages. Is that the 
> case? Should 
> > that be changed, or is that desirable behavior? You might 
> want to read 
> > the different DTDs, caching them as you go along, of course.
> 
> Hope you will agree that running parts of applications under 
> different 
> versions of the framework is a horrible idea ;)
> 
> -Harish
> 
> >
> > Jim
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


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


Re: message-binding

Posted by Harish Krishnaswamy <hk...@comcast.net>.

Jim Menard wrote:

> On Feb 25, 2004, at 11:45 AM, Howard M. Lewis Ship wrote:
>
>> Make sure you are using the 3.0 DTD (check the DOCTYPE). Chances are, 
>> you are using a 1.X DTD, where
>> the element was <string-binding>.
>
>
> Indeed, I was using
>
>     http://tapestry.sf.net/dtd/Tapestry_1_3.dtd
>
> instead of
>
>     http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd
>
> When I changed the DTD on just that page, I still saw the error
>
>     Element "component" does not allow "message-binding" here.
>
> I have the sneaking suspicion that I have to change the same DTD in 
> all my pages (the user hits the home page first, which still uses the 
> old DTD). Do I have to update every page first? (I plan to; I'm just 
> asking before I make a sweeping change.)
>
> It looks like Tapestry may use the first DTD it sees instead of 
> reading different DTDs from differnet pages. Is that the case? Should 
> that be changed, or is that desirable behavior? You might want to read 
> the different DTDs, caching them as you go along, of course.

Hope you will agree that running parts of applications under different 
versions of the framework is a horrible idea ;)

-Harish

>
> Jim


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


Re: message-binding

Posted by Jim Menard <ji...@io.com>.
On Feb 25, 2004, at 11:45 AM, Howard M. Lewis Ship wrote:

> Make sure you are using the 3.0 DTD (check the DOCTYPE). Chances are, 
> you are using a 1.X DTD, where
> the element was <string-binding>.

Indeed, I was using

	http://tapestry.sf.net/dtd/Tapestry_1_3.dtd

instead of

	http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd

When I changed the DTD on just that page, I still saw the error

	Element "component" does not allow "message-binding" here.

I have the sneaking suspicion that I have to change the same DTD in all 
my pages (the user hits the home page first, which still uses the old 
DTD). Do I have to update every page first? (I plan to; I'm just asking 
before I make a sweeping change.)

It looks like Tapestry may use the first DTD it sees instead of reading 
different DTDs from differnet pages. Is that the case? Should that be 
changed, or is that desirable behavior? You might want to read the 
different DTDs, caching them as you go along, of course.

Jim
-- 
Jim Menard, jimm@io.com, http://www.io.com/~jimm/
"Dvorak users of the world flgkd!" -- Kirsten Chevalier in 
rec.humor.oracle.d


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


RE: message-binding

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Make sure you are using the 3.0 DTD (check the DOCTYPE). Chances are, you are using a 1.X DTD, where
the element was <string-binding>.

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components 
http://howardlewisship.com


> -----Original Message-----
> From: Jim Menard [mailto:jimm@io.com] 
> Sent: Wednesday, February 25, 2004 11:31 AM
> To: Tapestry users
> Subject: message-binding
> 
> 
> Based on previous help, I'm trying to use message-binding to localize 
> the name of a ValidField. Here's what I'm trying:
> 
>    <bean name="usernameValidator"
>          class="org.apache.tapestry.valid.StringValidator">
>      <set-property name="required" expression="true"/>
>      <set-property name="maximum" expression="255"/>
>    </bean>
> 
>    <component id="username" type="ValidField">
>      <binding name="value" expression="member.username"/>
>      <binding name="validator" expression="beans.usernameValidator"/>
>      <message-binding name="displayName" key="username"/>
>    </component>
> 
> The error I see is
> 
> 	Element "component" does not allow "message-binding" here.
> 
> Where do I put the message-binding so that the name of the field gets 
> set from the .properties file?
> 
> Thanks for any suggestions you may have.
> 
> Jim
> -- 
> Jim Menard, jimm@io.com, http://www.io.com/~jimm/
> "I used to have a Heisenbergmobile. Every time I looked at the 
> speedometer, I got lost." -- Critical Path in alt.geek
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


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