> From: DEO Kedar [mailto:[EMAIL PROTECTED] > > Hi, > I was going through the sample example friends-jsp-fbu, and the question > that comes to my mind is when should I use the FormBean and when should I > use the cctx.setModel(someModel), it seems like I have an option to use > both. What kind of requirements dictate the usage of one over the other?
In general, you probably don't need to call setModel(). Ignore it for now. Eventually you will run into a situation where you need to provide different models to different views, and then you will be glad to have that method :-) > Second, is it not possible to define the formbean for a controller from > the maverick.xml config file rather than overriding the makeFormBean > method? (I am not sure if the question makes sense) Easy. Create a new controller base class, derived from FormBeanUser. Override the init() method to check for the configuration element you want to use and then get its Class. Then override makeFormBean() so that it always returns a newInstance() of that class. Now derive all your controllers from this new base class. This makes it easy to have a config like this: <controller class="blah.YourFormBeanUser" form="blah.SomeForm"/> Make sense? The reason this isn't a standard part of FormBeanUser is that it seems somewhat questionably useful to me. My controller code needs to know the type of the form object, so why place this value in two different files (the controller java and the maverick config file)? (sorry, I don't know the answers to your other questions) Jeff Schnitzer [EMAIL PROTECTED] ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 [INVALID FOOTER]
