Dynamic checkboxes in JSF !!!!!!!
Dear friends,
I have problem about creating Dynamic checkbox from DataBase in JSF.
I use this tag of JSF : <h:selectBooleanCheckbox..... />
I didn't know the property of my managebean?
Please put some codes with managebean for me.(JSP (create checkbox ) & Managebean for this JSF)
I can do this in struts but in JSF i can't.
Please help me to solve my problem.
Thanks,
Farzad
Message was edited by:
Farzad919
If I understood your question correctly, you want to display dynamic check box from data of db? Right?
If yes, then I store selectItem object in ArrayList and then relate Managed bean's property to selectmenu . It will display dynamic select Menu. Similarly, you can do it with checkbox. Just need to search which JSF component you need to use.
I hope this will helpful to you.
Yes, first thanks for your answers.
You understood my question exactly.
I want to do this but i have problem in jsf with creating dynamic checkbox.
I can't Set my ArrayList in managebean. The exception is like this:
javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.faces.FacesException: javax.faces.FacesException: Can't set managed bean property: 'array'.
This is my managebean :
public final class shop extends Object
{
private ArrayList array;
public String[] getArray() {
return array;
}
public void setArray(String[] array) {// This is setter for my property (array)
this.array = array;
}
}
How can i solve this problem?
If it is possible please post some code here. (With manage bean)
Thanks,
Farzad