Klasse CascadingValueProvider

Alle implementierten Schnittstellen:
CascadingSource, DynamicValueProvider, HasCascadingParent, NodeParser, Serializable

public class CascadingValueProvider extends FieldValueProvider implements HasCascadingParent
Creates a CascadingValueProvider which provides default values for a prompt based on a value of a parent prompt field.

The parent prompt field itself must have a FieldValueProvider so that the possible default values can be filtered with a "WHERE" condition in the query.

For example, a PromptField with a FieldValueProvider pointing to a database field representing countries could be set as a parent for a CascadingValueProvider pointing to a database field representing cities. When the default values are fetched, the value for the country is placed in the "WHERE" condition, thereby only providing the cities in the given country.

Seit:
7.7
Siehe auch:
  • Konstruktordetails

  • Methodendetails

    • getParent

      public PromptField getParent()
      Returns the set parent prompt field
      Angegeben von:
      getParent in Schnittstelle HasCascadingParent
      Gibt zurück:
      Parent prompt field for this cascading provider.
      Seit:
      7.7
    • setParent

      public void setParent(PromptField parent)
      Sets the parent prompt field which is to be used for filtering the default values.
      Angegeben von:
      setParent in Schnittstelle HasCascadingParent
      Parameter:
      parent - Parent prompt field, may not be null and must have a FieldValueProvider
      Löst aus:
      IllegalArgumentException - if the parent prompt field is null or does not have a FieldValueProvider,
      Seit:
      7.7
    • getSQL

      public String getSQL()
      Returns the query which is to be used for fetching the values and optionally descriptions dynamically.
      Setzt außer Kraft:
      getSQL in Klasse FieldValueProvider
      Gibt zurück:
      query to be used
      Seit:
      7.7
    • setParentSource

      public void setParentSource(CascadingSource parentSource)
      Sets the parent source for this cascading prompt that will provide the reference name of the parent to use in the generated SQL query.
      Parameter:
      parentSource - parent source which provides the reference name of the parent to use in the query, may not be null
      Löst aus:
      IllegalArgumentException - if the parent source given is null
      Seit:
      7.7
    • getParentSource

      public CascadingSource getParentSource()
      Returns the parent source which provides the reference name for the parent prompt when referencing it in the generated SQL query.
      Gibt zurück:
      parent source
      Seit:
      7.7
    • parseElement

      public NodeParser parseElement(com.inet.report.parser.XMLTag group, String tag, Attributes atts, Map<String,Object> parserMap) throws FatalParserException
      FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XML

      Parses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. Note that the parsing is highly tolerant, i.e. exceptions are intercepted and suppressed if at all possible.

      Angegeben von:
      parseElement in Schnittstelle NodeParser
      Setzt außer Kraft:
      parseElement in Klasse FieldValueProvider
      Parameter:
      group - XMLTag of the current node to be parsed, or null if there is no such current group. An XMLTag is a group of nodes bundled together, usually it is a Properties node such as CommonProperties, BorderProperties, etc.
      tag - The XMLTag to be parsed
      atts - The set of attributes in the current XMLTag
      parserMap - The map of current Parser.
      Gibt zurück:
      The NodeParser sub-element if one needed to be created, or null if none was created.
      Löst aus:
      FatalParserException - if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.