Package org.javarosa.form.api
Class FormEntryPrompt
java.lang.Object
org.javarosa.form.api.FormEntryCaption
org.javarosa.form.api.FormEntryPrompt
- All Implemented Interfaces:
FormElementStateListener
public class FormEntryPrompt extends FormEntryCaption
This class gives you all the information you need to display a question when
your current FormIndex references a QuestionEvent.
- Author:
- Yaw Anokwa
-
Nested Class Summary
Nested classes/interfaces inherited from class org.javarosa.form.api.FormEntryCaption
FormEntryCaption.RepeatOptions -
Field Summary
Fields inherited from class org.javarosa.form.api.FormEntryCaption
element, TEXT_FORM_AUDIO, TEXT_FORM_IMAGE, TEXT_FORM_LONG, TEXT_FORM_SHORT, TEXT_FORM_VIDEO, viewWidgetFields inherited from interface org.javarosa.core.model.FormElementStateListener
CHANGE_DATA, CHANGE_ENABLED, CHANGE_INIT, CHANGE_LOCALE, CHANGE_OTHER, CHANGE_RELEVANT, CHANGE_REQUIRED -
Constructor Summary
Constructors Modifier Constructor Description protectedFormEntryPrompt()This empty constructor exists for convenience of any supertypes of this promptFormEntryPrompt(FormDef form, FormIndex index)Creates a FormEntryPrompt for the element at the given index in the form. -
Method Summary
Methods inherited from class org.javarosa.form.api.FormEntryCaption
formElementStateChanged, getAppearanceHint, getAudioText, getFormElement, getImageText, getIndex, getIText, getLongText, getMultiplicity, getNumRepetitions, getQuestionText, getQuestionText, getRepeatOptions, getRepeatText, getRepetitionsText, getRepetitionText, getShortText, getSpecialFormQuestionText, getSpecialFormQuestionText, getTextID, localizer, repeats, substituteStringArgs
-
Constructor Details
-
FormEntryPrompt
protected FormEntryPrompt()This empty constructor exists for convenience of any supertypes of this prompt -
FormEntryPrompt
Creates a FormEntryPrompt for the element at the given index in the form.- Parameters:
form-index-
-
-
Method Details
-
getControlType
public int getControlType() -
getDataType
public int getDataType() -
getPromptAttributes
-
getAnswerValue
-
getAnswerText
-
getConstraintText
-
getConstraintText
-
getConstraintText
-
getBindAttributes
-
getSelectChoices
-
expireDynamicChoices
public void expireDynamicChoices() -
isRequired
public boolean isRequired() -
isReadOnly
public boolean isReadOnly() -
getQuestion
-
register
- Overrides:
registerin classFormEntryCaption
-
unregister
public void unregister()- Overrides:
unregisterin classFormEntryCaption
-
formElementStateChanged
- Specified by:
formElementStateChangedin interfaceFormElementStateListener- Overrides:
formElementStateChangedin classFormEntryCaption
-
getHelpText
ONLY RELEVANT to Question elements! Will throw runTimeException if this is called for anything that isn't a Question. Returns null if no help text is available- Returns:
-
getSelectItemText
Attempts to return the specified Item (from a select or 1select) text. Will check for text in the following order:
Localized Text (long form) -> Localized Text (no special form)
If no textID is available, method will return this item's labelInnerText.- Parameters:
sel- the selection (item), ifnullwill throw a IllegalArgumentException- Returns:
- Question Text.
nullif no text for this element exists (after all fallbacks). - Throws:
RunTimeException- if this method is called on an element that is NOT a QuestionDefIllegalArgumentException- if Selection isnull
-
getSelectChoiceText
-
getSpecialFormSelectItemText
This method is generally used to retrieve special forms for a (select or 1select) item, e.g. "audio", "video", etc.- Parameters:
sel- - The Item whose text you're trying to retrieve.form- - Special text form of Item you're trying to retrieve.- Returns:
- Special Form Text.
nullif no text for this element exists (with the specified special form). - Throws:
RunTimeException- if this method is called on an element that is NOT a QuestionDefIllegalArgumentException- ifsel == null
-
getSpecialFormSelectChoiceText
-
requestConstraintHint
- Throws:
UnpivotableExpressionException
-