4 Replies Latest reply on Nov 3, 2009 7:35 AM by nbelaevski

    Creating custom components in RichFaces: nightmare or misund

      Hi community,

      I've been trying to create a custom RichFaces component for the past two days and am quite ready to give up on RichFaces as a whole... At first, I was very anthousiastic seeing that RF had a Component Development Kit and was thinking to myself that building a custom component would be a piece of cake...

      I've been trying to follow the Developer Guide but got lost at step 46 or so... Why is this so complicated?? I would give anything for a simple skeleton project that I could just open with Eclipse and run with Tomcat! Where is the "pre-generated component project template" that is talked about in the Developer Guide?

      Now I don't mean to offend anyone... I'm really frustrated but maybe it is quite simple and I've missed a point.

      I am trying to build a simple textbox with a validation rule that displays (javascript on client side) a warning image next to it if the content doesn't match a given regular expression.

      In .Net, it took me 4 minutes.

      Please help me achieve this in RF...

        • 1. Re: Creating custom components in RichFaces: nightmare or mi
          ilya_shaikovsky

          The component you trying to build seems similar to the one which described in developer guide regarding CDK. In general it just requires additional js resource to be plugged.

          I believe that you do not deeply familiar with JSF components creation in general. Yes, CDK do not provide any magic tools in order just to say "I want input" and has it generated. But it do most part of the routine work for JSF artifacts required generation and greatly simplifies renderer creation by using markup templates. Lets start from the point that initially we created CDK not in order to provide it for the developers as separate tool but in order to speed up our development of RichFaces components and all the component we built - made using CDK.

          I believe you should re-check some articles on components building in JSF in general, and after you will get the base info check what part of the work CDK could perform for you and what you need to provide to implement your specific functionality.

          • 2. Re: Creating custom components in RichFaces: nightmare or mi

            Thanks a lot for your reply.

            "ilya_shaikovsky" wrote:
            The component you trying to build seems similar to the one which described in developer guide regarding CDK. In general it just requires additional js resource to be plugged.


            Yes, that's the reason I chose to make that component! :)

            "ilya_shaikovsky" wrote:
            I believe that you do not deeply familiar with JSF components creation in general. Yes, CDK do not provide any magic tools in order just to say "I want input" and has it generated. But it do most part of the routine work for JSF artifacts required generation and greatly simplifies renderer creation by using markup templates. Lets start from the point that initially we created CDK not in order to provide it for the developers as separate tool but in order to speed up our development of RichFaces components and all the component we built - made using CDK.


            I understand that. But why isn't there a sample project that we can download and run? Even for learning purposes...

            "ilya_shaikovsky" wrote:
            I believe you should re-check some articles on components building in JSF in general, and after you will get the base info check what part of the work CDK could perform for you and what you need to provide to implement your specific functionality.


            That's true and I will do that. Also, I was wondering: what is the difference between creating a custom component for JSF and creating a custom component for RichFaces (or IceFaces or any JSF implementation)?

            • 3. Re: Creating custom components in RichFaces: nightmare or mi
              ilya_shaikovsky

               

              I understand that. But why isn't there a sample project that we can download and run? Even for learning purposes...


              Good catch. I believed that the sources available. Now contacted doc team guys on that and them told that it's not. But told that all the listings are full in order to replicate the component by just copy and paste of the code.

              what is the difference between creating a custom component for JSF and creating a custom component for RichFaces (or IceFaces or any JSF implementation)?


              If you plan to use some specific framework features in component - than yes, you should learn the third party framework resources to check how them should be used. But in general creation of just JSF component standardized and not depends on JSF implementation and third parties which planned to be included to application.

              I could highly recommend for example this book http://www.amazon.com/Pro-JSF-Ajax-Building-Components/dp/1590595807 in order to quick start with JSF components development main basics.

              • 4. Re: Creating custom components in RichFaces: nightmare or mi
                nbelaevski

                You can checkout code for RF components and use it as examples: http://anonsvn.jboss.org/repos/richfaces/branches/community/3.3.X/ui