Hi, first remove the id parameter from the @Component annotation; this is only needed if the field name in the java class is different from the t:id attribute in the template.
second because you already defined your component in the template you don't have to declare it in your java class; so you should remove the TextField fields from your java class; if you still want to access the component from within java use the @InjectComponent annotation g, kris On Fri, Dec 7, 2012 at 1:51 PM, captain_rhino <graeme.kitc...@axa-travel-insurance.com> wrote: > Embedded components > > I have a page (welcome) in which I am looking to use a custom > simpletextfiled component to display numerous text fields (in the future I > envisage simpledate and simple select components, The simpleTextfield > contains numerous other divs, css and other components). > > public class Welcome{ > > @Persist > private String field1,field2,field3; > > @Component(id = "field1") > private TextField field1Field; > > @Component(id = "field2") > private TextField field2Field; > > @Component(id = "field3") > private TextField field2Field; > > } > > welcome.tml > uses > <t:SimpleTextField/> > > > where SimpleTextField.tml is as follows > <t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"> > > <input t:type="textfield" t:id="field1Field" t:value="field1Field" > label="message:field1Field-label" name="field1Field" size="35" > class="height10Px" /></div> > <t:helpText> (a custom component for helptext) > > </t:container> > > When I run this I recieved the following error > > Embedded component(s) field1Field are defined within component class > com.axa.cao.pages.partner.Welcome (or a super-class of Welcome), but are not > present in the component template > (classpath:com/axa/cao/pages/partner/Welcome.tml). > > How can I pass the Text field component to the SimpleTextField Component to > avoid the above error or is there a different approach I should be taking? > Thanks in advance. > > > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/T5-Embedded-Components-tp5718541.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org