You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Gerhard Petracek <ge...@gmail.com> on 2013/02/19 17:10:41 UTC
Re: ExtVal with multiple RenderKit's (Primeface + Primeface Mobile)
does not work correctly
hi @ all,
i've moved the renderkit-cache used in GenericRenderKitWrapperFactory to
AbstractRenderKitWrapperFactory and simplified the rest (see [1]).
regards,
gerhard
[1] https://issues.apache.org/jira/browse/EXTVAL-151
2013/1/30 Howard W. Smith, Jr. <sm...@gmail.com>
> On Tue, Jan 29, 2013 at 6:11 AM, Reto Weiss <Re...@ivyteam.ch> wrote:
>
> > Hi
> >
> > I'm using MyFaces (2.1.10) with ExtVal (2.0.6). As RenderKit's I use
> > Primefaces and Primefaces Mobile. This does not work because the class
> >
> >
> >
> org.apache.myfaces.extensions.validator.core.renderkit.DefaultRenderKitWrapperFactory
> >
> > is not able to handle more than one RenderKit. This is because the method
> > createWrapper caches the first RenderKit it wrappes. After that it
> returns
> > the cached RenderKit even if the RenderKit to wrap is another one than
> the
> > cached one.
> >
> > I have fixed this in my project by providing my own
> > RenderKitWrapperFactory:
> >
> > class IvyExtValRenderKitWrapperFactory extends
> > AbstractRenderKitWrapperFactory
> > {
> > private HashMap<RenderKit, ExtValRenderKit> wrappers = new
> > HashMap<RenderKit, ExtValRenderKit>();
> >
> > @Override
> > protected synchronized RenderKit createWrapper(RenderKit renderKit)
> > {
> > ExtValRenderKit wrapper = wrappers.get(renderKit);
> > if (wrapper == null)
> > {
> > wrapper = new ExtValRenderKit(renderKit);
> > wrappers.put(renderKit, wrapper);
> > }
> > return wrapper;
> > }
> >
> > }
> >
> >
> > Yes, please report and thanks for providing that patch! I was in a very
> lengthy discussion with someone else about this issue...almost a year
> ago.[1] This is good news! I hope you shared the same in PrimeFaces Mobile
> (community) forum as well.
>
> [1] http://forum.primefaces.org/viewtopic.php?f=8&t=19910&start=10#p62149
>
Re: ExtVal with multiple RenderKit's (Primeface + Primeface Mobile)
does not work correctly
Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
Gerhard,
I just added your response below on the related/referenced PrimeFaces
Mobile forum topic. Hopefully, someone will test/confirm your fix. :)
Howard
On Tue, Feb 19, 2013 at 11:10 AM, Gerhard Petracek <
gerhard.petracek@gmail.com> wrote:
> hi @ all,
>
> i've moved the renderkit-cache used in GenericRenderKitWrapperFactory to
> AbstractRenderKitWrapperFactory and simplified the rest (see [1]).
>
> regards,
> gerhard
>
> [1] https://issues.apache.org/jira/browse/EXTVAL-151
>
>
>
> 2013/1/30 Howard W. Smith, Jr. <sm...@gmail.com>
>
> > On Tue, Jan 29, 2013 at 6:11 AM, Reto Weiss <Re...@ivyteam.ch>
> wrote:
> >
> > > Hi
> > >
> > > I'm using MyFaces (2.1.10) with ExtVal (2.0.6). As RenderKit's I use
> > > Primefaces and Primefaces Mobile. This does not work because the class
> > >
> > >
> > >
> >
> org.apache.myfaces.extensions.validator.core.renderkit.DefaultRenderKitWrapperFactory
> > >
> > > is not able to handle more than one RenderKit. This is because the
> method
> > > createWrapper caches the first RenderKit it wrappes. After that it
> > returns
> > > the cached RenderKit even if the RenderKit to wrap is another one than
> > the
> > > cached one.
> > >
> > > I have fixed this in my project by providing my own
> > > RenderKitWrapperFactory:
> > >
> > > class IvyExtValRenderKitWrapperFactory extends
> > > AbstractRenderKitWrapperFactory
> > > {
> > > private HashMap<RenderKit, ExtValRenderKit> wrappers = new
> > > HashMap<RenderKit, ExtValRenderKit>();
> > >
> > > @Override
> > > protected synchronized RenderKit createWrapper(RenderKit renderKit)
> > > {
> > > ExtValRenderKit wrapper = wrappers.get(renderKit);
> > > if (wrapper == null)
> > > {
> > > wrapper = new ExtValRenderKit(renderKit);
> > > wrappers.put(renderKit, wrapper);
> > > }
> > > return wrapper;
> > > }
> > >
> > > }
> > >
> > >
> > > Yes, please report and thanks for providing that patch! I was in a very
> > lengthy discussion with someone else about this issue...almost a year
> > ago.[1] This is good news! I hope you shared the same in PrimeFaces
> Mobile
> > (community) forum as well.
> >
> > [1]
> http://forum.primefaces.org/viewtopic.php?f=8&t=19910&start=10#p62149
> >
>