Class RecordPageElement<T extends DBRecord>

java.lang.Object
org.apache.empire.jsf2.pages.PageElement<Page>
org.apache.empire.jsf2.pageelements.RecordPageElement<T>

public class RecordPageElement<T extends DBRecord> extends PageElement<Page>
  • Field Details

    • rowset

      protected final DBRowSet rowset
    • record

      protected T extends DBRecord record
  • Constructor Details

    • RecordPageElement

      public RecordPageElement(Page page, DBRowSet rowset, T record, String propertyName)
      Creates a record page element for the given Table or View
      Parameters:
      page - the page element
      rowset - Table or View
      record - the record object for this page element
      propertyName - the property name which is used to get and retrieve session information
    • RecordPageElement

      public RecordPageElement(Page page, DBRowSet rowset, T record)
      Creates a record page element for the given Table or View
      Parameters:
      page - the page element
      rowset - Table or View
      record - the record object for this page element
  • Method Details

    • getRecord

      public T getRecord()
    • getRowSet

      public DBRowSet getRowSet()
    • getRecordIdParam

      public String getRecordIdParam()
    • onInitPage

      protected void onInitPage()
      Overrides:
      onInitPage in class PageElement<Page>
    • canReloadRecord

      public boolean canReloadRecord(boolean newRecord)
      return true if the record can be restored from the session.
      Parameters:
      newRecord - flag to detect session data for a new reaord otherwise for an existing record
      Returns:
      true if information to restore the record is available on the session
    • reloadRecord

      public void reloadRecord()
      loads the record identified by the supplied key from the database
    • loadRecord

      public void loadRecord(Object[] recKey)
      loads the record identified by the supplied key from the database
      Parameters:
      recKey - the record key
    • loadRecord

      public void loadRecord(String idParam)
      loads an existing record
      Parameters:
      idParam - the id param
    • loadRecord

      public void loadRecord(PageDefinition page, String idParam)
      loads an existing record the the specified page
      Parameters:
      page - the page
      idParam - the id param
    • createRecord

      public void createRecord()
      creates a new record
    • updateRecord

      public boolean updateRecord()
      updates or inserts the record in the database
      Returns:
      true if the record was modified and successfully udpated
    • deleteRecord

      public void deleteRecord()
      deletes a record
    • closeRecord

      public void closeRecord()
      closes a record