Class PortalEvent

java.lang.Object
com.aquima.interactions.portal.PortalEvent
Direct Known Subclasses:
TaskPortalEvent

public class PortalEvent extends Object
The portal event class is used to pass information from the client into the current session. This event class holds information about values that might have changed on the client, the action that was performed on the client (for instance a button submit) and additional parameters.
Since:
5.0
Author:
o.kerpershoek
  • Constructor Details

    • PortalEvent

      public PortalEvent()
      Default constructor for an event that wishes to post new values from the client to the session. This event does not contain an identifier of an element that triggered the event, and will thus result in a refresh of the current page when posted to the session.
    • PortalEvent

      public PortalEvent(RuntimeKey fieldId)
      This constructor accepts a field if of the element that triggered the event. The id of the element will be used when handling the event to determine the type of action (refresh or submit).
      Parameters:
      fieldId - Id of the element on the page that triggered the event.
  • Method Details

    • setEvent

      public void setEvent(RuntimeKey fieldId)
      This method may be used to set the id of the element that triggered the event. The id of the element will be used when handling the event to determine the type of action (refresh or submit).
      Parameters:
      fieldId - Id of the element on the page that triggered the event.
    • addParameter

      public void addParameter(String key, Object paramValue)
      This method may be used to add additional parameters to the event that are not bound to fields from the last page. Parameters added using this method will be available in services and containers that are invoked during the handling of the event.
      Parameters:
      key - The name of the parameter (mandatory).
      paramValue - The value of the parameter.
    • getParameters

      public Map<String,Object> getParameters()
      This method returns a map of all the parameters that have been added to this event.
      Returns:
      Map containing all parameter names and values.
    • getUpdatedFields

      public RuntimeKey[] getUpdatedFields()
      This method will return an array containing all the keys of the fields for which a new value is present in this event. The array returned here should never be null.
      Returns:
      Array containing the keys of the updated fields.
    • getAction

      public RuntimeKey getAction()
      Optional attribute which indicates the action that was performed. Usually the action will belong to a button.
      Returns:
      Id of the element that triggered the event (may be null).
    • getValue

      public Serializable getValue(RuntimeKey fieldId)
      Multiple values should be returned in a Collection object.
      Parameters:
      fieldId - Runtime key identifying the field for which the value is requested.
      Returns:
      The new value for the specified field.
    • addValue

      public void addValue(RuntimeKey fieldId, String fieldValue)
      This method may be used to add a value for a field that was displayed on the page.
      Parameters:
      fieldId - The identifier of the field the value belongs to (mandatory)
      fieldValue - The value of the field that should be added.
    • setValues

      public void setValues(RuntimeKey fieldId, Object fieldValue)
      This method may be used to set the value for a field that was displayed on the page. The value of the field should either be a string or an array of strings. If a value was already set or added for the specified field, the previous value will be discarded.
      Parameters:
      fieldId - The identifier of the field the value belongs to (mandatory)
      fieldValue - The value(s) of the field that should be set.
    • clearValues

      public void clearValues(RuntimeKey fieldId)
    • isUpdatedField

      public boolean isUpdatedField(RuntimeKey fieldId)
      This method will returned a boolean indicating if this event contains an updated value for the specified field id.
      Parameters:
      fieldId - The field id for which the check should be performed.
      Returns:
      Boolean indicating if the events contains an updated value for the specified field.
    • toString

      public String toString()
      Overrides:
      toString in class Object