com.waveset.ui
Class EditForm.CheckboxArray
java.lang.Object
com.waveset.ui.EditForm.Item
com.waveset.ui.EditForm.CheckboxArray
- All Implemented Interfaces:
- java.lang.Cloneable
- Enclosing class:
- EditForm
- public static class EditForm.CheckboxArray
- extends EditForm.Item
A class that builds a checkbox array with row and column labels. It can
optionally take an array of booleans that hold the preset values.
Constructor Summary |
EditForm.CheckboxArray(java.lang.String title,
java.lang.String name,
java.lang.String[] rowNames,
java.lang.String[] columnNames,
java.lang.String[] rowDisplayNames,
java.lang.String[] columnDisplayNames,
boolean[][] enabled,
boolean[][] values)
|
Methods inherited from class com.waveset.ui.EditForm.Item |
clone, getAlignment, getHelpRef, getHTMLClass, getName, getPageInformation, getTitle, getValue, isNoWrap, isRenderAllHTML, isRequired, setAlignment, setForm, setHelpRef, setHTMLClass, setNoWrap, setPageInformation, setRenderAllHTML, setRenderInTitleColumn, setRequired, toHTML, toHTML |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EditForm.CheckboxArray
public EditForm.CheckboxArray(java.lang.String title,
java.lang.String name,
java.lang.String[] rowNames,
java.lang.String[] columnNames,
java.lang.String[] rowDisplayNames,
java.lang.String[] columnDisplayNames,
boolean[][] enabled,
boolean[][] values)
getRowNames
public java.lang.String[] getRowNames()
getColumnNames
public java.lang.String[] getColumnNames()
getRowDisplayNames
public java.lang.String[] getRowDisplayNames()
getColumnDisplayNames
public java.lang.String[] getColumnDisplayNames()
getValuesArray
public boolean[][] getValuesArray()
getEnabledArray
public boolean[][] getEnabledArray()
getColumnNamesFromForm
public static java.lang.String[] getColumnNamesFromForm(javax.servlet.ServletRequest req,
java.lang.String tableName)
getRowNamesFromForm
public static java.lang.String[] getRowNamesFromForm(javax.servlet.ServletRequest req,
java.lang.String tableName)
getValuesFromForm
public static boolean[][] getValuesFromForm(javax.servlet.ServletRequest req,
java.lang.String tableName)
- This is a helper to rebuild a table of values from the items that were checked.
HTML checkboxes do not appear in the posted form data if they are not checked. If they
are, they show up as arrays of strings, with values == to what was originally set.
In our table, the checkboxes are named <%=tableName%><%=rowName%>, and their values
are <%=columnName%>. Confusing? Yup, but that is the breaks with HTML forms!
getPermissionsFromForm
public static java.util.List getPermissionsFromForm(javax.servlet.ServletRequest req,
java.lang.String tableName)
throws WavesetException
- This is another helper to rebuild a table of values from the items that were checked.
HTML checkboxes do not appear in the posted form data if they are not checked. If they
are, they show up as arrays of strings, with values == to what was originally set.
This returns an arraylist of Permissions where the string arrays are variable-length
and have as their first element the type name, then the rest are the columns that
were checked.
- Throws:
WavesetException
getTableNamesFromForm
public static java.util.List getTableNamesFromForm(javax.servlet.ServletRequest req)
throws WavesetException
- Throws:
WavesetException