public class LayoutHelper
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
printDescription(java.lang.String fieldId,
java.lang.String descr,
java.io.Writer out)
Print the description
If
fieldId is set the description will be enclosed in a label
for accessibility. |
static void |
printDescription(java.lang.String descr,
java.io.Writer out)
Print the description
The
description is encoded using
StringEscapeUtils.escapeHtml4(String) before it is written to
the Writer . |
static void |
printErrors(SlingHttpServletRequest request,
java.lang.String fieldName,
boolean hideLabel,
java.io.Writer out)
Print all errors (if there are any.) If there are error messages for this
field, a div for each error message is created.
|
static boolean |
printErrors(SlingHttpServletRequest request,
java.lang.String fieldName,
boolean hideLabel,
java.io.Writer out,
int valueIndex)
Print all errors (if there are any.) If there are error messages for this
field, a div for each error message is created.
|
static void |
printErrors(SlingHttpServletRequest request,
java.lang.String fieldName,
java.io.Writer out)
Print all errors (if there are any.) If there are error messages for this
field, a div for each error message is created.
|
static boolean |
printErrors(SlingHttpServletRequest request,
java.lang.String fieldName,
java.io.Writer out,
int valueIndex)
Print all errors (if there are any.) If there are error messages for this
field, a div for each error message is created.
|
static void |
printTitle(java.lang.String fieldId,
java.lang.String title,
boolean required,
boolean hideLabel,
java.io.Writer out)
Print the left column, title and required.
|
static void |
printTitle(java.lang.String fieldId,
java.lang.String title,
boolean required,
java.io.Writer out)
Print the left column, title and required.
|
public static void printTitle(java.lang.String fieldId, java.lang.String title, boolean required, java.io.Writer out) throws java.io.IOException
title
is encoded using
StringEscapeUtils.escapeHtml4(String)
before it is written to
the Writer
.fieldId
- The id of the field (not the name) - This can be null if
title is null.title
- The title of the field (or null)required
- Flag indicating if this field is required.out
- The writer.java.io.IOException
- If writing fails.public static void printTitle(java.lang.String fieldId, java.lang.String title, boolean required, boolean hideLabel, java.io.Writer out) throws java.io.IOException
title
is encoded using
StringEscapeUtils.escapeHtml4(String)
before it is written to
the Writer
.fieldId
- The id of the field (not the name) - This can be null if
title is null.title
- The title of the field (or null)required
- Flag indicating if this field is required.hideLabel
- Option to completely hide the label (removes form_leftcollabel and form_leftcolmark
divs content)out
- The writer.java.io.IOException
- If writing fails.public static void printDescription(java.lang.String descr, java.io.Writer out) throws java.io.IOException
description
is encoded using
StringEscapeUtils.escapeHtml4(String)
before it is written to
the Writer
.descr
- The description of the field (or null)out
- The writer.java.io.IOException
- If writing fails.public static void printDescription(java.lang.String fieldId, java.lang.String descr, java.io.Writer out) throws java.io.IOException
fieldId
is set the description will be enclosed in a label
for accessibility. This facility should only be used when the field has no
title, or the title is not used as a label for some reason.
The description
is encoded using
StringEscapeUtils.escapeHtml4(String)
before it is written to
the Writer
.fieldId
- Field id.descr
- The description of the field (or null)out
- The writer.java.io.IOException
- If writing fails.public static void printErrors(SlingHttpServletRequest request, java.lang.String fieldName, java.io.Writer out) throws java.io.IOException
printTitle(String, String, boolean, Writer)
is
called and a third inner div with the message and the classes
form_rightcol and form_error is created.request
- The current request.fieldName
- The name of the field (not the id!)out
- The writer.java.io.IOException
- If writing fails.public static boolean printErrors(SlingHttpServletRequest request, java.lang.String fieldName, java.io.Writer out, int valueIndex) throws java.io.IOException
printTitle(String, String, boolean, Writer)
is
called and a third inner div with the message and the classes
form_rightcol and form_error is created.request
- The current request.fieldName
- The name of the field (not the id!)out
- The writer.valueIndex
- value indextrue
if an error has been printed (since 5.5)java.io.IOException
- If writing fails.public static void printErrors(SlingHttpServletRequest request, java.lang.String fieldName, boolean hideLabel, java.io.Writer out) throws java.io.IOException
printTitle(String, String, boolean, Writer)
is
called and a third inner div with the message and the classes
form_rightcol and form_error is created.request
- The current request.fieldName
- The name of the field (not the id!)hideLabel
- Option to completely hide the label (removes form_leftcollabel and form_leftcolmark
divs content)out
- The writer.java.io.IOException
- If writing fails.public static boolean printErrors(SlingHttpServletRequest request, java.lang.String fieldName, boolean hideLabel, java.io.Writer out, int valueIndex) throws java.io.IOException
printTitle(String, String, boolean, Writer)
is
called and a third inner div with the message and the classes
form_rightcol and form_error is created.request
- The current request.fieldName
- The name of the field (not the id!)hideLabel
- Option to completely hide the label (removes form_leftcollabel and form_leftcolmark
divs content)out
- The writer.valueIndex
- value indextrue
if an error has been printed (since 5.5)java.io.IOException
- If writing fails."Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"