These technologies are used to display the tree-like list of accounting subjects. You can also turn pages up and down. I hope to help people in need. The functions of each part are as follows:
1. JAVABEAN: DB is mainly used to obtain the account records of the database.
2. the javascript function action is mainly used to dynamically set the page to jump to based on the current account number.
3. The entire list structure is controlled by JAVA fragments.
Main Code:
<Font size = "-1"> income subject: </font> </div>
<Ul>
<%
Int pageLine = 15;
Int totalRec = 0;
Int intPage = 1;
Int I;
If (request. getParameter ("page ")! = Null)
IntPage = Integer. parseInt (request. getParameter ("page "));
Try {
TotalRec = DB. counttype (1 );
}
Catch (Exception e ){
E. printStackTrace ();
}
Int intPageCount = 0;
IntPageCount = (totalRec + pageLine-1)/pageLine;
%>
<% Collection items = DB. getkemustype (1 );
Iterator it = items. iterator ();
If (intPageCount> 0)
{
For (I = 1; I <= (intPage-1) * pageLine; I ++)
It. next ();
For (I = 1; I <= pageLine; I ++ ){
If (it. hasNext ()){
Kemudetails = (kemudetails) it. next ();
%>
<Li>
<A href = javascript: action (<% = convert (kemudetails. getKMH () %>)>
<Font size = "-1"> <% = convert (kemudetails. getNAME () %> </font> </A>
</Li>
<%
}
}
}
%>
</Ul>