Seam and JSF frameworks

Source: Internet
Author: User
A4j: Support
Add the Ajax function to the uicomponent-based component so that they have javascript event attributes.
During decoding: if a request is Ajax-completed MED, the map is obtained from the requestparametermap attribute in externalcontext. If the value of the "clientid" key in the map is not empty, create a javax. faces. event. actionevent, and pass the event
In the queueevent () of the component, and then add the component ID in the rereander area to the rereander attribute. in the encoding process. do not encode a component. on the contrary, add a binding with the same value as the event property on the parent component. result: When rendering, the parent component creates a JS Code used to submit an Ajax request. if this component has a sub-uiparameter component, add its name/value as the additional request parameter. if the parent component is an instance of uiinput and the ajaxtype attribute is input, the value in the input field is also submitted. in this case, you can submit a single input field outside uiform.
A4j: Support attributes

Actionlistener
Method binding. When the component is activated by an Ajax request, the listener method is called to handle the event. The method must be public and receive an ajaxevent parameter. Void is returned.

Action
Method is bound to the Action Method of the program to be activated.
Uicomponent is activated by the user. According to the value of the immediate attribute, the method is called in the apply request values or invoke application stage of the request processing lifecycle.

Oncomplete
JS Code called when the client request is complete

Rendered
If this parameter is set to false, the component is not displayed.

Status
ID of the Request status component (used in uicomopnent. findcomponent)

