RichFaces Interview Questions and Answers
Experienced / Expert level questions & answers
Ques 1. What is <a4j:support> tag?
Sends an
Ques 2. How to control traffic in RichFaces?
Ques 3. How to keep a managed bean between requests?
Ques 4. How to different skins are runtime?
Ques 5. Tell me about a4j:outputPanel and ajaxRendered?
"ajaxRendered" attribute of the <a4j:outputPanel> set to "true" allows to define the area of the page that will be re-rendered even if it is not pointed in the reRender attribute explicitly. It might be useful if you have an area on a page that should be updated as a response on any
Ques 6. What is limitToList attribute?
Ques 7. What is the use of eventsQueue?
Ques 8. How to handle request errors and session expire on client side?
Ques 9. What is a4j:ajax?
a4j:ajax is one of our core behaviors, extending the base JSF 2.0 f:ajax tag. This tag triggers an Ajax request when the specified parent event is triggered.
<
h:inputText
value
=
"#{userBean.name}"
>
<
a4j:ajax
event
=
"keyup"
render
=
"out"
/>
</
h:inputText
>
<
h:outputText
value
=
"#{userBean.name}"
id
=
"out"
/>
Ques 10. What is a4j:actionListener in RichFaces?
Use a4j:actionListener to register an ActionListener class on a parent action component. Multiple listener methods can be registered on an action components in this way.
The a4j:actionListener tag differs from the standard JSF tag in that it allows the listener to be attached in any of three ways:
- By listener method, using the listener attribute.
- By listener class, using the type attribute.
- By object binding, using the binding attribute.
<
h:commandButton
value
=
"Update"
>
<
a4j:actionListener
listener
=
"#{bean.actionMethod}"
/>
<
f:ajax
render
=
"messages"
/>
</
h:commandButton
>
Ques 11. What is a4j:jsFunction in RichFaces?
The a4j:jsFunction component creates a JavaScript function that allows you to send JSF Ajax requests from any JavaScript. You define the Ajax and JSF properties just like a4j:ajax, or a4j:commandButton, and a4j:jsFunction creates the JavaScript for you. The component sends a request using the standard JSF mechanisms. Note that this means a JSF form is required.
The following example shows how to use a4j:jsFunction to create a function named updateName. This is then called on mouseover of the different names. This triggers the full round trip Ajax request and renders the updated name.
<
span
onmouseover
=
"updateAddress('WithoutBook')"
onmouseout
=
"updateAddress('')"
>WithoutBook</
span
>
<
a4j:jsFunction
name
=
"updateAddress"
render
=
"showAddress"
>
<
a4j:param
name
=
"address"
assignTo
=
"#{bean.address}"
/>
</
a4j:jsFunction
>
Ques 12. What is rich:tree in RichFaces?
The rich:tree component renders a tree control on the page. The most important tree features include the following:
- Native support for Ajax operations
- Support for ajax, client, and server switch types
- Selection capabilities
- Flexible look and feel
<
rich:tree
id
=
"tree"
nodeType
=
"#{node.type}"
var
=
"node"
value
=
"#{bean.rootNodes}"
toggleType
=
"client"
selectionType
=
"ajax"
selectionChangeListener
=
"#{bean.selectionChanged}"
>
<
rich:treeNode
type
=
"country"
>
#{node.name}
</
rich:treeNode
>
<
rich:treeNode
type
=
"company"
iconExpanded
=
"/images/ctry.gif"
iconCollapsed
=
"/images/tree/disc.gif"
>
#{node.name}
</
rich:treeNode
>
<
rich:treeNode
type
=
"cd"
iconLeaf
=
"/images/tree/cd.gif"
>
#{node.artist} - #{node.name} - #{node.year}
</
rich:treeNode
>
Is it helpful?
Add Comment
View Comments
Most helpful rated by users:
- What is RichFaces?
- What is rich:dataGrid in RichFaces?
- What are the basic configurations of web.xml for Rich Faces?
- What is limitToList attribute?
- What is rich:messages in RichFaces?