<f: ajax> Unable to attach <f: ajax> to non-ClientBehaviorHolder What to do when you become a parent

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

Event: HTTPS status 500 when trying to display the page by adding ajax processing

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

Cause: f: ajax can only be used in a tag that implements the ClientBehaviorHolder interface.

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))

Action: Change the tag to h: inputText

...abridgement...
<h:inputText id="file" style="display:none;">
  <f:ajax event="change" execute="@form" render="@form" listener="#{uploadBean.uploadFile}" />
</h:inputText>
...abridgement...

Recommended Posts

<f: ajax> Unable to attach <f: ajax> to non-ClientBehaviorHolder What to do when you become a parent
What to do when you become a Problem During Content Assist
What to do when Method not found in f: ajax
What to do when a javax.el.PropertyNotWritableException occurs
What to do when you run into a docker-compose node_modules problem
What do you use when converting to String?
What to do when you want to delete a migration file that is "NO FILE"
What to do when JSF tags do not become HTML
What to do if you accidentally create a model
What to do when a null byte error occurs
What to do when rails creates a 〇〇 2.rb file
What to do if you get a NoClassDefFoundError when trying to run eclipse on Java9
What to do if you get a port error when docker-compose up on Mac
What to do when it becomes Unable to find CDI BeanManager.
What to do if you get a java.io.IOException in GlassFish
What to do when you launch an application with rails
[Rails Tutorial Chapter 2] What to do when you make a mistake in the column name
What to do if you get a "Cannot Pull Container Error" when starting ECS ​​Fargate
What to do when javax.batch.operations.JobStartException occurs
What to do when an UnsupportedCharsetException occurs in a lightweight JRE
What to do if you get a gcc error in Docker
What to do if you get a DISPLAY error in gym.render ()
What to do if you get a JNI shared library error when trying to build in Eclipse
What to do if you get a groovy warning in Thymeleaf Layout
What to do if Operation not permitted is displayed when you execute a command in the terminal
What to do if you get an error when you hit Heroku logs
What to do if you install Ubuntu
What to do when undefined method ʻuser_signed_in?'
What to do when "call'Hoge.connection' to establish a connection" appears on rails c
What to do if you get a MiniMagick vulnerability alert on GitHub
Notes on what to do when a WebView ClassNotFoundException occurs in JavaFX 12
What to do if you get an "A server is already running." Error when you try to start the rails server
What to do if you get a SQLite3 :: BusyException: database is locked error
What to do when you think you can't do Groovy-> Java in IntelliJ IDEA CE
What to do when is invalid because it does not start with a'-'
[Ubuntu] What to do when MongoDB cannot be started due to a SocketException error
What to do if you push incorrect information
What to do when debugging "Source not found"
What to do when IllegalStateException occurs in PlayFramework
What to do if you get an error saying "Please enter a valid value" when getting with Rails datetime_field
What to do if you get an error saying "Could not find a JavaScript runtime." When starting rails server
What to do if you get a wrong number of arguments error in binding.pry
What to do when The SSL certificate has expired
What to do if ClassNotFoundException occurs when starting Tomcat
Error ExecJS :: RuntimeUnavailable: What to do when it occurs
ParseException: What to do when Unparseable date is reached
A memo to check when you try to use Lombok
<Dot installation> What to do if you cannot proceed due to an error when building a development environment for Rails learning.
What to do when Cannot format given Object as a Date in convertDateTime of JSF
[Ruby / Rails] What to do when NoMethodError appears when using a destructive method such as filter!
What to do when a could not find driver appears when connecting to a DB in a Docker environment
What to do if a SAX Parser error occurs when using Liferay 7 / DXP on AWS
What to do if you get a "302" error in your controller unit test code in Rails
What you need to do to open a file from the menu in the document-Based App macOS app
[Rails] What to do when the view collapses when a message is displayed with the errors method
[Rails 6] What to do when a missing a template error occurs after introducing haml [Super easy]
[IOS] What you need to know before creating a widget
# What to do if you accidentally do rails db: migrate: drop
What to do when Cannot apply expression operators to method binding
What to do if mysql2 gets a bundle install error
What to do if you can't use the rails command