0
Personal I would like to ask a question, we should treat differently fields that have as kind of data time and date I say in relation to the view, Why I have a problem I need to plot some date and time in a table in my view but the fields that are not date or time appear in a good already the fields that have as type time and date appear as Object
public static List<FolhaBean> bindingProperties(List<Folha> folhas) {
List<FolhaBean> folhasBean = new ArrayList<>();
folhas.forEach(folha -> {
FolhaBean folhaBean = new FolhaBean(folha.getIdFolha(), folha.getData(), folha.getEntrada(),
folha.getSaidaAlmoco(), folha.getVoltaAlmoco(),folha.getSaida(), folha.getBancoHoraNegativo()
, folha.getBancoHoraPositivo(), folha.getVersion(), folha.getNomeUsuario());
folhasBean.add(folhaBean);
});
return folhasBean;
}
this is the bean I’m using to bring the information
@RequestMapping(value = REDIRECT_PAGE_CARREGAR, method = RequestMethod.GET)
public ModelAndView showCarregar(Model model, HttpServletRequest request){
usuarioBean= folhaService.findFetchAll();
model.addAttribute("usuarioBean", usuarioBean);
return new ModelAndView(REQUEST_MAPPING_PAGE_CARREGAR);
}
@RequestMapping(value = "/carregarDados", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<FolhaBean>> carregar() {
List<Folha> folhas = folhaService.findFetchAll();
List<FolhaBean> folhasBean = FolhaBean.bindingProperties(folhas);
return new ResponseEntity<List<FolhaBean>>(folhasBean, HttpStatus.OK);
}
and that’s the controller.
the code that generates the table is this
id="" data-url="${loadFola}" data-content-type="application/json" data-page-size="5" data-locale="en-BR" data-minimum-Count-Columns="2" data-show-toggle="true" data-toggle="table" data-click-to-select="true" data-Striped="true" data-show-Columns="" data-true-id-field="id"id"id"id" data-show-refresh="true" data-Toolbar="#Toolbar" data-query-params="paginar" data-select-item-name="" data-pagination="true" data-pagination-pre-text="Previous" date-pagination-next-text="Next" data-checkbox-header="false" data-search="true" data-Response-Handler="responseHandler"> id Check-in date Check-out Lunch Check-out Lunch Check-out Positive Bank Negative Bank User License
Can add problematic code snippet?
– user28595
Objects of the type Date/Time usually require the call of a method
format
for display. It would not be the case?– Woss
so that’s my doubt I don’t know if you need a different treatment
– Wesley Santos
How is it displayed in your view? Something like this:
Tue Apr 11 13:41:42 GMT 2017
?– user28595
then is currently presented as Object only
– Wesley Santos
no date or time is shown
– Wesley Santos
I don’t understand. Post a picture of the problem, preferably.
– user28595
see that the id appears normal plus the fields that are date and time stands as Object
– Wesley Santos
This seems to be an error in Javascript, not Java. What code generates this table?
– Woss
i created an idea of dynamic table and not Statica table
– Wesley Santos
Boy I managed to solve was just a problem of conversion I appreciate the attention
– Wesley Santos