<t:radiogroup t:value="gender">
<input type="radio" t:type="radio"
t:value="literal:M" /> Male
<input type="radio" t:type="radio"
t:value="literal:F"/> Female
</t:radiogroup>

@Property
@Persist
private String gender;

void onActivate()  {
    gender = "F";
}

or

void onSetupRender()  {
    gender = "F";
}

On Thu, Oct 23, 2014 at 9:24 AM, Chris Poulsen <mailingl...@nesluop.dk>
wrote:

> I think that
>
> private String gender = "F";
>
> is suspect, you should probably not initialize it to "F", instead you can
> use onActivate or setupRender to default it, if it is null.
>
> --
> Chris
>
> On Thu, Oct 23, 2014 at 2:45 PM, Deepak <mn.dee...@gmail.com> wrote:
>
> > I'm just beginning with Tapestry and referring to "Tapestry 5, Building
> Web
> > Applications" by Alexander Kolesnikov. But I'm using version 5.3.7.
> >
> > I have a page with a property annotated with @Persist and a default value
> > of an enum.
> >
> > <t:radiogroup t:value="gender">
> > <input type="radio" t:type="radio"
> > t:value="literal:M" /> Male
> > <input type="radio" t:type="radio"
> > t:value="literal:F"/> Female
> > </t:radiogroup>
> >
> > @Property
> > @Persist
> > private String gender = "F";
> >
> > When the page is brought up, it throws the following exception:
> >
> > http://localhost:8080/t5inaction/register
> >
> > An unexpected application exception has occurred.
> >
> > Exception assembling root component of page Register: Unable to
> instantiate
> > instance of transformed class tapestry5.inaction.pages.Register:
> > java.lang.reflect.InvocationTargetException
> >
> > why is this happening and what's wrong in my implementation ?
> >
> > Thanks,
> > Deepak
> >
>



-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Reply via email to