Skip to content

Commit

Permalink
#527 Done, tested and documented.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanrauh committed Oct 29, 2016
1 parent 8052735 commit 183d1bb
Showing 1 changed file with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,22 @@ private void generateBody(FacesContext context, DataTable dataTable, ResponseWri
}
rw.startElement("td", dataTable);
Object contentStyle = column.getAttributes().get("contentStyle");
if (contentStyle != null) {
Object style = column.getAttributes().get("style");
if (contentStyle != null && style==null) {
rw.writeAttribute("style", contentStyle, null);
} else if (contentStyle == null && style!=null) {
rw.writeAttribute("style", style, null);
} else if (contentStyle != null && style!=null) {
rw.writeAttribute("style", style + ";" + contentStyle, null);
}
Object contentStyleClass = column.getAttributes().get("contentStyleClass");
if (contentStyleClass != null) {
Object styleClass = column.getAttributes().get("styleClass");
if (contentStyleClass != null && styleClass==null) {
rw.writeAttribute("class", contentStyleClass, null);
} else if (contentStyleClass == null && styleClass!=null) {
rw.writeAttribute("class", styleClass, null);
} else if (contentStyleClass != null && styleClass!=null) {
rw.writeAttribute("class", styleClass + " " + contentStyleClass, null);
}
Object value = column.getAttributes().get("value");
if (value != null) {
Expand Down Expand Up @@ -260,12 +270,23 @@ private void generateHeader(FacesContext context, DataTable dataTable, ResponseW
}
rw.startElement("th", dataTable);
Object headerStyle = column.getAttributes().get("headerStyle");
if (headerStyle != null) {
Object style = column.getAttributes().get("style");

if (headerStyle != null && style == null) {
rw.writeAttribute("style", headerStyle, null);
} else if (headerStyle == null && style != null) {
rw.writeAttribute("style", style, null);
} else if (headerStyle != null && style != null) {
rw.writeAttribute("style", style + ";" + headerStyle, null);
}
Object headerStyleClass = column.getAttributes().get("headerStyleClass");
if (headerStyleClass != null) {
Object styleClass = column.getAttributes().get("styleClass");
if (headerStyleClass != null && styleClass==null) {
rw.writeAttribute("class", headerStyleClass, null);
} else if (headerStyleClass == null && styleClass!=null) {
rw.writeAttribute("class", styleClass, null);
} else if (headerStyleClass != null && styleClass!=null) {
rw.writeAttribute("class", styleClass + " " + headerStyleClass, null);
}
if (column.getFacet("header") != null) {
UIComponent facet = column.getFacet("header");
Expand Down

0 comments on commit 183d1bb

Please sign in to comment.