Dushyant, Sorry -- It's usually easier to set UI component properties in the setter methods, as the JSF implementation has already created the instance of the component for you. Otherwise you'll have to create the component instance yourself, which normally isn't necessary.
--- Kito D. Mann -- Author, JavaServer Faces in Action http://twitter.com/kito99 http://www.virtua.com - JSF/Java EE consulting, training, and mentoring http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info +1 203-404-4848 x3 On Fri, Jan 30, 2009 at 12:41 PM, Kito Mann <[email protected]> wrote: > Dushyant, > > Sure, it's safe to set properties in the getter methods. > > --- > Kito D. Mann -- Author, JavaServer Faces in Action > http://twitter.com/kito99 > http://www.virtua.com - JSF/Java EE consulting, training, and mentoring > http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info > +1 203-404-4848 x3 > > > > > > > On Fri, Jan 30, 2009 at 12:55 AM, dushyant agarwal < > [email protected]> wrote: > >> Hi, >> JSF components getters (getter methods of instances that are EL bound to >> JSF components in the JSPs) are called only during initial requests and I >> presume that they are used by the JSF framework to synchronize the JSF view >> tree on the server with the instances on the Backing beans (i.e. Both the >> tree and the Backing bean should refer to the same instances of components). >> >> Now is it ethical / correct to set initial values to a component in their >> getter methods? >> >> Thanks, >> Dushyant >> >> ------------------------------ >> Unlimited freedom, unlimited storage. Get it >> now<http://in.rd.yahoo.com/tagline_mail_2/*http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/> > > >

