I am using https://github.com/patricklodder/jquery-zclip to implement copy to clipboard function. it should copy some text, but for now i want it to be anything really... but its not working at all.
I included in head:
<h:outputScript name="js/jquery.zclip.min.js" library="test" />
<script>
$(document).ready(function(){
$('a#copy').zclip({
path:'#{resource['/test/js/ZeroClipboard.swf']}',
copy:$('div#content').text()
});
});
</script>
and in JSF page i have an ordinary :
<a href="#" id="copy">COPY</a>
there are no errors in Chrome console but clicking the link doesn't do anything too. I really have no idea why it's not working. Big thanks for any suggestion.
---------- EDIT
The datagrid:
<p:dataGrid var="item" columns="3" rows="9" value="#{pictureManagementBean.pictures}" id="gallery" paginator="true">
<p:column>
<p:panel header="#{item.pictureName}" style="text-align:center; width:230px;">
<h:panelGrid styleClass="shortLink">
<p:graphicImage value="#{item.thumbnailDir}" width="200px" />
<a href="#" id="copy#{item.idpicture}">COPY</a>
<p id="copy#{item.idpicture}">LOREM IPSUM</p>
<p:commandLink value="Delete" action="#pictureManagementBean.removePicture(item.idpicture)}" update="@form"/>
</h:panelGrid></p:panel></p:column></p:dataGrid>