cmu.survey.jsp.tags
Class HorizontalRadioHeaders
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
cmu.survey.jsp.tags.TagSupportAndMore
cmu.survey.jsp.tags.QuestionTagStub
cmu.survey.jsp.tags.Question
cmu.survey.jsp.tags.QuestionWithVariable
cmu.survey.jsp.tags.QuestionWithChoices
cmu.survey.jsp.tags.HorizontalRadioHeaders
- All Implemented Interfaces:
- HasErrorInfo, HasErrorInfoAndSaves, QuestionTag, java.io.Serializable, java.lang.Cloneable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally
public class HorizontalRadioHeaders
- extends QuestionWithChoices
A header over a horizontal RadioButtonQuestion . This labels the columns and lets you label a row of radio buttons if you want it.
If you use it like this:
<%@ taglib uri="/WEB-INF/SurveyTags.tld" prefix="survey" %>
<survey:survey databaseName="<%=databaseName%>" table="tbladmin" >
<%
String[] list = new String[]{"1", "2", "3", "4", "5"};
%>
<survey:horizontalRadioHeaders question="" choices="<%=list%>"/>
<survey:radioButtons dbField="Perform"
question="How well did the crew as a whole perform in this event?"
choices="<%=list%>" horizontal="true" showTitles="false"/>
<survey:radioButtons dbField="CrewComm"
question="How well did the crew as a whole communicate with one another?"
choices="<%=list%>" horizontal="true" showTitles="false"/>
</survey:survey>
It will show up in the page looking like this:
To show how many items go into the list and what the choices are, you need to create an array and pass it into the choices parameter. You can pass the same thing into the RadioButtonQuestion's list of choices.
- See Also:
- Serialized Form
| Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
pageContext |
| Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
EVAL_BODY_AGAIN |
| Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
|
Method Summary |
void |
doQuestion()
This is where all of the question related printing and work should go -- it gets called from doStartTag or from RandomizeQuestion if there is some matching going on. |
boolean |
hasVariable()
Whether this has a standard "answer" variable, i.e. whether the Question needs to call "getAnswer()" to load and save the answer. |
void |
reinit()
|
void |
setBackgroundColor(java.lang.String background)
|
void |
setUseDifferentBackgroundColor(boolean useDifferentBackground)
|
| Methods inherited from class cmu.survey.jsp.tags.QuestionWithChoices |
getCachedAnswerPair, getCacheRandomizeAnswerOrder, getChoicesField, getChoicesQuestionID, getChoicesSQLWhere, getQuestionChoicesWithIDField, getRandomizeAnswerOrder, getStartIndexesAtZero, getTupleFromChoices, isChoicesTableStandardFormat, setCachedAnswerPair, setCacheRandomizeAnswerOrder, setChoices, setChoicesField, setChoicesIDField, setChoicesQuestionID, setChoicesSQLWhere, setChoicesTable, setChoicesTableUsingStandardFormat, setRandomizeAnswerOrder, setSaveTheTitle, setStartIndexesAtZero |
| Methods inherited from class cmu.survey.jsp.tags.QuestionWithVariable |
getAnswer, getDbField, getExtraJavaScripts, getExtraJavaScripts, getFieldAndType, getFieldAndType, getTimeSpentInOnClickOrPressed, getTimeSpentInOnClickOrPressed, getType, isTypeKey, isTypeNumeric, isTypeNumeric, isValidType, printTimeSpentField, saveQuestionInfo, setDbField, setDefaultValue, setType |
| Methods inherited from class cmu.survey.jsp.tags.Question |
clone, doEndOfQuestion, doEndOfQuestionNoPrinting, doMiddleOfQuestion, doStartOfQuestion, doStartOfQuestion, getAutoSubmitWhenFinishedWithThisQuestion, getBackgroundColorHTMLText, getDatabaseQuery, getEndQuestion, getExtraErrorInfo, getHelpText, getID, getOtherQuestionInfoToSave, getQuestion, getSupplementalErrorInfo, print, print, printTimeSpentField, setAutoSubmitWhenFinishedWithThisQuestion, setEndQuestion, setHelpText, setID, setNumberOfColumns, setOtherQuestionInfoToSave, setQuestion, setSupplementalErrorInfo |
| Methods inherited from class cmu.survey.jsp.tags.TagSupportAndMore |
breakDownToArray, convertDayNameToNum, convertDayNumToName, convertDayNumToName, convertMonthNumToName, doCatch, doEndTag, doFinally, formatDateTimeViewable, formatDateTimeViewable, formatDateViewable, formatTimeNoSecondsViewable, formatTimeNoSecondsViewable, formatTimeNoSecondsViewable, getNumDaysInWeek, parseTimeNoSecondsFromViewable, println |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HorizontalRadioHeaders
public HorizontalRadioHeaders()
setUseDifferentBackgroundColor
public void setUseDifferentBackgroundColor(boolean useDifferentBackground)
setBackgroundColor
public void setBackgroundColor(java.lang.String background)
- Overrides:
setBackgroundColor in class Question
hasVariable
public boolean hasVariable()
- Description copied from class:
QuestionWithVariable
- Whether this has a standard "answer" variable, i.e. whether the Question needs to call "getAnswer()" to load and save the answer.
For example, headers do not have variables, short answers do. More complicated, AbstractQuestions should return false, despite having some variables -- they don't have any standard variables.
- Specified by:
hasVariable in class QuestionWithVariable
- Returns:
doQuestion
public void doQuestion()
- Description copied from class:
Question
- This is where all of the question related printing and work should go -- it gets called from doStartTag or from RandomizeQuestion if there is some matching going on.
- Specified by:
doQuestion in interface QuestionTag- Overrides:
doQuestion in class Question
reinit
public void reinit()
- Overrides:
reinit in class QuestionWithChoices