I am developing two applications one web (service) and another mobile (consumes the service), in apk the user send forms to the web application, hence I would like to create a kind of notification for each new form that the server receives. Similar to what has on the site of the stack overflow. How could I do that?
Andinthepagewhereyoulistalltheformsreceived,howcouldareloadinthedatatablewithouthavingtorefreshtheentirepage?
Mylistofformsreceivedinthewebapplication:
#{extends'main.html'/}<metahttp-equiv="Content-Type" content="text/html; charset=utf-8">
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><scripttype="text/javascript" charset="utf8"
src="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script><scripttype="text/javascript" charset="utf8"
src="//code.jquery.com/jquery-1.12.4.js"></script>
<!-- JQUERY DATATABLE -->
<script type="text/javascript">
$(document)
.ready(
function() {
$('#myTable3')
.DataTable(
{
"language" : {
"sEmptyTable" : "Nenhum registro encontrado",
"sInfo" : "Mostrando de _START_ até _END_ de _TOTAL_ registros",
"sInfoEmpty" : "Mostrando 0 até 0 de 0 registros",
"sInfoFiltered" : "(Filtrados de _MAX_ registros)",
"sInfoPostFix" : "",
"sInfoThousands" : ".",
"sLengthMenu" : "_MENU_ resultados por página",
"sLoadingRecords" : "Carregando...",
"sProcessing" : "Processando...",
"sZeroRecords" : "Nenhum registro encontrado",
"sSearch" : "Pesquisar",
"oPaginate" : {
"sNext" : "Próximo",
"sPrevious" : "Anterior",
"sFirst" : "Primeiro",
"sLast" : "Último"
},
"oAria" : {
"sSortAscending" : ": Ordenar colunas de forma ascendente",
"sSortDescending" : ": Ordenar colunas de forma descendente"
}
}
});
});
</script>
<div class="panel panel-default">
<div class="panel-body">
<input type="hidden" name="denuncia.id" value="${d?.id}" />
<table id="myTable3"
class="table table-striped table-bordered table-over">
<thead>
<tr>
<th>Nome</th>
<th>Rua</th>
<th>Bairro</th>
<th>Cidade</th>
<th>Data</th>
</tr>
</thead>
<tbody>
#{list items:denuncias, as:'d'}
<tr>
<td>${d.nome}</td>
<td>${d.rua}</td>
<td>${d.bairro}</td>
<td>${d.cidade}</td>
<td>${d.data}
<div class="pull-right action-buttons">
<a href="@{denuncias.remover(d.id)}" class="trash" data-toggle="confirmation" data-btn-ok-label="Sim" data-btn-ok-class="btn-success" data-btn-cancel-label="Não"
data-btn-cancel-class="btn-danger" data-title="Remover denuncia" data-content="Tem certeza que deseja excluir este registro?"><span class="glyphicon glyphicon-trash"> Remover</span></a>
<a href="@{denuncias.detalhes(d.id)}" class="flag"><span class="glyphicon glyphicon-eye-open"> Detalhes</span></a>
</div>
</td>
</tr>
#{/list}
</tbody>
</table>