For example, there is a goodsList in the Goods class that stores all the current products. The code of the page is:
js code
...
h:commandLink>
...
Goods The categories are as follows:
java code
publicclassGoods{
.. ..
privateDateModelgoodsList;
...
publicDataModelgetGoodsList(){
if(goodsList==null){
goodsList=newDataModel();
}
goodsList.setWrappedData (getRealGoodsList());//The database is accessed here through the Service layer or Dao layer
retrungoodsList;
}
publicStringselect(){
GoodsselectedGoods=(Goods)goodsList.getRowData();
setSelectedGoods(selectedGoods);
return "success";
}
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn