Monday, June 9, 2014

Populating a message after a record inserted or deleted from database

Hi All, if we want to show a message after inserting a record for example. we want to show a message after inserting a student record in database "Student Created Successfully" to the user then follow these steps.

Step1:

add JSF1.2 jar to the project by right clicking on model of the current project >> Project Properties >> Libraries and Tag Libraries >> Add Library >> JSF 1.2 >> Click on OK



Step2:

Generate Impl class of Entity Object

Step3:

import following classes

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

Step4:

write following lines of code in doDML() method of impl class of entity object

        FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, null, "Student has been created");

        FacesContext.getCurrentInstance().addMessage(null, msg);


it will show you the popup message like this:




Thats it....

No comments:

Hide Query By Example of PanelCollection on page load

Hi All, If there is a table with filterable is true. If you want to display QueryByExample then surround this table with panelCollection....