开发者

My first custom converter: why's not called?

开发者 https://www.devze.com 2023-02-21 17:13 出处:网络
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 method

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?


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.
0

精彩评论

暂无评论...
验证码 换一张
取 消