Rerender
This component calls the Ajax request and re-renders the component ID (used in uicomopnent. findcomponent ().
Multiple IDs separated by commas, or El expressions in the data or set.

Targetid
Rerender alias: the component that is re-rendered after calling the Ajax request.
ID (used in uicomopnent. findcomponent ()
IDs. You can also separate multiple IDs by commas (,), or El of the data or set.
Expression

ID
Each component should have a unique ID. If it is not specified, it will be automatically generated.

Disabledefault
Make the action of the target event unavailable (Add "Return false;" in JavaScript code ;")

Requestdelay
Delay in JS events (unit: Ms.) Sending Ajax requests. Public work with the event queue can reduce the number of times the keyboard or mouse moves trigger requests

Eventsqueue
The name of the queue used to avoid repeated requests on the same event. It can be used to reduce the number of requests for periodic events (such as buttons and mouse movement.

Bypassupdates
If this parameter is set to true, the update model value phase to the rendering phase is skipped after the verification phase is processed. It can be used to verify the input value of the component.

Immediate
If this component is activated by an Ajax request, it should be immediately marked
Application request value stage) is processed by interested listeners and actions, rather than waiting
To the application call stage.
Mark indicates that the meaning is similar, skipping the verification phase to the rendering response phase)

Limittolist
If this parameter is set to true, only the specified component in the 'rerender' attribute is updated. Otherwise
(Default) update all components in Ajax Region

Ajaxsingle
If it is true, only one field/link is submitted, instead of the entire form.
Content.

Event
Name of the JS event attribute of the parent component (onclick, onchange,
Etc.), for which we will build Ajax submission code.

Binding
Component binding.
All the things you need to specify-the parent component is used to trigger the Ajax request event and the region of the rerender, And the Java Bean method for processing the event.
Code:

 <a4j:region selfRendered="true"> 
<a4j:support event="change" reRender="#{partsId.list}"
action="#{Some.show_hide}"/>
</a4j:region>

Therefore, in the preceding example, the status change of the checkbox will be submitted to the current region. the 'show _ hide 'action is called, and the component specified by the ID in 'LIST' is updated.

A4j: commandlink
Presents an HTML <A> element. When you click an HTML file, the action is similar to a form submission.
In the decoding process:
Obtain a map from the requestparametermap attribute of externalcontext. If the map contains non-null values of the "clientid" Key, create a javax on the component. faces. event. actionevent event, and pass the event to the queueevent () method of the component. if the request is Ajax-receivmed, add the ids value in the rerander attribute to the rendered areas list of the nested ajaxcontainer and add the component parameters during decoding.
(Param_name and param_value are the names and values of any nested sub-uiparameter .) names and values must have been processed by urlencoded. if the styleclass attribute is specified, its value is the value of the class attribute in HTML. presents any non-uiparameter sub-component as the corresponding sub-component of <A>. these look like a link
This.
A4j: commandlink

Actionlistener
Method binding. When the component is activated by an Ajax request, the listener method is called.
Process this event. This method must be public and accept an ajaxevent
Parameter, return void.

Title
The prompt text generated by this component to mark the elements (when you move the mouse over this component)
Prompt text)

Oncomplete
JS Code called when the client request is complete

Shape
Default | rect | circle | Poly [CI] This attribute specifies the shape of a region. possible value: * default: Specifies the entire region. * rect: Specifies a rectangular area. * circle: defines a circular area. * poly: defines a polygon area.

Rendered
If this parameter is set to false, the component is not displayed.

Charset
This attribute specifies the character encoding of resources assigned through links.

Rerender
The ID of the component that is re-rendered after calling the Ajax request (used in uicomopnent. findcomponent ().
Multiple IDs separated by commas (,), or El expressions of the data or set.

Targetid
Alias for rerender: the group that the component re-renders after calling the Ajax request.
The ID of the component (used in uicomopnent. findcomponent ().
IDs. You can also separate multiple IDs by commas (,), or El of the data or set.
Expression

ID
Each component should have a unique ID. If it is not specified, it will automatically
Generate.

Dir text direction.
Rev
This attribute is used to describe
Reverse link. This attribute value is a column of the link type (value) separated by spaces.
Table.

Bypassupdates
If true, skip the update model value phase to the rendering level after the verification phase is processed.
Segment. It can be used to verify the input value of the component.

Styleclass
Same as the class attribute of HTML.

Accesskey
The shortcut key that triggers this component.

Limittolist
If this parameter is set to true, only the components specified in the 'rerender' attribute are updated. Otherwise, all components in Ajax region are updated.

Onkeypress
Keyboard Events, keys are pressed and released

Ajaxsingle
If true is used, only one field/link is submitted, instead of all

Ondblclick HTML: Double-click event
Style HTML: CSS applied to this component.
Onblur event when the element loses focus
Onmouseover
When the mouse moves above the component
Onkeyup when the user presses and releases the button
Value the current value of the component.

Action
Method is bound to the Action Method of the program to be activated, if the uicomponent
The method is activated by the user. Based on the value of the immediate attribute
Apply request values or invoke application level in the cycle
Segment is called.

Tabindex sets the sequence in which the focus is obtained between different elements.

Hreflang
This attribute specifies the basic language of the resource assigned through href, and only
Href is used when it is specified (that is, if
The hreflang attribute should not appear ).

Type
This attribute specifies the content type used by the linked resource. (Translator's note: for example, webpage access
Usually text/html)

Lang generates the language used by this component flag

Onclick
Events that occur when you click the mouse
ID of the Status Request status component (used in uicomopnent. findcomponent)
Events that occur when the onmouseout mouse moves the element away
Event that occurs when the onkeydown key is pressed
Events that occur when the onmousedown button is pressed

Requestdelay
Delay in JS events (unit: Ms.) Sending Ajax requests.
Working together can reduce the number of times that the keyboard or mouse moves trigger requests

Eventsqueue
The name of the queue used to avoid repeated requests on the same event.
Reduce the number of requests for periodic events (such as buttons and mouse movement.
REL
This attribute describes the anchor between the current document and the anchor defined through the href attribute.
. This attribute value is a list of link types (values) separated by spaces.
Note: In Web standard development, this is usually used to replace the target
With the script to indicate the target window ).

Immediate
If this component is activated by an Ajax request, it should be immediately marked
Request value stage) is processed by interested listeners and actions, rather than waiting for
Use the application phase.
The meaning is almost the same. Skip the verification phase to present the response phase)

Onfocus is an event that occurs when an element obtains focus in a form element.
Onmouseup events that occur when the mouse button is released
Binding the binding component.
Event that occurs when the onmousemove cursor moves over the element
Coords
Define a region-coords
A. rectangle: four digits are required. The first two digits are coordinates in the upper left corner and the last two digits
Digits are coordinates in the lower right corner.
Example:Code:

<area shape=rect coords=100,50,200,75 href="URL" 

B. Circle: three digits must be used. The first two digits are the coordinates of the center.
A number is the radius length.
Example:Code:

<area shape=circle coords=85,155,30 href="URL"> 

C. Any image (polygon): Fill in the coordinates of each turning point of the image in order
Example:Code:

<area shape=poly 
coords=232,70,285,70,300,90,250,90,200,78 href="URL">

Generally, a4j: commandlink is an HTML with Ajax support.

<Input> element. Contains
Some a4j: The main functions of support, as well as its own onclick event Ajax requests and all
Commandlink feature in combination with a4j: support.

A4j: commandbutton
Displays an HTML "input" element.
In the decoding process:
Obtain a map from the requestparametermap attribute of externalcontext. If the map contains non-null values of the "clientid" Key, create a javax on the component. faces. event. actionevent event, and pass the event to the queueevent () method of the component. if the request is Ajax-receivmed, add the ids value in the rerander attribute to the rendered areas list of the nested ajaxcontainer. in the encoding process: Create an Ajax for The onclick event. submit JavaScript call. the clientid of the rendering component is the value of the name attribute. the current value of the rendering component is the value of the value attribute. if the styleclass attribute is specified, its value is the value of the class attribute. displays the child element of the HTML "input" element.

A4j: commandbutton
Actionlistener
Method binding. When the component is activated by an Ajax request, the listener method is called.
Process this event. This method must be public and accept an ajaxevent
Parameter, return void.

Title
The prompt text generated by this component to mark the elements (when you move the mouse over this component)
Prompt text)

