--Environment - CentOS Linux release 7.8.2003 (Core) - Eclipse IDE for Enterprise Java Developers.Version: 2020-03 (4.15.0) - openjdk version "11.0.7" 2020-04-14 LTS - JSF 2.3.9
Eclipse Console error
javax.faces.view.facelets.TagException: /base.xhtml @18,103 <f:ajax> Unable to attach <f:ajax> to non-ClientBehaviorHolder parent
at com.sun.faces.facelets.tag.jsf.core.AjaxHandler.applyNested(AjaxHandler.java:276)
at com.sun.faces.facelets.tag.jsf.core.AjaxHandler.apply(AjaxHandler.java:148)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:179)
...abridgement...
base.xhtml
...abridgement...
<h:inputHidden id="file">
<f:ajax event="change" execute="@form" render="@form" listener="#{uploadBean.uploadFile}" />
</h:inputHidden>
...abridgement...
Register an AjaxBehavior instance on one or more UIComponents implementing the ClientBehaviorHolder interface. ajax(JSF 2.2 View Declaration Language: Facelets Variant)
Register an AjaxBehavior instance with one or more UIComponents that implement the ClientBehaviorHolder interface.
In this case, the question is whether h: inputHidden
implements the ClientBehaviorHolder interface, but when I looked at the JavaDoc for ClientBehaviorHolder
, it was out of scope ...
All Known Implementing Classes: HtmlBody, HtmlCommandButton, HtmlCommandLink, HtmlDataTable, HtmlForm, HtmlGraphicImage, HtmlInputFile, HtmlInputSecret, HtmlInputText, HtmlInputTextarea, HtmlOutcomeTargetButton, HtmlOutcomeTargetLink, HtmlOutputLabel, HtmlOutputLink, HtmlPanelGrid, HtmlPanelGroup, HtmlSelectBooleanCheckbox, HtmlSelectManyCheckbox, HtmlSelectManyListbox, HtmlSelectManyMenu, HtmlSelectOneListbox, HtmlSelectOneMenu, HtmlSelectOneRadio ClientBehaviorHolder (JavaServer Faces API (2.2))
...abridgement...
<h:inputText id="file" style="display:none;">
<f:ajax event="change" execute="@form" render="@form" listener="#{uploadBean.uploadFile}" />
</h:inputText>
...abridgement...
Recommended Posts