Excellent! I will definitely look into this. Is it documented anywhere other than code, or should I start work on that as well? :)
On 9/1/05, Martin Marinschek <[EMAIL PROTECTED]> wrote: > ---------- Forwarded message ---------- > From: Martin Marinschek <[EMAIL PROTECTED]> > Date: Sep 1, 2005 5:43 PM > Subject: Re: best way to initialize BackingBean? > To: Mike Kienenberger <[EMAIL PROTECTED]> > > > I am talking about exactly the same thing you are talking about. > > With a caveat - you can't use value bindings there right now, just > strings are possible. Ideally, you would take the code where it ends > end bring it a little further ;) > > regards, > > Martin > > On 9/1/05, Mike Kienenberger <[EMAIL PROTECTED]> wrote: > > Martin, > > > > Are you talking about setting parameters at run-time via f:param? > > > > We're talking about setting them at config-time via managed properties. > > > > Like this: > > > > > > <converter> > > <converter-for-class>myClass</converter-for-class> > > <converter-class>myConverterClass</converter-class> > > <managed-property> > > <property-name>myManagedBean</property-name> > > <value>#{myManagedBeanName}</value> > > </managed-property> > > </converter> > > > > > > On 8/31/05, Martin Marinschek <[EMAIL PROTECTED]> wrote: > > > Hint, hint taken ;) > > > > > > MyFaces does that. It is in the appendix of the spec, and MyFaces (at > > > least partially - as much as was needed of that by me) supports > > > setting parameters onto Converters... > > > > > > regards, > > > > > > Martin > > > > > > On 8/31/05, Craig McClanahan <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > On 8/31/05, Mike Kienenberger <[EMAIL PROTECTED]> wrote: > > > > > On 8/31/05, Craig McClanahan <[EMAIL PROTECTED]> wrote: > > > > > > If you are using by-Class converters, you don't need to register > > > > > > them > > > > on > > > > > > the *component* at all -- they get registered in the Application > > > > instance > > > > > > along with the class they are for. I'm not sure I see a need to > > > > > > use a > > > > DI > > > > > > framework to instantiate those, since you already have the ability > > > > > > to > > > > > > configure the implementation class that will be used. > > > > > > > > > > Craig, > > > > > > > > > > Can you expand on this? What do I need to do to gain the ability to > > > > > configure the implementation class? > > > > > > > > Simply include a registration for the converter in one of your > > > > faces-config.xml files. The following entry will override the standard > > > > converer that is applied to any property of type Integer: > > > > > > > > <converter> > > > > <converter-for-class>java.lang.Integer</converter-for-class> > > > > > > > > <converter-class>com.mycompany.MyIntegerConverter</converter-class> > > > > </converter> > > > > > > > > Your config files are read *after* the JSF implementation has been > > > > configured, so this *replaces* the standard one. > > > > > > > > > I have lots of converters registered by class, and I want to DI a > > > > > managed JSF bean into each of them. How do I do this? > > > > > > > > In other words, you want to use DI for configuring properties on a > > > > by-class > > > > converter? That, sadly, isn't supported unless you were to override the > > > > Application instance provided by your JSF impementation (or if your JSF > > > > implementation provided this feature as part of its own implementation, > > > > hint > > > > hint :-). The technique I described doesn't reference any by-id or > > > > by-type > > > > registered converters ... it creates anonymous instances. > > > > > > > > But you don't *need* to use DI for this if your MyIntegerConverter > > > > class > > > > (see previous example) is already set up exactly the way you want it > > > > after > > > > the public zero-args constructor returns. All you need for that is the > > > > registration described above. > > > > > > > > > -Mike > > > > > > > > > > > > > Craig > > > > > > > > > > > > > > > > > -- > > > > > > http://www.irian.at > > > Your JSF powerhouse - > > > JSF Trainings in English and German > > > > > > > > > > -- > > http://www.irian.at > Your JSF powerhouse - > JSF Trainings in English and German > > > -- > > http://www.irian.at > Your JSF powerhouse - > JSF Trainings in English and German >