JSF Best Practice: Custom Components and JavaScript

后端 未结 2 1266
闹比i
闹比i 2021-01-19 01:57

I am developing a JSF Custom Component, using the information I found on the following book Pro JSF and HTML5 by Apress.

So far, I successfully developed:

2条回答
  •  佛祖请我去吃肉
    2021-01-19 02:23

    You can include into the facelets wich uses your component an external javascript file by adding the following code:

        
    

    Within the component when you generate the XHTML output give an Id to your menu entries e.g.

        
    

    and in yourjs.js

        $(document).ready(function() {
    
        $("#myid").click(function(){
        // dostuff
        });
        });
    

提交回复
热议问题