My page display list Category Name. i want to when user clicks category name , it will
display list product by category name. in this code, i want to passing CateogryId as value of h:inputHidden. it's same as <h:inputText value="#{produtBean.categoryId}"></h:inputText>
.
Tkanks you for reading !
Code from xhtml
<ui:repeat value="#{productBean.listCategory}" var="c">
<h:form>
<h:inputHidden value="#{productBean.categoryId}" ></h:inputHidden>
<h:commandLink value="#{c.name}" action="#{productBean.listProductByCt}" ></h:commandLink>
</h:form>
</ui:repeat>
Code from ProductBean
public String listProductByCt()
{
if(categoryId==0)
{
return "index";
}
listProduct = new ProductsDB().listProducts(categoryId);
return "product";
}