Guest User

Untitled

a guest
Jun 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. public static String renderNumericQuestion(FacilityDataFormQuestion formQuestion) {
  2. String out = "<tr align=\"right\">\n ";
  3. out += "<td width=\"50%\" align=\"right\">";
  4. out += formQuestion.getDisplayName().get(locale);
  5. out += "</td>\n ";
  6. out += "<td width=\"50%\" align=\"left\">\n ";
  7. out += "<input type=\"text\" size=\"5\" name=\"";
  8. out += formQuestion.getQuestionNumber();
  9. out += "\"/>\n ";
  10. out += "</td>\n";
  11. out += "</tr>";
  12. return out;
  13. }
  14.  
  15. ## Now with StringBuilder
  16. public static String renderNumericQuestion(FacilityDataFormQuestion formQuestion) {
  17. StringBuilder sb = new StringBuilder();
  18. sb.append("<tr align=\"right\">\n ").
  19. append("<td width=\"50%\" align=\"right\">").
  20. append(formQuestion.getDisplayName().get(locale)).
  21. append("</td>\n ").append("<td width=\"50%\" align=\"left\">\n ");
  22. sb.append("<input type=\"text\" size=\"5\" name=\"");
  23. sb.append(formQuestion.getQuestionNumber());
  24. sb.append("\"/>\n ");
  25. sb.append("</td>\n");
  26. sb.append("</tr>");
  27. return sb.toString();
  28. }
Add Comment
Please, Sign In to add comment