Class PIADefaultChoiceEnumField

All Implemented Interfaces:
PAppComponent, PAppFieldComponent, PClientComponent, PCollectDataListener, PComponent, PComponentAttribute, PFieldBean, PLightComponent, PViewDataChangeListener, ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, Remote, EventListener, Accessible, ListDataListener
Direct Known Subclasses:
PIAPaymentField

public class PIADefaultChoiceEnumField extends PIAEnumField
In addition to what PIAEnumField can do, this component display a default selection to indicate that it will not collect data if the default is selected. All items are sorted by their enum values.

If the default string is not specified, this component behaves like a regular PIAEnumField except the items are sorted by the enum values.

This class must be in the same package as PIAEnumField's.

See Also:
  • Constructor Details

    • PIADefaultChoiceEnumField

      public PIADefaultChoiceEnumField()
      Default constructor.
    • PIADefaultChoiceEnumField

      public PIADefaultChoiceEnumField(String defaultString)
      Creates a enum field that supports a default selection. When the default string is selected, this component will not collect data.
      Parameters:
      defaultString - the default selection string.
  • Method Details

    • setDefaultString

      public void setDefaultString(String defaultString)
      Sets the default selection string.
      Parameters:
      defaultString - the default selection string.
    • getDefaultString

      public String getDefaultString()
      Gets the default selection string.
      Returns:
      defaultString the default selection string.
    • collectData

      public void collectData(PCollectDataEvent event)
      Overriden to interpret "select all" option.

      If the generic string is specified and selected, this field will not be a search criterion (don't collect data).

      Specified by:
      collectData in interface PCollectDataListener
      Overrides:
      collectData in class PIAEnumField
      Parameters:
      event - the data collection event.
    • setUserDefault

      public void setUserDefault() throws RemoteException
      Description copied from class: PIAEnumField
      This method provides a hook so that users can decide where in the code to setup the default value specified in the format string. By default , the setUserDefault is called in the buildModel() method. The format string can be specified as my.format={0,choice,100#Ok|200#Cancel|1,default,200} in the customized properties file. In the example the default will be choosen as "Cancel"
      Overrides:
      setUserDefault in class PIAEnumField
      Throws:
      RemoteException
    • getSelectedValue

      public int getSelectedValue()
      Description copied from class: PIAEnumField
      For the selected item, returns the ENUM value of that item.
      Overrides:
      getSelectedValue in class PIAEnumField
      Returns:
      The ENUM value of the selected item
    • setSelectedEnumValue

      public void setSelectedEnumValue(Object val)
      selects the item(display name) by passed enum value given in display Format string
      Parameters:
      val - enum value
    • getDisplayName

      public Object getDisplayName(Object enumValue)
      gets the display name from the enum value given in the display format string
      Parameters:
      enumValue -
      Returns: