Mapping inputText to Date object in JSF

前端 未结 2 775
野性不改
野性不改 2020-12-19 05:18

I am very new to JSF. I am trying to get a Date in JSF inpuText component using a custom datepicker( made using jquery and cannot user calendar component). I want to map thi

相关标签:
2条回答
  • 2020-12-19 05:38

    I am not sure if I understood your question well, although from what I understood so far your problem doesn't look complex at all. Just save your input in the proper manner and pass the value to your bean. Properties of date class such hour, minute seconds have been deprecated (although you can still use them). Also you can try to just pass the long value, but I´m not sure how that works. You should find all the needed specification here

    0 讨论(0)
  • 2020-12-19 05:51

    You can try like this

    <h:inputText value="#{backingBean.someDate}">  
       <f:convertDateTime pattern="yyyy-MM-dd"/>  
    </h:inputText>
    

    where someDate is a util date & have accessor methods in the backing bean.

    0 讨论(0)
提交回复
热议问题