1 package transactions; 2 3 import dinamica.*; 4 5 15 public class Projects extends GenericTransaction 16 { 17 18 25 public int service(Recordset inputParams) throws Throwable 26 { 27 28 super.service(inputParams); 29 30 Recordset rsData = getRecordset("query.sql"); 32 Recordset rsEmployees = getRecordset("employees.sql"); 33 34 TemplateEngine comboBox = new TemplateEngine( getContext(), getRequest(), getResource("combo.htm") ); 36 comboBox.replace(rsEmployees,"","rows"); 37 String template = comboBox.toString(); 38 39 rsData.top(); 41 while (rsData.next()) 42 { 43 String c = getComboBox(template, rsData); 47 48 rsData.setValue("combobox", c); 50 } 51 52 return 0; 53 54 } 55 56 64 String getComboBox(String template, Recordset rs) throws Throwable 65 { 66 TemplateEngine t = new TemplateEngine(getContext(), getRequest(), template); 67 t.setComboValue("manager_id", rs.getString("manager_id")); 68 return t.toString(); 69 } 70 71 } 72 | Popular Tags |