My first custom converter: why's not called?

孤人 提交于 2019-12-24 16:52:00

问题


I wrote my first JSF (1.2) custom converter. I declared it in faces-config.xml (converter-id and converter-class), wrote the Java class implementing getAsObject and getAsString methods. Then i put the converter in a page like this:

    <ice:selectInputDate id="ctldatanascita" 
                  value="#{beanrichiestaabilitazione.datanascita}"
          renderAsPopup="true">
      <f:converter converterId="cisConverterDate" />
    </ice:selectInputDate>

The class is istantiated, but the Converter interface methods are never called. What I'm missing?


回答1:


I don't do IceFaces, so I can't tell from top of head if that is normal. But Googling on "ice:selectinputdate converter" leads me to this topic as first hit: http://www.icefaces.org/JForum/posts/list/6163.page which confirms the behaviour you're seeing.

It als mentions several prerequirements and solutions:

  • You need at least ICEfaces 1.7 DR2 or ICEfaces 1.6.2.
  • Your converter needs to extend javax.faces.convert.DateTimeConverter.
  • Or just use standard <f:convertDateTime> instead.


来源:https://stackoverflow.com/questions/5515193/my-first-custom-converter-whys-not-called

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!