I am using Primefaces and I have a problem that the setPropertyActionListener isn't fired and thus isn't setting a property of a view scoped managed bean.
My view:
<p:column>
<p:commandLink value="Supprimer" oncomplete="confirmation.show()" >
<f:setPropertyActionListener value="#{car}" target="#{typeMB.selectedType}" />
</p:commandLink>
</p:column>
The managed-bean has the selectedType property for which there is both a getter and a setter.
My managed bean:
@ManagedBean(name="typeMB")
@ViewScoped
public class TypeManagedBean implements Serializable {
private static final long serialVersionUID = 1L;
private Type newtype;
private Type selectedType;
@ManagedProperty(value="#{TypeDao}")
GenericDao<Type> typeDAO;
public TypeManagedBean(){
newtype = new Type();
}
public List<Type> getList_types() {
return typeDAO.readAll();
}
public void setTypeDAO(GenericDao<Type> typeDAO) {
this.typeDAO = typeDAO;
}
public GenericDao<Type> getTypeDAO() {
return typeDAO;
}
public Type getNewtype() {
return newtype;
}
public void setNewtype(Type newtype) {
this.newtype = newtype;
}
public Type getSelectedType() {
if(selectedType != null)
System.out.println("get : le selected type : "+selectedType.getLibelle());
return selectedType;
}
public void setSelectedType(Type selectedType) {
this.selectedType = selectedType;
System.out.println("set le selected type : "+selectedType.getLibelle());
}
}
What can I do to achieve what I want?