Child pages
  • Foundset property type

Versions Compared

Key

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

Spec file:

A component can have in the spec file just something like:

Code Block
"myfoundset": "foundset"

 

Then we have to have also a components property that maps on this one:

Code Block
"childElements" : { "type" : "component[]", "elementConfig" : {"forFoundsetTypedProperty": "myfoundset"} }, `

 

 Then the components dictate which dataproviders will be send over for that foundset selector.

Or we can have by configuration type, so instead of childelements we have:

 

Code Block
"myconfigurations": "MyConfig"
"types": {
    "MyConfig": { 
        "mydataprovider" : { "type" : "dataprovider", "forFoundsetTypedProperty": "myfoundset"}
    }
}

Then the configuration dictates which dataproviders are send over  for that foundset.

In these 2 scenario's the viewport of the foundset only contains the rowid's and the components (childElements) or configuration (myconfigurations) have the viewPort for that row data (we as an example below)

 

Besides these 2 options where which dataproviders are defined by another property the foundset property can also define the dataprovider itself:

Code Block
"myfoundset": {"type":"foundset", "dataproviders":["firstname","lastname"]}

 

Now the foundset itself just specifies what dataproviders it expects in its viewport rows.

The dataproviders will be mapped just like a normal webcomponent, so in the browser value you will have "firstname" and "lastname" and those are filled in on the server side based on the dataprovider they are mapped on in the designer.

Browser value:

Here is a sample of what the value of a 'foundset' typed property contains in the browser - web component model:

...

Code Block
titleContents in .frm file
myFoundset: {
        foundsetSelector: "", 
        dataProvidersdataproviders: [firstname:'nameColumn'columnOrOtherDataprovider',lastname:"someotherDataprovider"]
    }
}"

'foundsetSelector' can be:

...

'dataProviders' specifies what are the data columns mappings that need to be available in the browser - in the foundset property's 'viewPort' - in rows. For example you could have something like "dataProviders: ['nameColumn', 'age', 'imagem', 'imageurl']"These are only there if the foundset property in the spec are asking for specific dataproviders.

Runtime usage (server side Servoy JS)

...