Class RecordPageElement<T extends DBRecord>
java.lang.Object
org.apache.empire.jsf2.pages.PageElement<Page>
org.apache.empire.jsf2.pageelements.RecordPageElement<T>
-
Field Summary
FieldsFields inherited from class org.apache.empire.jsf2.pages.PageElement
page -
Constructor Summary
ConstructorsConstructorDescriptionRecordPageElement(Page page, DBRowSet rowset, T record) Creates a record page element for the given Table or ViewRecordPageElement(Page page, DBRowSet rowset, T record, String propertyName) Creates a record page element for the given Table or View -
Method Summary
Modifier and TypeMethodDescriptionbooleancanReloadRecord(boolean newRecord) return true if the record can be restored from the session.voidcloses a recordvoidcreates a new recordvoiddeletes a recordvoidloadRecord(Object[] recKey) loads the record identified by the supplied key from the databasevoidloadRecord(String idParam) loads an existing recordvoidloadRecord(PageDefinition page, String idParam) loads an existing record the the specified pageprotected voidvoidloads the record identified by the supplied key from the databasebooleanupdates or inserts the record in the databaseMethods inherited from class org.apache.empire.jsf2.pages.PageElement
getDefaultPropertyName, getPage, getPropertyName, getSessionObject, onRefreshPage, removeSessionObject, setSessionObject
-
Field Details
-
rowset
-
record
-
-
Constructor Details
-
RecordPageElement
Creates a record page element for the given Table or View- Parameters:
page- the page elementrowset- Table or Viewrecord- the record object for this page elementpropertyName- the property name which is used to get and retrieve session information
-
RecordPageElement
Creates a record page element for the given Table or View- Parameters:
page- the page elementrowset- Table or Viewrecord- the record object for this page element
-
-
Method Details
-
getRecord
-
getRowSet
-
getRecordIdParam
-
onInitPage
protected void onInitPage()- Overrides:
onInitPagein classPageElement<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
loads the record identified by the supplied key from the database- Parameters:
recKey- the record key
-
loadRecord
loads an existing record- Parameters:
idParam- the id param
-
loadRecord
loads an existing record the the specified page- Parameters:
page- the pageidParam- 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
-