Child pages
  • Foundset property type

Versions Compared

Key

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

...

If you are using foundset linked properties with your foundset property you might want to add the listener as shown here.

The "changes" parameter above is a javascript Object containing one or more keys, depending on what changes took place. The keys specify the type of change that happened; they can be any of the constants starting with NOTIFY_... from "$foundsetTypeConstants" service. The value gives any extra information needed for that type of change. Here is what "changes" can contain (one or more of the keys/values listed below):

...

Please note the when your listener is called the actual contents of the viewPort are already updated. So, at that time your viewport already looks like the last version above. You might find (for Servoy < 8.4) what $foundsetTypeUtils below provides useful depending on how you plan on using this listener. For 8.4 and higher you no longer need to compute indexes like that client-side (because the server pays attention to process all changes in such a way that the indexes in the ones that need to change data are the correct ones compared to the end state of the changed viewport).

...

Both of these options can be altered at runtime by browser-side scripting using "setPreferredViewportSize(...)"; see above.

A foundset based component can specify if it wants to know if the foundsets definition was changed, by adding a foundsetDefinitionListener to the foundset property with the value true. If that is true then foundset ChangeListener will also get a foundsetDefinitionChanged event passed in then the definition (sql query) of the underlying foundset is changed. This can be handy if you are in a grouped mode and the root foundset only has 200 records loaded but through grouping you really show 1000 records and because of a filter that is applied to the root the first 200 are not changed but the change is somewhere visible after that. Then the a grouping table should reflect that by refreshing the groups. Don't use this property if you don't need it because it is not without cost to calculatie this and fire the event.

.spec file

Code Block
languagejs
"myFoundset": { "type": "foundset", "dataproviders": ["image", "age"],
                                    "initialPreferredViewPortSize": 130,
                                    "sendSelectionViewportInitially": true,
									"foundsetDefinitionListener": true
 }

Linking other "foundset aware" property types to a foundset property

...