Okay, that makes sense.  If I define a component via @Component and refer to it 
in the template using t:id, then the template will use my defined component.  
Otherwise, the template will create an anonymous component.  Is that right?

The beaneditform variable in my example didn't do anything but show the 
problem, but in real life I'm using it to report validation errors:

    void onValidate() {
        if (...)
            beaneditform.recordError(messages.get("..."));
    }

What I really want, however, is to be able to mark the particular bad field, 
not just the form as a whole, but I can't find a way to get a reference to the 
fields created by the BeanEditForm.  I asked about this before and got no 
answer, which leads me to suspect that there isn't any way to do it yet.  Is 
this something planned for BeanEditForm?

By the way, is there a list of Tapestry5 annotations and what they do?  I 
haven't seen one on the web site or the wiki.

----- Original Message ----
From: Howard Lewis Ship <[EMAIL PROTECTED]>
To: Tapestry users <users@tapestry.apache.org>
Sent: Tuesday, January 8, 2008 7:00:54 PM
Subject: Re: T5: beaneditform component error message


@Component defines a component, it does not inject an existing
component.  You've ended up with two BeanEditForm components, one
named "beaneditform" (from the Java code) and one anonymous (from the
template).  Change the <t:beaneditform> to, say <form
t:id="beaneditform" object="bean"/> ... or (better, for your example),
remove the beaneditform variable.

On Jan 8, 2008 2:38 PM, Franz Amador <[EMAIL PROTECTED]> wrote:
> I'm getting this error in the console:
>
> [ERROR] FormPage Embedded component(s) beaneditform are defined
 within component class com.[...].pages.FormPage, but are not present in the
 component template.
>
> when I have this template:
>
>
>   <head>
>     <title>Form</title>
>   </head>
>   <body>
>     <h1>Form</h1>
>     <t:beaneditform object="bean" />
>   </body>
> </html>
>
> and this page class:
>
> public class FormPage {
>     @Persist
>     private Bean bean;
>     @Component
>     private BeanEditForm beaneditform;
>
> which I presume is coming from the @Component.  The question is: why
 can't it find the beaneditform component?  It sure looks like it's
 there to me.  Does it have some other name?
>
> thanks,
> Franz
>
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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




Reply via email to