The difference between the action of JSF and ActionListener

Source: Internet
Author: User



  Event   test   parameter   event Generation   page Jump
  Action   has no arguments, no incoming control, return value       generates an event when the Ammonium button is clicked. Submit Form     back to page---jump from profile
  ActionListener     have   Pass in the current control, no return value     generates an event when the Ammonium button is clicked. Submit Form     Return to this page
  valuechangelistener      There are   passed in the current control, no return value     Do not submit form (you need to specify its on change/on click= "Submit" to submit the form automatically   return to this page

Action (): deals with business logic. In fact, JSF automatically generates a "preset ActionListener" to handle the event and determines the page jump based on its return value. The fifth-stage invoke application execution affects navigation between pages (navigation), mainly handles some business logic and returns several business logic results (string types), and the JSF navigation system will select the appropriate next page based on this. The form will be submitted.

ActionListener (Actionevente): Handles the "listener events" of components on the page, and the fifth-stage call to app execution does not affect navigation. The main operation of the components within the current page, or some changes in the business model, or modify the Backingbean ( Managed beans, etc., and does not appear in the jump between pages. The form will be submitted.

Valuechangelistener (valuechangeeventevent): "Listener event" that handles changes in component values on the page, third-stage validation request Value "execution

ActionListener (Event listener): is used to resolve events that affect only the user interface.

specifically, the beans's form data is called before it is loaded and triggered for validation           with immediate= "true" to indicate that this behavior does not trigger validation   ,   after the listener is invoked, the form is re-displayed, do not apply navigation rules, do not redirect pages

ACT ion : A control that is subordinate to a button, hyperlink, and graphic map to automatically submit the corresponding form

Valuechangelistener: Controls that are part of a radio box, combo box, list box, check box, text box, and so on, need to beonclick= "submit ()" or on change= Submit form by "submit ()"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.