Home > Web Front-end > JS Tutorial > body text

[JSF] Example code for using DataModel to handle table row events_javascript skills

WBOY
Release: 2016-05-16 17:26:58
Original
955 people have browsed it

For example, there is a goodsList in the Goods class that stores all the current products. The code of the page is:
js code

Copy code The code is as follows:



...








...



Goods The categories are as follows:

java code

Copy code The code is as follows:

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";
}
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!