Hi Ivano, I feel really stupid now. Looking again at the implementation in other form components, I found two lines at the bottom of every component specification:
<property-specification name="name" type="java.lang.String"/> <property-specification name="form" type="org.apache.tapestry.IForm"/> I guess I didn't see them from looking at the code for so long. My component is now finally working. Thanks for getting my attention to this! Denis Souza -----Original Message----- From: Ivano Pagano [mailto:[EMAIL PROTECTED] Sent: ter�a-feira, 19 de abril de 2005 06:54 To: Tapestry users Subject: Re: Problem with form component Hi Denis, I guess the abstract getters/setters in the AbstractFormComponent are not intended as "Tapestry Properties" for the component. I think you need to implement them to make your form actually work consistently with your specific design. For the framework to generate abstract method "automagically" you should also declare the properties in the component descriptor (i.e. "SafeForeach.jwc" or something alike). If anyone knows better, I would gladly receive a confirmation of my guess. Ivano. Denis Souza wrote: >Hello, > > > > I'm trying to write a new Foreach component that allows you to >safely add/remove entries from the provided list of objects during the >rewind cycle (to make it easier to create pages such as the todo listing >show in "Tapestry in Action"). I do this by caching the list during the >render cycle so that the same elements will be used during rewind. I got it >to work fine when it appears only once in a page, however, In order to make >this work with when it appears more than once in a page or nested inside >another Foreach component, I found that had to extend AbstractFormComponent >instead of BaseComponent, since I can then obtain a unique ID for each >occurrence. Once I did that, I started to get this exception: > > > >org.apache.tapestry.ApplicationRuntimeException > >Method 'public abstract java.lang.String >org.apache.tapestry.form.AbstractFormComponent.getName()' (declared in class >org.apache.tapestry.form.AbstractFormComponent) has no implementation in >class app.internal.component.form.SafeForeach (or enhanced subclass >app.internal.component.form.SafeForeach$Enhance_73). > > > >If I create do-nothing get/setName methods, Tapestry is satisfied and starts >asking for the implementation of isDisabled() and after that for the >implementation of getForm(). I'm afraid it's asking for every abstract >method present in AbstractFormComponent. Shouldn't Tapestry automatically >create them in the enhanced subclass? I looked at code from various other >form components and I couldn't find out what is it I'm doing wrong. I'm >pretty sure Tapestry does not require the component class to implement these >methods. This is not the first form component I've written, but it's the >first one that gave me trouble. > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
