Viewlet Preference - Custom and Computed Type
2 answers
Unfortunately I don't think we have sample code available anywhere for using custom and computed preferences. However, our viewlets are available on jazz.net and they use these options. You can take a look at the live code directly in your browser. See the urls at the bottom of this post to find the code.
For computed preferences take a look at the settingChanging and getPreferenceOptions function in the WorkItemsViewlet. See also the API documentation about these functions here:
https://jazz.net/wiki/bin/view/Main/ViewletFunctions#GetPreferenceOptions
https://jazz.net/wiki/bin/view/Main/ViewletFunctions#SettingChanging
For custom preferences, see the getPreferenceProvider function in the WorkItemsViewlet and the code for the WorkItemQueryPreferenceProvider that it returns (and the WorkItemQueryChooser that the preference provider uses). See also API docs about custom preference providers here:
https://jazz.net/wiki/bin/view/Main/ViewletFunctions#GetPreferenceProvider
https://jazz.net/wiki/bin/view/Main/CustomPreferenceProviderFunctions
WorkItemsViewlet:
http://jazz.net/jazz/web/com.ibm.team.workitem.viewlets.web/ui/internal/WorkItemsViewlet.js?debug=true
WorkItemQueryPreferenceProvider:
http://jazz.net/jazz/web/com.ibm.team.workitem.viewlets.web/ui/internal/utils/WorkItemQueryPreferenceProvider.js?debug=true
WorkItemQueryChooser:
http://jazz.net/jazz/web/com.ibm.team.workitem.viewlets.web/ui/internal/utils/WorkItemQueryChooser.js?debug=true
For computed preferences take a look at the settingChanging and getPreferenceOptions function in the WorkItemsViewlet. See also the API documentation about these functions here:
https://jazz.net/wiki/bin/view/Main/ViewletFunctions#GetPreferenceOptions
https://jazz.net/wiki/bin/view/Main/ViewletFunctions#SettingChanging
For custom preferences, see the getPreferenceProvider function in the WorkItemsViewlet and the code for the WorkItemQueryPreferenceProvider that it returns (and the WorkItemQueryChooser that the preference provider uses). See also API docs about custom preference providers here:
https://jazz.net/wiki/bin/view/Main/ViewletFunctions#GetPreferenceProvider
https://jazz.net/wiki/bin/view/Main/CustomPreferenceProviderFunctions
WorkItemsViewlet:
http://jazz.net/jazz/web/com.ibm.team.workitem.viewlets.web/ui/internal/WorkItemsViewlet.js?debug=true
WorkItemQueryPreferenceProvider:
http://jazz.net/jazz/web/com.ibm.team.workitem.viewlets.web/ui/internal/utils/WorkItemQueryPreferenceProvider.js?debug=true
WorkItemQueryChooser:
http://jazz.net/jazz/web/com.ibm.team.workitem.viewlets.web/ui/internal/utils/WorkItemQueryChooser.js?debug=true