-------value-------
Take the page Input_kh parameter value, and go to the leading and trailing spaces
String Ls_kh=getpara ("Input_kh"). Trim ()
Take page date and convert to unsigned format
String Ls_a17s=base.fn_dataformat (Getpara ("sdate"). Trim ());
Fetch the SQL return value and return to the list
list<record> retlist = Db.find (Ls_sql);
Take list Row Records
Record map = (record) retlist.get (i);
Data conversion characters
Record map = (record) retlist.get (i);
Object ob = Map.get ("A25");//first turn data into
Str_a25=ob.tostring ();
Loop through the row record and add a list detail
for (int i=0;i<retlist.size (); i++) {
Record map = (record) retlist.get (i);
Object ob = Map.get ("A25");//first turn data into
Str_a25=ob.tostring ();
String ls_sql2= "Select A27,a28,sum (A13) A13 from GKKC where a13>0 and a25=" +str_a25+ "Group by A27,a28";
list<record> retlist2 = Db.find (LS_SQL2);
Add a list detail
Map.set ("Listmx", retlist2);
}
-------return-------
return string
SetAttr ("Retlist", "OK");
Return to list and return to page
SetAttr ("Retlist", retlist);
Render ("/wxbb/r1.jsp");
Return JSON format
Renderjson ();
-------Page Receive--------
jfinal Example
<ul class= "Mui-table-view mui-table-view-striped mui-table-view-condensed" >
<li class= "Mui-table-view-cell" >
<c:choose>
<c:when test= "${retlist== null | | fn:length (retlist) = = 0}" >
Countless data
</c:when>
<c:otherwise>
<c:foreach items= "${retlist}" var= "Retlist" >
<div class= "Mui-table" >
<div class= "Mui-table-cell mui-col-xs-10" >
<p class= "Mui-h6 mui-ellipsis" > Quantity:${retlist.a5}
Price: <fmt:formatnumber type= "number" value= "${retlist.a6}" pattern= "0.00" maxfractiondigits= "2"/>
Amount: <fmt:formatnumber type= "number" value= "${retlist.a7}" pattern= "0.00" maxfractiondigits= "2"/>
</p>
<p class= "Mui-h6 mui-ellipsis" > Lot number:${retlist.a27} validity period:${retlist.a28}</p>
<p class= "Mui-h6 mui-ellipsis" > Customer name:${retlist.kh_name}</p>
</div>
<div class= "Mui-table-cell mui-col-xs-2 mui-text-right" >
<span class= "Mui-h5" ></span>
</div>
</div>
</c:forEach>
</c:otherwise>
</c:choose>
</li>
</ul>
<div style= ' Text-align:center ' >
<br/> No data
</div>
Ajax Receive Example
$.ajax ({
URL:LS_FNSTR,--Address format ls_apppath+ method + '? ' + Parameters
Type: ' Post ',
Success:function (data)
{
document.getElementById (' data3 '). Innerhtml=data.retlist;
}
});