jsf 2 - jsf composite component convert -
i have composite component
<cc:interface> <cc:attribute name="value" required="true" /> <cc:editablevalueholder name="converter" targets="jsfunction"/> </cc:interface> <a4j:jsfunction name="update"> <a4j:param name="val" assignto="#{cc.value}" id="jsfunction" /> </a4j:jsfunction>
which used as
<my:update value="#{bean.value}" > <f:converter converterid="beanconverter" for="converter"/> </my:update>
when opening page following error
caused by: java.lang.classcastexception: org.richfaces.component.uiparameter cannot cast javax.faces.component.valueholder @ com.sun.faces.facelets.tag.jsf.convertertaghandlerdelegateimpl.applyattachedobject(convertertaghandlerdelegateimpl.java:120) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.faceletsattachedobjecthandler.applyattachedobject(faceletsattachedobjecthandler.java:98) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.application.view.faceletviewhandlingstrategy.retargethandler(faceletviewhandlingstrategy.java:1416) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.application.view.faceletviewhandlingstrategy.retargetattachedobjects(faceletviewhandlingstrategy.java:673) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.tag.jsf.compositecomponenttaghandler.applynexthandler(compositecomponenttaghandler.java:199) [javax.faces-2.2.11.jar:2.2.11] @ org.richfaces.view.facelets.html.behaviorsaddingcomponenthandlerwrapper.applynexthandler(behaviorsaddingcomponenthandlerwrapper.java:53) [richfaces-a4j-4.5.5.final.jar:4.5.5.final] @ com.sun.faces.facelets.tag.jsf.componenttaghandlerdelegateimpl.apply(componenttaghandlerdelegateimpl.java:202) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.delegatingmetataghandler.apply(delegatingmetataghandler.java:120) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:95) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.delegatingmetataghandler.applynexthandler(delegatingmetataghandler.java:137) [javax.faces-2.2.11.jar:2.2.11] @ org.richfaces.view.facelets.html.behaviorsaddingcomponenthandlerwrapper.applynexthandler(behaviorsaddingcomponenthandlerwrapper.java:53) [richfaces-a4j-4.5.5.final.jar:4.5.5.final] @ com.sun.faces.facelets.tag.jsf.componenttaghandlerdelegateimpl.apply(componenttaghandlerdelegateimpl.java:202) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.delegatingmetataghandler.apply(delegatingmetataghandler.java:120) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:95) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.delegatingmetataghandler.applynexthandler(delegatingmetataghandler.java:137) [javax.faces-2.2.11.jar:2.2.11] @ org.richfaces.view.facelets.html.behaviorsaddingcomponenthandlerwrapper.applynexthandler(behaviorsaddingcomponenthandlerwrapper.java:53) [richfaces-a4j-4.5.5.final.jar:4.5.5.final] @ com.sun.faces.facelets.tag.jsf.componenttaghandlerdelegateimpl.apply(componenttaghandlerdelegateimpl.java:202) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.delegatingmetataghandler.apply(delegatingmetataghandler.java:120) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:95) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.delegatingmetataghandler.applynexthandler(delegatingmetataghandler.java:137) [javax.faces-2.2.11.jar:2.2.11] @ org.richfaces.view.facelets.html.behaviorsaddingcomponenthandlerwrapper.applynexthandler(behaviorsaddingcomponenthandlerwrapper.java:53) [richfaces-a4j-4.5.5.final.jar:4.5.5.final] @ com.sun.faces.facelets.tag.jsf.componenttaghandlerdelegateimpl.apply(componenttaghandlerdelegateimpl.java:202) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.delegatingmetataghandler.apply(delegatingmetataghandler.java:120) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.tag.ui.definehandler.applydefinition(definehandler.java:106) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.tag.ui.compositionhandler.apply(compositionhandler.java:206) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.impl.defaultfaceletcontext$templatemanager.apply(defaultfaceletcontext.java:395) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.impl.defaultfaceletcontext.includedefinition(defaultfaceletcontext.java:366) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.tag.ui.inserthandler.apply(inserthandler.java:111) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:95) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.delegatingmetataghandler.applynexthandler(delegatingmetataghandler.java:137) [javax.faces-2.2.11.jar:2.2.11] @ org.richfaces.view.facelets.html.behaviorsaddingcomponenthandlerwrapper.applynexthandler(behaviorsaddingcomponenthandlerwrapper.java:53) [richfaces-a4j-4.5.5.final.jar:4.5.5.final] @ com.sun.faces.facelets.tag.jsf.componenttaghandlerdelegateimpl.apply(componenttaghandlerdelegateimpl.java:202) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.delegatingmetataghandler.apply(delegatingmetataghandler.java:120) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:95) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.tag.jsf.core.viewhandler.apply(viewhandler.java:225) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:95) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.compiler.namespacehandler.apply(namespacehandler.java:93) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.compiler.encodinghandler.apply(encodinghandler.java:87) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.impl.defaultfacelet.include(defaultfacelet.java:312) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.impl.defaultfacelet.include(defaultfacelet.java:371) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.impl.defaultfacelet.include(defaultfacelet.java:350) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.impl.defaultfaceletcontext.includefacelet(defaultfaceletcontext.java:199) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.tag.ui.compositionhandler.apply(compositionhandler.java:174) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.compiler.namespacehandler.apply(namespacehandler.java:93) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.compiler.encodinghandler.apply(encodinghandler.java:87) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.facelets.impl.defaultfacelet.apply(defaultfacelet.java:161) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.application.view.faceletviewhandlingstrategy.buildview(faceletviewhandlingstrategy.java:994) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.lifecycle.renderresponsephase.execute(renderresponsephase.java:99) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.lifecycle.phase.dophase(phase.java:101) [javax.faces-2.2.11.jar:2.2.11] @ com.sun.faces.lifecycle.lifecycleimpl.render(lifecycleimpl.java:219) [javax.faces-2.2.11.jar:2.2.11] @ javax.faces.webapp.facesservlet.service(facesservlet.java:655) [javax.faces-2.2.11.jar:2.2.11] ... 63 more
how caused , how can solve it?
the <cc:editablevalueholder>
should refer components implementing editablevalueholder
interface. <a4j:param>
, backed org.richfaces.component.uiparameter
, surely isn't such one.
there's <cc:valueholder>
should refer components implementing valueholder
interface, converter
member of, still, <a4j:param>
neither imlements interface.
all in all, whatever you're trying achieve impossible way. need different approach solve problem tried solve using wrong approach. note problem not related composite components. outside composite, can't apply converter on <a4j:param>
.
Comments
Post a Comment