Child pages
  • Component (child) property type

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • componentDirectiveName: also present when not linked to a foundset; read-only; the directive tag name of the child web component.

  • name: also present when not linked to a foundset; read-only; the name (property) of the web component.
  • forFoundset.recordBasedProperties: not present when not linked to a foundset; read-only; a list of child component property names that are delivered for each record in the foundset viewport (these properties have different values for each record and will be available in modelViewport).
  • model: also present when not linked to a foundset; read-write; properties of the child component that are the same for all records in the foundset's viewPort.
  • modelViewport: not present when not linked to a foundset; read-write; model properties of the child component that have different values for each record in the foundset; this array's indexes correspond directly to the indexes of the linked 'foundset' type property's 'viewPort'; it's contents change when the 'foundset' property's viewPort change. See foundset property type documentation for more about how the viewPort is controlled.
    handlers: also present when not linked to a foundset; read-only;whatever handlers the web component has attached (chosen by developer at design-time). See discussion about 'rowId' from servoyApi.startEdit below 
  • api: also present when not linked to a foundset; read-write; whatever API functions the textfield component provided; initially empty object. When component is linked to a foundset and the server side JS code calls such an API function it should get called in the end on the selected foundset record's child component that represents this component property (there is some support choosing to call on childComponents corresponding to all records, through a forFoundset.apiCallTypes entry, but that is not currently used nor documented here).
  • servoyApi: also present when not linked to a foundset; read-only; Servoy specific API provided to be used with web components.
    • startEdit(propertyName, rowId): provided by the 'component' property; it is used by the child component's svy-autoapply directive (if used by child component) or by custom child component directive code to signal that the editing of that cell has started; as you will probaly have one child component representing this 'component' property value for each record in the foundset's viewPort - startEdit requires receiving a 'rowId' argument to know which record entered edit mode. For example the parent component creates a wrapper startEdit(propertyName) function (closure around the rowId of that record - that is always available in modelViewport as "_svyRowId" that will call the 'component' provided startEdit using that rowId) for each record and feeds it to the corresponding angular component. (the rowId argument is not relevant when using non-foundset linked components)
    • apply(propertyName, componentModel, rowId): also present when not linked to a foundset; read-only;
    This will probably be moved to "servoyApi" above in the near future.
    • 'componentModel' and 'rowId' are only relevant when the component is linked to a foundset. 'componentModel' is the real object that is given by parent component to the per-record child component at record 'rowId' as model - this is most likely made up of a combination between model and a modelViewport row. See discussion about 'rowId' from servoyApi.startEdit above. Apply pushes a changed dataprovider value of the child component to the record on the server. It is used by svy-autoapply directive or directly by custom child component code.

Runtime property access

Runtime usage: in Servoy server side JS 'component' typed properties are not currently directly available. The child components are for now accessible using the standard form access: form.elements.myElement.