Skip to main content

Posts

Showing posts from May, 2007

Simple JSF

Here my snippet that working successfully... The page is where user can view ,add,delete and edit the data in the same page. My Managed bean public class MyBean { private List myDataList ; private HtmlDataTable myDataTable ; //bind private MyData myDataItem = new MyData (); private boolean editMode = false ; private String status = "" ; private MyDataAccess da = new MyDataAccess (); /** Creates a new instance of MyBean */ public MyBean () { loadMyDataList (); } public void loadMyDataList (){ //my dao thing try { myDataList = da . retrieveNationalityList (); } catch ( Exception ex ) { System . out . println ( "Something error while loadMyDataList..." ); ex . printStackTrace (); } } public List getMyDataList () { if ( FacesContext . getCurrentInstance (). getRenderResponse ()){ loadMyDataList (); } return myDataList ; } public void setMyDataList ( List myDataList ) { this . myDataList = myDataLi