I am working on an application using JSF and Hibernate. The fields on the JSF form are backed by the Hibernate entities.
Ex: value=#{bean.entity.value}
There is a Clear button which should empty all the fields on the form. There are 3 ways to do this:
Which is the most appropriate way to do this?
If no business is required to calculate the default value I would use JS function to reset fields. You will save one request to the server. You could also generate JS function by JSF and get the default value from server side. This won't solve the issue on page reload though.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.