Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.3, 2.0.3, 1.1.3
    • Component/s: None
    • Labels:
      None

      Description

      I had to override EtvalRenderKit to make A4J-Ajax and Extval play nice. ExtValRenderKit wraps any Renderer. A4J relies on the root renderer to be of type AjaxViewRootRenderer. Here is my patch:

      @Override
      public Renderer getRenderer(final String family, final String rendererType)
      {
      Renderer renderer = wrapped.getRenderer(family, rendererType);

      if (renderer != null)
      {
      // dont wrap the ajax view renderer
      if (renderer instanceof AjaxViewRootRenderer)

      { return renderer; }

      else

      { return renderer instanceof ExtValRendererWrapper ? renderer : createWrapper(renderer); }

      }

      if (this.logger.isWarnEnabled())

      { this.logger.warn("no renderer found for family " + family + " and type " + rendererType); }

      return renderer;
      }

        Activity

        Hide
        Gerhard Petracek added a comment -

        hi,

        is that a new behaviour? i've successfully tested extval with a4j in the past.
        if there is a ClassCastException, you can use the generic-support module of extval.

        anyway, you don't need to patch this impl. - just register a custom RenderKitWrapperFactory which creates an a4j aware renderkit.
        e.g.:

        public class StartupListener extends AbstractStartupListener
        {
        protected void init()
        {
        ExtValContext.getContext().getFactoryFinder().getFactory(FactoryNames.RENDERKIT_WRAPPER_FACTORY,
        AbstractRenderKitWrapperFactory.class).addRenderKitWrapperFactory(new AbstractRenderKitWrapperFactory()
        {
        protected RenderKit createWrapper(RenderKit renderKit)

        { //return your custom renderkit }

        });
        }
        }

        would you mind to add your code and donate it as extval add-on at os890?
        (due to the a4j dependency)

        thx & regards,
        gerhard

        Show
        Gerhard Petracek added a comment - hi, is that a new behaviour? i've successfully tested extval with a4j in the past. if there is a ClassCastException, you can use the generic-support module of extval. anyway, you don't need to patch this impl. - just register a custom RenderKitWrapperFactory which creates an a4j aware renderkit. e.g.: public class StartupListener extends AbstractStartupListener { protected void init() { ExtValContext.getContext().getFactoryFinder().getFactory(FactoryNames.RENDERKIT_WRAPPER_FACTORY, AbstractRenderKitWrapperFactory.class).addRenderKitWrapperFactory(new AbstractRenderKitWrapperFactory() { protected RenderKit createWrapper(RenderKit renderKit) { //return your custom renderkit } }); } } would you mind to add your code and donate it as extval add-on at os890? (due to the a4j dependency) thx & regards, gerhard
        Hide
        Gerhard Petracek added a comment -

        for such cases extval provides the generic support module

        Show
        Gerhard Petracek added a comment - for such cases extval provides the generic support module

          People

          • Assignee:
            Unassigned
            Reporter:
            Stefan Meyer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development