Prepare Interview

Exams Attended

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

RichFaces Interview Questions and Answers

Intermediate / 1 to 5 years experienced level questions & answers

Ques 1. How to pass parameters to a4j:commandButton?

See the example to pass parameters to a4j command button:

<a4j:commandButton ajaxSingle="true" value="Update" reRender="name, job,
            out"  status="commonstatus">
            <a4j:actionparam name="n" value="Mark Joe"  assignTo="#{userBean.name}" />
            <a4j:actionparam name="j" value="WithoutBook"  assignTo="#{userBean.job}" />
</a4j:commandButton>
a4j:actionparam is the name by which you can get the value in your Handler/Bean.

Is it helpful? Add Comment View Comments
 

Ques 2. How to send and ajax request?

There are different ways to send Ajax requests from your JSF page. For example you can use <a4j:commandButton>  ,  <a4j:commandLink><a4j:poll>   or  <a4j:support>  tags or any other.
All these tags hide the usual JavaScript activities that are required for an  XMHTTPRequest object building and an Ajax request sending. Also, they allow you to decide which components of your JSF page are to be re-rendered as a result of the Ajax response (you can list the IDs of these components in the  "reRender"  attribute).

Is it helpful? Add Comment View Comments
 

Ques 3. How to upload files in richfaces?

Using rich:fileUplaod.

rich:fileUpload is a component which provides files upload functionality and extends functionality of standard input with type=file.
We can have different characteristics with this component like: allowed file types, maximum files quantity, and immediate upload.
It supports immediate upload as soon as a file is selected with this component.
<rich:fileUpload  id="fileUploadId"
 autoclear="true"
 uploadListClass="uploadList"
 fileEntryClass="fileEntry"
 allowFlash="auto"
 styleClass="richFileUpload"
 fileUploadListener="#{handler.documentUpload}"
 maxFilesQuantity="#{constants.FILE_UPLOADLIMIT}"
 required="true"
 immediate="true"
 listHeight="1px"
 listWidth="71px"
 onupload="onFileUploadClick();"
 addControlLabel="#{constants.Label_Browse}"
 immediateUpload="true"
 noDuplicate="true"
 onadd="addFileListener(event)">
<a4j:support event="onuploadcomplete" immediate="true" reRender="hiddenVal,docTableId,uploadErrorGrid,docSelectedMsgID,exceptionMessageGrid"/>
</rich:fileUpload>

Is it helpful? Add Comment View Comments
 

Ques 4. What is a4j:param in RichFaces?

The a4j:param component extends the regular f:param tag. The primary extension is the ability to assign a value to a property on a managed bean directly using the assignTo attribute. Using this feature you can update model values without invoking a single line code.

<a4j:commandButton value="Update Name" render="rep">
    <a4j:param value="WithoutBook" assignTo="#{bean.name}" />
</a4j:commandButton>

Is it helpful? Add Comment View Comments
 

Ques 5. What is a4j:status in RichFaces?

The a4j:status component is an indicator of an Ajax request. It has two states: start and stop. The start state indicates that an Ajax request is in progress. When an Ajax Response is returned, the component switches to the stop state. Give a loading progress on a ajax call:


<rich:modalPanel id="statusModalPanelId" autosized="true" resizeable="false">

        <h:graphicImage  value="/views/images/loading.gif"/>

        <a4j:status id="statusId" onstop="Richfaces.hideModalPanel('statusModalPanelId');">

                <f:facet name="start"></f:facet>

        </a4j:status>

 </rich:modalPanel>

Is it helpful? Add Comment View Comments
 

Ques 6. What is rich:messages in RichFaces?

rich:messages is an extension for a standard h:messages component. In addition to what the standard component provides, rich:messages:


<rich:messages ajaxRendered="true" />

Is it helpful? Add Comment View Comments
 

Ques 7. What is rich:dataGrid in RichFaces?

The rich:dataGrid component accepts the same data sources as other iteration components and renders them in a grid format, the same way as the h:PanelGrid component does for in-line data. To define the grid's properties and styles, use the same definitions as for the h:panelGrid component.


<rich:dataGrid value="#{bean.allEmployees}" var="emp" columns="3" elements="9" width="600px" border="0">
      <rich:panel bodyClass="pbody">
       <f:facet name="header">
               <h:outputText value="#{emp.name} #{emp.code}"></h:outputText>
          </f:facet>
          <h:panelGrid columns="2">
               <h:outputText value="Salary:" styleClass="label"></h:outputText>
Is it helpful? Add Comment View Comments
 

Ques 8. What is rich:calendar in RichFaces?

The rich:calendar component allows you to select a date using a monthly calendar widget. It is possible to use the component in a popup or inline mode. In popup mode the calendar is initially rendered as an input for date with a button on the right side to trigger the popup. For inline mode, the monthly calendar is rendered on the page initially.


<rich:calendar value="#{calendarBean.dateSelected}" id="calendar" locale="#{calendarBean.locale}" popup="#{calendarBean.popup}" datePattern="#{calendarBean.pattern}" showApplyButton="#{calendarBean.showApply}" cellWidth="24px" cellHeight="22px" style="width:200px" disabled="#{calendarBean.disabled}">
</rich:calendar>

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

Related interview subjects

Core Java interview questions and answers - Total 306 questions
Tomcat interview questions and answers - Total 16 questions
Apache Wicket interview questions and answers - Total 26 questions
Java Applet interview questions and answers - Total 29 questions
JAXB interview questions and answers - Total 18 questions
JMS interview questions and answers - Total 64 questions
Log4j interview questions and answers - Total 35 questions
Struts interview questions and answers - Total 84 questions
RMI interview questions and answers - Total 31 questions
Apache Camel interview questions and answers - Total 20 questions
JDBC interview questions and answers - Total 27 questions
Java 11 interview questions and answers - Total 24 questions
JPA interview questions and answers - Total 41 questions
EJB interview questions and answers - Total 80 questions
GWT interview questions and answers - Total 27 questions
Kotlin interview questions and answers - Total 30 questions
Glassfish interview questions and answers - Total 8 questions
Google Gson interview questions and answers - Total 8 questions
JSP interview questions and answers - Total 49 questions
J2EE interview questions and answers - Total 25 questions
Apache Tapestry interview questions and answers - Total 9 questions
Java Swing interview questions and answers - Total 27 questions
Java Mail interview questions and answers - Total 27 questions
Hibernate interview questions and answers - Total 52 questions
JSF interview questions and answers - Total 24 questions
Java 8 interview questions and answers - Total 30 questions
Java 15 interview questions and answers - Total 16 questions
JBoss interview questions and answers - Total 14 questions
Web Services interview questions and answers - Total 10 questions
RichFaces interview questions and answers - Total 26 questions
Servlets interview questions and answers - Total 34 questions
Java Beans interview questions and answers - Total 57 questions
Spring Boot interview questions and answers - Total 50 questions
JUnit interview questions and answers - Total 24 questions
Spring Framework interview questions and answers - Total 53 questions
Java Design Patterns interview questions and answers - Total 15 questions
©2023 WithoutBook