3 Replies Latest reply on Mar 3, 2011 2:55 AM by ilya_shaikovsky

    custom coponents

    pradeep_nayak

      I want to call some scripts by default on the click of link. 

      I want  to have a custom html command link for this.

       

      Can I extend the existing command link and get this done , or  I have to write the  rendering part  all over again ?

        • 1. custom coponents
          boy18nj

          you don't need to write custom component, use this way, you can include javascript code in onlclick attribute-

           

          <h:commandLink action="" value="" onclick="alert('hey, I'm working')"/>
          • 2. custom coponents
            danielk

            But if you write this JS-Code in all your commandLinks this breaks the DRY-Principle

             

            I am also interested in custom components. If this is possible, please give us a hint.

            • 3. custom coponents
              ilya_shaikovsky

              I do not think you need custom component there. If you in a JSF 2 world you could just create behavior. And in JSF 1.2 - create custom facelet and re-use across all the pages. Or just attach your handler using jQuery to all the links on the page