Interface ChoiceSourceType

All Superinterfaces:
LazyEnumerator<ChoiceOption>
All Known Implementing Classes:
AbstractSourceType, ManualSourceType, ManualWithCostsSourceType, TableRefSourceType, UsersSourceType

public interface ChoiceSourceType extends LazyEnumerator<ChoiceOption>
Interface for Choice source's types
  • Method Details

    • getId

      Get the type id
      Returns:
      the id
    • getLabel

      Get the type label
      Returns:
      the label
    • getModelItems

      Get the type model items
      Returns:
      a map of the model items
    • getViewItems

      Get the view items for the main tab
      Returns:
      a list of view items
    • getFieldToDisableIfFormPublished

      Get field to disable if form is published
      Returns:
      the list of field name
    • remoteData

      boolean remoteData()
      true if the enumerator has remote data and need lazy loading
      Returns:
      true if the enumerator has remote data and need lazy loading
    • getStorageType

      Get the storage type of the source type
      Parameters:
      question - the question
      Returns:
      the storage type
    • getJSRenderer

      Get the js renderer for the choice list
      Returns:
      the js renderer
    • getJSConverter

      Get the js converter for the choice list
      Returns:
      the js converter
    • removeEmptyOrOtherValue

      Remove the empty values or values equal to '__interval_other' from received value
      Parameters:
      value - the receive value
      Returns:
      the value without empty sub-values or without '__interval_other' if the other option is chosen. If the value is empty or equal to the other value, it returns null.
    • valueToJSONForClient

      Object valueToJSONForClient(Object value, FormQuestion question, FormEntry entry, ModelItem modelItem) throws Exception
      Convert the entry value into a JSON object to use client side
      Parameters:
      value - the value to convert
      question - the form question
      entry - the form entry
      modelItem - the model item
      Returns:
      The value as JSON
      Throws:
      Exception - if an error occurred