return EVAL_BODY_INCLUDE;
}
public int doEndTag() throws JspException {
String findClickAction = "";
ColumnLabels label=new ColumnLabels();
String labelText="";
String findClickActionSort = "";
try {
Writer out = pageContext.getOut();
out.write("<div id=\"" + id
+ "ContentField\" class=\"tableContentField\">");
out.write("<input type=\"hidden\" id=\"" + this.id
+ "Sort\" value=\""+this.defaultColumnSort+"\"> "
+ "<input type=\"hidden\" id=\"" + this.id
+ "SortDir\" value=\""+this.defaultColumnSortDir+"\">");
out.write("<div id=\"" + id
+ "FilterField\" class=\"tableFilterField\">");
for (FilterBean element : filters) {
String filerHtml =element.getBody().replace(element.getName(), element.getName()+id);
String filterId = element.getName() + id;
out.write(filerHtml);
if (!"".equals(filtersArrayJS)) {
filtersArrayJS = filtersArrayJS + ",'" + filterId
+ "'";
} else {
filtersArrayJS = "'" + filterId + "'";
}
}
String projections = "";
for (ColumnBean columnBean : columnList) {
if (!ValidatorUtil.isBlankOrNull(projections)) {
projections += ",";
}
projections = projections + "'" + columnBean.getColumn() + "'";
}
findClickAction = "\"tableRefresh('" + id + "',new Array("
+ filtersArrayJS + "),new Array(" + projections + "), "
+ tableAjaxActionClass + "." + tableAjaxActionMethod
+ ")\"";
out.write("<button id=\"" + id + "FindButton\" onclick="
+ findClickAction + ">znajdz</button>");
out.write("</div>");
String filterParameter = "div#" + id + "ContentField div#" + id
+ "FilterField";
out.write("<table id=\"" + id
+ "\" border=\"1\" class=\"standardTable\">");
if (title != null) {
out.write("<caption onclick=\"switchFilter('" + filterParameter
+ "')\">" + title);
out.write("<button class=\"filterTableButton\"></button>");
out.write("</caption>");
}
out.write("<tr>");
for (ColumnBean columnBean : columnList) {
//wyswietla label jesli nie ma w tablicy wartosci odpowiadajacych
//parametrom. Mozna zmodyfikowac, do wyswietlania komunikatu.
if (columnBean.getLabel()==null) {
labelText=label.getLabelByName(columnBean.getColumn(),columnBean.getSource());
}
else {
labelText=(columnBean.getLabel());
}