use of javax.faces.component.html.HtmlPanelGrid in project liferay-faces-alloy by liferay.
the class ColumnRenderer method encodeBegin.
@Override
public void encodeBegin(FacesContext facesContext, UIComponent uiComponent) throws IOException {
ResponseWriter responseWriter = facesContext.getResponseWriter();
UIComponent parent = uiComponent.getParent();
if (!((parent instanceof HtmlDataTable) || (parent instanceof HtmlPanelGrid))) {
responseWriter.startElement("div", uiComponent);
String clientId = uiComponent.getClientId(facesContext);
responseWriter.writeAttribute("id", clientId, null);
Column column = (Column) uiComponent;
StringBuilder classNames = new StringBuilder();
String size = column.getSize();
size = getColumnCSSClassSize(size);
Integer span = column.getSpan();
if (span != null) {
if ((span < 1) || (span > Column.COLUMNS)) {
throw new IOException("span number must be between 1 and " + Column.COLUMNS);
}
}
Integer width = column.getWidth();
if (width != null) {
if ((width < 1) || (width > 100)) {
throw new IOException("width must be between 1 and 100");
}
span = getColumnUnitSize(width);
}
classNames.append("col-");
classNames.append(size);
classNames.append("-");
classNames.append(span);
Integer offset = column.getOffset();
if (offset != null) {
if ((offset < 1) || (offset > Column.COLUMNS)) {
throw new IOException("offset must be between 1 and " + Column.COLUMNS);
}
}
Integer offsetWidth = column.getOffsetWidth();
if (offsetWidth != null) {
if ((offsetWidth < 1) || (offsetWidth > 100)) {
throw new IOException("offsetWidth must be between 1 and 100");
}
offset = getColumnUnitSize(offsetWidth);
}
if (offset != null) {
classNames.append(" ");
classNames.append("col-");
classNames.append(size);
classNames.append("-offset-");
classNames.append(offset);
}
RendererUtil.encodeStyleable(responseWriter, column, classNames.toString());
}
}
use of javax.faces.component.html.HtmlPanelGrid in project gdmatrix by gdmatrix.
the class WidgetTestBean method loadPanel.
private void loadPanel() {
panel = new HtmlPanelGrid();
panel.setId("panel_id");
// Add output
HtmlPanelGroup group = new HtmlPanelGroup();
group.setId("group_id");
HtmlOutputText output = new HtmlOutputText();
output.setId("output_id");
output.setValue("Hoy es: ");
group.getChildren().add(output);
HtmlCalendar cal = new HtmlCalendar();
cal.setId("cal_id");
cal.setValue(TextUtils.formatDate(new Date(), "dd/MM/yyyy"));
group.getChildren().add(cal);
panel.getChildren().add(group);
}
use of javax.faces.component.html.HtmlPanelGrid in project liferay-faces-alloy by liferay.
the class ColumnRenderer method encodeEnd.
@Override
public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException {
ResponseWriter responseWriter = facesContext.getResponseWriter();
UIComponent parent = uiComponent.getParent();
if (!((parent instanceof HtmlDataTable) || (parent instanceof HtmlPanelGrid))) {
responseWriter.endElement("div");
}
}
Aggregations