I have a JSF composite component like this:
 <cc:implementation>
   <div id="#{cc.clientId}">
        <h:outputScript library="js" name="helper.js"/>
        <script type="text/javascript">
        if(typeof variables === "undefined"){
             var variables = {};
        }
        (function(){
            variables.formid = '#{cc.clientId}'; 
        })();
        </script>
    </div>
Value of variables.formid I'm using in a helper.js file. When I include this composite component only once, it's working like it should. When I include multiple composite components, every component receives the value of a last included composite component, how can I solve this issue?