Bean method will not be called when changing to java.sql.Date

I have a strange problem with one of my bean methods. If I give a date data type from java.util.Date to java.sql.Dat e, one of the methods in my managedBean named actionEdit does not start when I click the button on the jsf page.

My actionEdit () method

 public void actionEdit(){ try { beanValues.add(selectedRow); for (Schedule editValues : beanValues) { editValues.setStartDate(selectedRow.getStartDate()); editValues.setRemarks(selectedRow.getRemarks()); } ScheduleDAO.editSchedule(beanValues); beanValues.clear(); } catch (Exception e) { // TODO: handle exception logger.info("exception " + e.getMessage()); e.printStackTrace(); } } 

and it is called in jsf as follows

 <p:commandButton value="Save" action="#{schedule.actionEdit()}"> </p:commandButton> 

What could be causing this behavior? Any ideas?

thanks

0
source share
1 answer

Change it to java.util.Date and use java.sql.Date in persistence level only .

See also my answer to your previous question: Date format Error java.sql.SQLException: Invalid column type .

+1
source

Source: https://habr.com/ru/post/909874/


All Articles