public class QuestionDropdown extends Question
ESSAY_FIELD_CHECKBOX, ESSAY_FIELD_DROPDOWN, ESSAY_FIELD_NUMERIC_DEC, ESSAY_FIELD_NUMERIC_INT, ESSAY_FIELD_TEXT, ESSAYFIELD_LENGTH, INTEXT_TYPE_CHECKBOX, INTEXT_TYPE_DROPDOWN, INTEXT_TYPE_NUMERIC_DEC, INTEXT_TYPE_NUMERIC_INT, INTEXT_TYPE_TEXT, QUESTION_DROPDOWN, QUESTION_MATRIX, QUESTION_MULTIPLE, QUESTION_NO_TYPE, QUESTION_NUMERIC, QUESTION_RATING, TAG_END, TAG_START, UPLOAD_IMAGE, UPLOAD_NONE
Modifier and Type | Method and Description |
---|---|
int |
getItemCount()
Get number of items.
|
java.lang.String[] |
getItems()
Gets the dropdown items as array of Strings.
|
java.lang.String |
getLabel()
Gets the dropdown label.
|
java.lang.String |
getLabelValueSeparator()
Gets the separator between dropdown item and value
|
boolean |
getMultipleOn()
Gets the multipleOn attribute.
|
int |
getSize()
Gets the dropdown size.
|
boolean |
getSortOn()
Gets the sortOn attribute.
|
void |
keepBusinessObject()
Get and keep business object.
|
void |
releaseBusinessObject()
Release business object.
|
void |
setItems(java.lang.String itemsAsString)
Sets the dropdown items (one item per line).
|
void |
setLabel(java.lang.String dropdownLabel)
Sets the dropdown label.
|
void |
setMultipleOn(boolean multipleOn)
Sets the multipleOn attribute of the Dropdown question.
|
void |
setSize(int dropdownSize)
Sets the dropdown size.
|
void |
setSortOn(boolean sortOn)
Sets the sorting attribute.
|
addEssayFieldCheckbox, addEssayFieldDecimal, addEssayFieldDropdown, addEssayFieldInteger, addEssayFieldText, addIntextCheckbox, addIntextDecimal, addIntextDropdown, addIntextInteger, addIntextText, deleteEssayField, deleteIntext, deleteValidator, deleteValidator, deleteValidator, deleteValidator, getAnswerRotation, getCustomId, getDisplayNo, getEssayFieldCount, getEssayFieldDropdownItems, getEssayFieldDropdownLabel, getEssayFieldDropdownSortOn, getEssayFieldSize, getEssayFieldType, getFreeTextColumns, getFreeTextLabel, getFreeTextMaxLength, getFreeTextRows, getHiddenQuestion, getIntextCount, getIntextDropdownItems, getIntextDropdownLabel, getIntextDropdownSortOn, getIntextIndex, getIntextName, getIntextSize, getIntextType, getQuestionId, getQuestionLayout, getQuestionText, getQuestionType, getTextAfter, getTextBefore, getUploadType, getValidatorErrorMessage, getValidatorErrorMessage, getValidatorErrorMessage, getValidatorErrorMessage, getValidatorParameter, getValidatorParameter, getValidatorParameter, getValidatorParameter, getWeight, hasBusinessObject, isFreeTextOn, isValidatorOn, isValidatorOn, isValidatorOn, isValidatorOn, setAnswerRotation, setDisplayNo, setFreeTextColumns, setFreeTextLabel, setFreeTextMaxLength, setFreeTextOn, setFreeTextRows, setHiddenQuestion, setQuestionLayout, setQuestionText, setTextAfter, setTextBefore, setUploadType, setValidator, setValidator, setValidator, setValidator, setWeight, updateAttribute, validate
public void setItems(java.lang.String itemsAsString) throws LockException, RespondentsExistException, SurveySecurityException, SurveySystemException
getLabelValueSeparator()
to
separate item label and item value. If no dropdown value entered, label is
used as value:Three dropdown items wil be created:String separator = questionDropdown.getLabelValueSeparator(); StringBuffer items = new StringBuffer(); items.append("Norway").append(separator).append("no").append("\n"); items.append("France").append(separator).append("fr").append("\n"); items.append("USA").append("\n");
itemsAsString
- The new dropdownItems valueLockException
- Thrown if the survey is locked and
can't be edited. Not yet implemented. Use survey.isLocked()
to be sure that the survey can be updated.RespondentsExistException
- Thrown if the survey has responses and
can't be edited. Not yet implemented. Use survey.hasRespondents()
to be sure that the survey can be updated.SurveySecurityException
- Thrown if the user is not authorized
to call this method.SurveySystemException
- If an error occurs in the system.public void setLabel(java.lang.String dropdownLabel) throws LockException, RespondentsExistException, SurveySecurityException, SurveySystemException
dropdownLabel
- The new labelLockException
- Thrown if the survey is locked and
can't be edited. Not yet implemented. Use survey.isLocked()
to be sure that the survey can be updated.RespondentsExistException
- Thrown if the survey has responses and
can't be edited. Not yet implemented. Use survey.hasRespondents()
to be sure that the survey can be updated.SurveySecurityException
- Thrown if the user is not authorized
to call this method.SurveySystemException
- If an error occurs in the system.public void setMultipleOn(boolean multipleOn) throws LockException, RespondentsExistException, SurveySecurityException, SurveySystemException
multipleOn
- The new multipleOn valueLockException
- Thrown if the survey is locked and
can't be edited. Not yet implemented. Use survey.isLocked()
to be sure that the survey can be updated.RespondentsExistException
- Thrown if the survey has responses and
can't be edited. Not yet implemented. Use survey.hasRespondents()
to be sure that the survey can be updated.SurveySecurityException
- Thrown if the user is not authorized
to call this method.SurveySystemException
- If an error occurs in the system.public void setSize(int dropdownSize) throws LockException, RespondentsExistException, SurveySecurityException, SurveySystemException
dropdownSize
- The new dropdown sizeLockException
- Thrown if the survey is locked and
can't be edited. Not yet implemented. Use survey.isLocked()
to be sure that the survey can be updated.RespondentsExistException
- Thrown if the survey has responses and
can't be edited. Not yet implemented. Use survey.hasRespondents()
to be sure that the survey can be updated.SurveySecurityException
- Thrown if the user is not authorized
to call this method.SurveySystemException
- If an error occurs in the system.public void setSortOn(boolean sortOn) throws LockException, RespondentsExistException, SurveySecurityException, SurveySystemException
sortOn
- The new sortOn valueLockException
- Thrown if the survey is locked and
can't be edited. Not yet implemented. Use survey.isLocked()
to be sure that the survey can be updated.RespondentsExistException
- Thrown if the survey has responses and
can't be edited. Not yet implemented. Use survey.hasRespondents()
to be sure that the survey can be updated.SurveySecurityException
- Thrown if the user is not authorized
to call this method.SurveySystemException
- If an error occurs in the system.public int getItemCount() throws SurveySystemException
SurveySystemException
- If an error occurs in the system.public java.lang.String[] getItems() throws SurveySystemException
getLabelValueSeparator()
SurveySystemException
- If an error occurs in the systempublic java.lang.String getLabel() throws SurveySystemException
SurveySystemException
- If an error occurs in the systempublic java.lang.String getLabelValueSeparator()
public boolean getMultipleOn() throws SurveySystemException
SurveySystemException
- If an error occurs in the systempublic int getSize() throws SurveySystemException
SurveySystemException
- If an error occurs in the systempublic boolean getSortOn() throws SurveySystemException
SurveySystemException
- If an error occurs in the systempublic void keepBusinessObject() throws SurveySystemException
keepBusinessObject
in class Question
SurveySystemException
- If an error occurs in the system.public void releaseBusinessObject()
releaseBusinessObject
in class Question
Built on April 12 2018