Oncomplete JS Code called when the client request is complete

If rendered is set to false, the component will not be displayed.

Rerender
The ID of the component that is re-rendered after the component calls the Ajax request (
Uicomopnent. Used in findcomponent (), you can make an ID or
Multiple IDs separated by commas (,), or El expressions of the data or set.

Targetid
Alias for rerender: the group that the component re-renders after calling the Ajax request.
The ID of the component (used in uicomopnent. findcomponent ().
IDs. You can also separate multiple IDs by commas (,), or El of the data or set.
Expression

Onchange
An event that occurs when something changes in a form element.

Dir text direction.

ID
Each component should have a unique ID. If it is not specified, it will be automatically generated.

Bypassupdates
If this parameter is set to true, the update model value phase to the rendering phase is skipped after the verification phase is processed. It can be used to verify the input value of the component.

Styleclass and HTML have the same class attributes.

Accesskey

Limittolist
If this parameter is set to true, only the components specified in the 'rerender' attribute are updated. Otherwise, all components in Ajax region are updated.

Onkeypress keyboard event, the key is pressed and released

If ajaxsingle is set to true, only one field/link is submitted, instead of all

Ondblclick HTML: Double-click event

Image
The absolute or relative URL of the image to be displayed in this button. If this "input" element is specified, it will be of the "image" type.

Style HTML: CSS applied to this component.

Size defines the scale displayed by the component.

Events that occur when the onblur loses focus

Onmouseover when the mouse moves over the component

Value the current value of the component.

Action
Method is bound to the Action Method of the program to be activated, if the uicomponent
The method is activated by the user. Based on the value of the immediate attribute
Apply request values or invoke application level in the cycle
Segment is called.

Onkeyup when the user presses and releases the button

Tabindex sets the sequence in which the focus is obtained between different elements.

Lang generates the language used by this component flag

Type
Submit | reset | image | button specifies the type of the component to be created. The default value is
Submit.

Disabled sets the control status to unavailable

Onclick events that occur when the mouse clicks

ID of the Status Request status component (used in uicomopnent. findcomponent)

Events that occur when the onmouseout mouse moves the element away
Alt text direction.
Event that occurs when the onkeydown key is pressed
Events that occur when the onmousedown button is pressed

Requestdelay
Delay in JS events (unit: Ms.) Sending Ajax requests. Public work with the event queue can reduce the number of times the keyboard or mouse moves trigger requests

Eventsqueue
The name of the queue used to avoid repeated requests on the same event. It can be used to reduce the number of requests for periodic events (such as buttons and mouse movement.

Immediate
If the component is activated by an Ajax request, it should be immediately (in the application request value phase) processed by interested listeners and actions, rather than waiting until the application call phase. (Note: This tag is similar to the immediate tag in JSF. It skips the verification phase to the rendering response phase)

Onfocus events that occur when the component gets the focus

Onmouseup events that occur when the mouse button is released

Binding the binding component.

Event that occurs when the onmousemove cursor moves over the element

In short, a4j: commandbutton is an HTML <input> element with Ajax support. including all the main features of a4j: support, as well as its own onclick event Ajax requests and all commandbutton features combined with a4j: support.

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.