Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String renderNumericQuestion(FacilityDataFormQuestion formQuestion) {
- String out = "<tr align=\"right\">\n ";
- out += "<td width=\"50%\" align=\"right\">";
- out += formQuestion.getDisplayName().get(locale);
- out += "</td>\n ";
- out += "<td width=\"50%\" align=\"left\">\n ";
- out += "<input type=\"text\" size=\"5\" name=\"";
- out += formQuestion.getQuestionNumber();
- out += "\"/>\n ";
- out += "</td>\n";
- out += "</tr>";
- return out;
- }
- ## Now with StringBuilder
- public static String renderNumericQuestion(FacilityDataFormQuestion formQuestion) {
- StringBuilder sb = new StringBuilder();
- sb.append("<tr align=\"right\">\n ").
- append("<td width=\"50%\" align=\"right\">").
- append(formQuestion.getDisplayName().get(locale)).
- append("</td>\n ").append("<td width=\"50%\" align=\"left\">\n ");
- sb.append("<input type=\"text\" size=\"5\" name=\"");
- sb.append(formQuestion.getQuestionNumber());
- sb.append("\"/>\n ");
- sb.append("</td>\n");
- sb.append("</tr>");
- return sb.toString();
- }
Add Comment
Please, Sign In to add comment