This article mainly introduces a summary of the problems encountered in the foreach loop. It is very good and has a reference. Value, friends who need it can refer to it
1. When using "foreach loop" on the list page, the data is not displayed. At this time, you need to check your ObjectModel中# Whether the first letter of ##attribute is capitalized, remember not to capitalize it (when I was working on a project, the object model was established by someone else, and the first letter of the attribute was capitalized, which caused the data on the final list page not to be displayed. Later, I asked the teacher, It said that it was changed to lowercase and it was cured instantly).
2. The data cannot be stored in the table: When the data table column name is not specified in the mapping file, the data table column name must be the same as the attribute name (applied to the hibername operation database). 3. When using foreach, the data content that jumps from other pages to this page will not be displayed. At this time, the path to jump to this page in other pages must be changed to the access path in the browser.<table class="table_style"> <thead> <tr> <th> <input id="all" type="checkbox" onclick="selectAll();" value="checkbox"> <label>全选 </label> </th> <th>样本编号</th> <th>被检者姓名</th> <th>被检者ID</th> <th>医院名称</th> <th>样本类型</th> <th>手机</th> <th>创建时间</th> </tr> </thead> <c:forEach var="hello" items="${key}" step="1" > <tr> <td> <input type="checkbox" value="${hello.iD}" name="checkbox"> </td> <td> <a href="javascript:void(0)" rel="external nofollow" >${hello.sampleNo}</a> </td> <td>${hello.name}</td> <td>${hello.pId}</td> <td>${hello.hospitalName}</td> <td>${hello.sampleType}</td> <td>${hello.cellPhone}</td> <td>${hello.createTime}</td> </tr> </c:forEach> </table>
JavaScript Chinese Reference Manual
3.php.cn Dugu Jiujian (3) - JavaScript video tutorial
The above is the detailed content of Share an example tutorial on foreach loop problem. For more information, please follow other related articles on the PHP Chinese website!