If you look at the buttom of the page you can download these samples
incl. the source. There you can also find the java classes like the CarBean:
package jsftags;
import java.util.*;
import javax.faces.model.SelectItem;
public class CarBean {
ArrayList car = new ArrayList();
ArrayList carList = new ArrayList();
SelectItem currentCar;
public CarBean() {
carList.add(new SelectItem("accord","Honda Accord","Honda Accord -
sedan"));
carList.add(new SelectItem("4runner","Toyota 4Runner","Toyota
4Runner - suv"));
carList.add(new SelectItem("nissan-z","Nissan Z350","Nissan Z350 -
sports"));
}
public SelectItem getCurrentCar () {
return new SelectItem("4runner","Toyota 4Runner","Toyota 4Runner -
suv");
}
public void setCurrenteCar (SelectItem item) {
currentCar = item;
}
public Object[] getCar() {
return car.toArray();
}
public void setCar(Object[] newCar) {
int len=0;
if (null == newCar || ( len = newCar.length)==0 ) {
return;
}
car.clear();
car = new ArrayList(len);
for ( int i=0;i<len;i++) {
car.add(newCar[i]);
}
}
public ArrayList getCarList() {
return this.carList;
}
public void setCarList(ArrayList _carList) {
this.carList = _carList;
}
}
Aneesha Govil schrieb:
On 9/21/06, *Stefan Puchmann* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Hi,
look at this page:
http://www.exadel.com/tutorial/jsf/jsftags-guide.html
cheers,
Stefan
I've looked at that. It doesn't tell me how to code in a Java Bean.
Can anyone provide any other resources for a sample? I have written
some code but the selected item is not getting populated into the
bean. :(
Please help.
Thanks.