I thought you should annotate the constructor you want the BEF to use with:

@Inject

... to let Tap know which constructor to use.

Regards,
Jim.

-----Original Message-----
From: Michal Gruca [mailto:michalgr...@gmail.com] 
Sent: 05 October 2010 14:09
To: users@tapestry.apache.org
Subject: [T5.2] Constructor issue


Hi all.
While preparing small showcase app, odd problem came out. When I created
domain object with two constructors (first was default NOOP, second one had
two parameters string and enum, it was meant for manual initialization only)
and tried to use it with beaneditform I received exception that tapestry
cannot handle my object creation. After removing parametrized constructor,
error disappeared. It's bit odd IMHO. Tapestry should be capable to
instantiate objects that have more than one constructor. Also @SessionState
behaved weirdly. I was annotating java.util.Date. Error came up if I haven't
instantiate object manually. Date has default constructor so Tapestry should
be fine with constructing new Date on it's own.
Maybe there are some reasons for that kind of behavior, but as I see it
those are bugs. Should I create jira ticket for that?

Tested on tapestry 5.2.1-snapshot. Link to application sources:
https://bitbucket.org/mgruca/tjug_tapestry_30.09.10/downloads  (last
revision or two were stripped out from additional constructors. Content may
be in Polish, but code should be all in En)
-- 
View this message in context:
http://tapestry-users.832.n2.nabble.com/T5-2-Constructor-issue-tp5603058p560
3058.html
Sent from the Tapestry Users 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

Reply via email to