You didn't supply a component id, so Tapestry did; your id is
"beaneditform" (matching the type of the component, converted to lower
case).

BeanEditForm is not a Form, but does own one; it includes a getForm()
accessor.  So:

@Component
private BeanEditForm _beanEditForm;  // Case just doesn't matter to Tapestry!

_beanEditForm.getForm().recordError(" . . . ");

On 3/1/07, Terry <[EMAIL PROTECTED]> wrote:

That's what I thought, but when I tried it previously, I just got an
exception:

"Start does not contain an embedded component with id 'form'."

If I look at the source of the page that is generated without the
@Component, I see a form with id=form, so I don't know what is missing.

My page design was lifted directly from the screencast:

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
    <head>
        <title>Start Page</title>
    </head>
    <body>
        <h1>Registration</h1>
        <p>Just one little form to fill in: </p>
        <form t:type="beaneditform" object="userform" submitLabel="Register"
>
                <t:parameter name="password">
                <label t:type="Label" for="password"/>
                <input t:type="PasswordField" t:id="password" 
t:value="userform.password"
size="8"/>
                (Between 4 and 8 characters)
                </t:parameter>
                <t:parameter name="confirmPassword">
                <label t:type="Label" for="confirmPassword"/>
                <input t:type="PasswordField" t:id="confirmPassword"
t:value="userform.confirmPassword" size="8"/>
                </t:parameter>
        </form>

        <p>
            [ refresh ]
        </p>
    </body>
</html>



Howard Lewis Ship wrote:
>
> @Component
> private Form _form;
>
>
> This defines the type of the component with an id of "form" as being
> an instance of the Form component. Further, you can access the form to
> record errors into it.
>
>

--
View this message in context: 
http://www.nabble.com/T5-validation-tf3323698.html#a9245715
Sent from the Tapestry - User mailing list archive at Nabble.com.


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




--
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to