1 Reply Latest reply on Nov 16, 2007 5:13 AM by mirkosertic

    Custom components / usage with a4j support

    mirkosertic

      Hi there!

      First of all : thanks for providing such a cool library :-)

      Now, here is my question : At the moment, we have a couple of applications using Apache MyFaces, some of the Tomahawk components, and also a lot of custom components developed inhouse. We now want to make our components Ajaxable with a4j:support and so on, but it seems that our components to not support this enhancement.

      We have a component implementation, a custom renderere for each component, the required config files and tlds and so on. I think the key is the renderer class for ajax support. How should a typical a4j supported render look ( rendersChildren = ? ) etc. to make it work with a4j? Does anybody have the same problem? What is the solution? Are there any examples or Wiki pages available? If thre is not, i would like to provide them :-)

      Thanks a lot

      Mirko

        • 1. Re: Custom components / usage with a4j support
          mirkosertic

          Hi again,

          Meanwhile, i figured out how to use my custom components with a4j:support. The a4j:support registers the JavaScript AJAX call in its parent
          component for the defined event, it creates a valuebinding for this script. The only thing i need to do now is to use this value binding, if exists, for javascriopt generation.

          Also, the custom component renderer must have set encodeChildren = true. Also, take care that the client id is written to the id attribute for the top level html element of the custom component, and that this element is generated by the encodeBegin() method, and not the encodeEnd(). If you are using MyFaces, delegate the renderChildren() to the Apache RenderUtils, because the default implementation of the Renderer class is buggy.

          If anybody is interested, please let me know. I can provide a tutorial ...

          Take care

          Mirko