JSF 2.0: h:inputText inside composite component fails with non-String objects when validation is set

∥☆過路亽.° 提交于 2019-12-01 00:39:20

As per a comment on your ticket, it turns out that you could as workaround explicitly specify the type converter.

You could do it as follows

<pref:fieldComponent text="#{bean.foo}">
    <f:converter converterId="javax.faces.Integer" />
</pref:fieldComponent>

and

<cc:implementation>
    <h:inputText id="field" value="#{cc.attrs.text}">
        <cc:insertChildren />
    </h:inputText>
</cc:implementation>

or maybe

<pref:fieldComponent text="#{bean.foo}" converter="javax.faces.Integer" />

and

<cc:implementation>
    <h:inputText id="field" value="#{cc.attrs.text}" converter="#{cc.attrs.converter}" />
</cc:implementation>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!