There currently isn't a *global* mechanism to map an interface to a
class so that BeanEditForm can instantiate it for you.

Instead, you can add an event handler to your page for the prepare
event.  This method is responsible for preparing the page for either
rendering a form, or submitting a form.  You can add code to
instantiate the UserImpl object there.

Sven's option looks wrong; that's how you define a service, which is
orthogonal to your problem.

On Fri, Jun 27, 2008 at 4:58 AM, Kheldar666 <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> When i use Tapestry, almost my Bean are Interfaces (ex : UserImpl implements
> User ). That causes me a problem sometimes, specially when using
> BeanEditForm (ex : with @Parameter private User _user ).
>
> When I submit the form after editing a User, I have this error :
>
> Exception instantiating instance of org.libermundi.User (for component
> 'Index:beaneditform.editor'): Class org.libermundi.User does not contain a
> public constructor needed to autobuild.
>
> This is normal ! User is a interface...
>
> So, how do I tell Tapestry how to instantiate such objects ?
>
> I tried with Alias... doesn't work at all. The only way I could make this
> work is when the User is an ApplicationStateObject because I contribute to
> the ApplicationStateManager.
>
> Any idea ? Am I wrong when trying to make everything an Interface ?
>
> Thanks for your answers.
>
> Regards,
>
> Martin
> --
> View this message in context: 
> http://www.nabble.com/-T5--Instantiate-%22Interfaces%22-tp18153603p18153603.html
> 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

Creator Apache Tapestry and Apache HiveMind

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

Reply via email to