Service base component
Service base component
Class: OServiceBaseComponent
Inputs
Name | Since | Description | Default |
---|---|---|---|
attr string |
|
Field identifier. Registry property if component is inside a form. |
|
columns string |
|
Entity columns. Separated by ‘;’ |
|
delete-method string |
|
Service method name for deletions |
delete |
entity string |
|
Service entity name |
|
insert-method string |
|
Service method name for insertions |
insert |
keys string |
|
Entity keys. Separated by ‘;’ |
|
pageable no | false | yes | true |
|
Indicates whether or not to do paginated queries for getting the data |
no |
paginated-query-method string |
|
Service method name for paginated queries |
advancedQuery |
parent-keys string |
|
Form field attributes used for filtering the table data. Separated by ‘;’. It is possible to use alias on the following way: tableCol1:fk1;tableCol2:fk2 where tableCol1 and tableCol2 are table columns and fk1 and fk2 are attributes from form fields. |
|
query-fallback-function Function |
|
Function to execute on query error |
No value |
query-method string |
|
Service method name for queries |
query |
query-on-bind no | false | yes | true |
|
Query table data on bind |
yes |
query-on-event |
|
A component event reference the component must listen to in order to perform its query. The component will wait until the event you choose is fired to perform the request of the data. |
|
query-on-init no | false | yes | true |
|
Query table data on init |
yes |
query-rows number |
|
Number of records by page. Initial number of registries in queries when using pagination in server side |
10 |
query-with-null-parent-keys no | false | yes | true |
|
Indicates whether or not to trigger query method when the filter generated from parent-keys is null. The use of this attribute is not recommended when the component may request a big amount of information |
no |
service string |
|
JEE service path |
|
service-type string |
|
Injection token indicated in the provider of the service |
|
static-data array |
|
Static data for filling the table |
|
store-state no | false | yes | true |
|
Indicates whether or not to store component state |
yes |
update-method string |
|
Service method name for updates |
update |
Methods
afterViewInit |
---|
Method for inputs and listeners parsing that must be called inside ngAfterViewInit |
configureService |
---|
Method needed for Ontimize service initialization, already called in initialize method |
destroy |
---|
Method for unsuscribing listeners that must be called inside ngOnDestroy |
extractKeysFromRecord |
---|
Extracting the given record keys properties |
Parameters |
record: any |
Returns |
Object |
getAttribute |
---|
Returns component attr, used as identifier |
Returns |
string |
getAttributesValuesToQuery |
---|
Returns a list of attributes to be queried. This list includes the columns array and the keys array |
Returns |
string[] |
getComponentKey |
---|
Returns component identifier for state storage, attr value by default |
Returns |
string |
getDataArray |
---|
Returns component data array |
Returns |
any[] |
getDataToStore |
---|
Method returning component data that will be stored as its state |
Returns |
any |
getKeys |
---|
Returns parsed keys input ass array |
Returns |
string[] |
getQueryArguments |
---|
Returns the array of arguments needed for making a query |
Parameters |
Returns |
any[] |
getSqlTypes |
---|
Getting stored sql types |
Parameters |
getTotalRecordsNumber |
---|
Returns total number of records if the component is paginated |
Returns |
number |
initialize |
---|
Method for inputs and listeners initialization that must be called inside ngOnInit |
onLanguageChangeCallback |
---|
Callback for app locale change, receiving the selected locale as parameter |
Parameters |
lang: string |
queryData |
---|
Parameters |
setDataArray |
---|
Parameters |
setFormComponent |
---|
Setting parent form reference, already called in initialize method |
Parameters |
form: OFormComponent |
updatePaginationInfo |
---|
Updating pagination internal information, only if the component is pageable |
Parameters |
queryResponse: any |