package com.icefaces.support.example; import javax.faces.event.ActionEvent; public class TableBean { public static Person[] buildPersonList() { Person[] personsList = new Person[]{ new Person("Mary", "Smith", "555-2629", "mary.smith@icesoft.com"), new Person("James", "Johnson", "555-3318", "james.johnson@icesoft.com"), new Person("Patricia", "Williams", "555-3702", "patricia.williams@icesoft.com"), new Person("John", "Jones", "555-6589", "john.jones@icesoft.com"), new Person("Linda", "Brown", "555-4736", "linda.brown@icesoft.com"), new Person("Robert", "Davis", "555-9732", "robert.davis@icesoft.com"), new Person("Barbara", "Miller", "555-4660", "barbara.miller@icesoft.com"), new Person("Michael", "Wilson", "555-1236", "michael.wilson@icesoft.com"), new Person("Elizabeth", "Moore", "555-6653", "elizabeth.moore@icesoft.com"), new Person("William", "Taylor", "555-1481", "william.taylor@icesoft.com"), new Person("David", "Garcia", "555-1717", "david.garcia@icesoft.com"), new Person("Maria", "Jackson", "555-8414", "maria.jackson@icesoft.com"), new Person("Richard", "White", "555-1887", "richard.white@icesoft.com"), new Person("Susan", "Harris", "555-9209", "susan.harris@icesoft.com"), new Person("Charles", "Thompson", "555-2040", "charles.thompson@icesoft.com"), new Person("Margaret", "Martinez", "555-9976", "margaret.martinez@icesoft.com"), new Person("Edward", "Phillips", "555-1325", "edward.phillips@icesoft.com"), }; return personsList; } private Person[] persons = buildPersonList(); public TableBean(){ } /** * Gets the person data. * * @return table of person data */ public Person[] getPersons() { return persons; } public void clearList(ActionEvent event){ if(persons.length > 0){ persons = new Person[0]; } } public void refreshList(ActionEvent event){ if(persons.length == 0){ persons = buildPersonList(); } } }