Whenever a JWL get action is run against the component parent panel (for example, as the result of a button click), the client requests the alternative content for the panel and if it is available, it replaces the existing content of the panel with the new content. The page containing the panel is not replaced by the get, instead, this tag allows part of the page to be replaced. The revised content for the page is retrieved from the same JSP that the original content came from. Both the server lifecycle copy of the page and the client-side page are kept in sync. The new page content is retrieved using a get HTTP request operation (as opposed to ajaxRefreshSubmit which does the same operation but using a post HTTP request. As a get is performed, any values that are needed on the server so that the content can be correctly computed are added as parameters to the URL.
<factory> <faces-context-factory> com.ibm.faces.context.AjaxFacesContextFactory </faces-context-factory> <render-kit-factory> com.ibm.faces.renderkit.AjaxRenderKitFactory </render-kit-factory> </factory>
<h:panelGroup id="panel1"> <hx:ajaxRefreshRequest onerror="return doError(this, event);"/> </h:panelGroup>
<h:outputText id="otext2" escape="false" rendered="#{param.text1 != null}" value="You typed:<b> #{param.text1}</b>"/>
<hx:ajaxRefreshRequest onerror="return doError(this, event);" params="text1"/>
<hx:commandExButton type="button" value="Enter" id="button1"> <hx:behavior event="onclick" behaviorAction="get;stop" targetAction="panel1"/> </hx:commandExButton>
The Properties view for a component shows the most common set of attributes you can set on a component, and, depending on the component, you might also see options for adding controls, actions, or other components. To open the Properties view, click
.The common attributes for the Get Content component are listed in the table below.
The All Attributes view shows a table
of all the attributes you can set on a component, which includes those attributes
you can access from the Properties view. To switch to the All Attributes view,
click the All Attributes icon in the upper right
corner of the Properties view.
Attribute name |
Description |
---|---|
binding |
An expression that binds the component's instance (usually a user interface component) to a bean property (usually in the backing file). |
id |
Assigns a name to a component. Should be a unique name within a JSP. |
inProgress |
Attribute is not yet available. |
rendered |
Can be set to true or false:
|
params |
The value of these tags will be retrieved and appended as params to the URL used to get the new content. The name of the param will be the simple ID provided. For example, if the ID is "text1", the param will be named "text1" (not "form1:text1"). |
target |
Assigns the target frame within a frameset that a page
should be loaded into when the hyperlink is clicked:
|
title |
Specifies the title text, shown in browser as a tooltip at runtime. Used by a browser as the alternative text of a component if the alternative text is not specified. |
oncomplete |
If a request succeeds, after the content of the panel is replaced, this JavaScript™ is executed. The function has no meaningful arguments. |
onerror |
If provided, a JavaScript function to be executed when onblur fires and the field value fails validation. The function is executed before the action is executed. If the function returns false, the action is not run and processing of the event is halted (if the DOM halts it). |
onstart |
When the behavior starts executing, this JavaScript function is executed. It has no meaningful arguments. If it returns false execution is halted. This function can be used (in conjunction with oncomplete to customize what is displayed while the request is in progress. |