Datatables Export with JSF
Datatables Export with JSF
danysion
Posts: 2Questions: 1Answers: 0
Good morning, i have a simple problem :
I have managed to export when I do not implement elements of "jsf", but I need it to work with <h: body> and <h: form>, as soon as I remove these elements and I put them as html export works. How can I solve this problem ?
This is my code that work:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:b="http://bootsfaces.net/ui">
<h:head>
<link href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
<link href="https://cdn.datatables.net/buttons/1.2.4/css/buttons.dataTables.min.css" rel="stylesheet" type="text/css" />
<script
src="https://code.jquery.com/jquery-1.11.0.min.js"
integrity="sha256-spTpc4lvj4dOkKjrGokIrHkJgNA0xMS98Pw9N7ir9oI="
crossorigin="anonymous"></script>
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
<script src="//cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.2.4/js/dataTables.buttons.min.js"></script>
<script src="//cdn.datatables.net/buttons/1.2.4/js/buttons.flash.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
<script src="//cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js"></script>
<script src="//cdn.datatables.net/buttons/1.2.4/js/buttons.html5.min.js"></script>
<script src="//cdn.datatables.net/buttons/1.2.4/js/buttons.print.min.js"></script>
<script type="text/javascript">
window.onload = function() {
$('.prueba').DataTable( {
dom: 'Bfrtip',
destroy:true,
buttons: [
'excel', 'pdf'
]
} );
};
</script>
</h:head>
<!-- Para que falle cambia este body por h:body y puedes añadirle tambien un h:form -->
<body>
<form>
<b:dataTable id="example2" class="display prueba" cellspacing="0" width="100%">
<b:dataTableColumn value="prueba1" />
<b:dataTableColumn value="prueba2" />
<b:dataTableColumn value="prueba3" />
</b:dataTable>
</form>
</body>
</html>
and finally if i change <body> for <h:body> and
<
form> for <h:form> dont work.
This discussion has been closed.
Answers
Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.
Information on how to create a test page, if you can't provide a link to your own page can be found here.
Thanks,
Allan
Ok, thanks for all but i cant implement test case with bootsfaces .
JsFiddle , JSBin and Codepen have problems with components bootsfaces.
I need your help.
Thanks for all.
Sorry, I don't know any JSF. I can only help with plain Javascript and HTML.
Allan