<f:view>
<h1>Tipos de Produtos Cadastrados</h1>
<rich:modalPanel id="deletePanel">
Tem certeza que deseja excluir o elemento?
<a4j:form id="form2" ajaxSingle="true">
<table width="100%">
<a4j:commandButton value="Sim" ajaxSingle="true"
action="#{productTypeList.removeProductType}"
oncomplete="#{rich:component('deletePanel')}.hide()"
reRender="tabProductTypes"/>
<a4j:commandButton value="Cancelar"
onclick="#{rich:component('deletePanel')}.hide()"/>
</table>
</a4j:form>
</rich:modalPanel>
<h:form>
<rich:dataTable id="tabProductTypes" rowKeyVar="row" value="#{productTypeList.productTypes}"
rendered="#{not empty productTypeList.productTypes}"
align="center" var="dataItem">
<rich:column sortBy="#{dataItem.name}">
<f:facet name="header">
<h:outputText value="Tipo de Produto"/>
</f:facet>
<h:outputText value="#{dataItem.name}"/>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Descricão"/>
</f:facet>
<h:outputText value="#{dataItem.desc}"/>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Acões"/>
</f:facet>
<a4j:commandLink id="delete" ajaxSingle="true" onclick="return #{rich:component('deletePanel')}.show();">
<h:graphicImage url="/pics/remove.png"/>
<f:setPropertyActionListener value="#{dataItem.id}" target="#{productTypeList.id}"/>
</a4j:commandLink>
</rich:column>
</rich:dataTable>
</h:form>
</f:view>
E este é o meu bean:
public class ProductTypeListBean {
private List<ProductType> productTypes;
private int id;
/**
* @return the productTypes
*/
public List<ProductType> getProductTypes() throws Exception {
System.out.println("***********************BUSCANDOOOOOOOOOOOOOOOOo");
return new ProductTypeDAO().getAllTypes();
}
/**
* @param productTypes the productTypes to set
*/
public void setProductTypes(List<ProductType> productTypes) {
this.productTypes = productTypes;
}
public void removeProductType() {
System.out.println(" removendooooooooooooooooooooooooooooooo "+
this.id);
}
/**
* @return the id
*/
public int getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(int id) {
}
Alguma idéia do que possa estar acontecendo??? ]
Muito Obrigado!