It's all about the answers!

Ask a question

Viewlet Preference - Custom and Computed Type


Ashutosh Buxi (631) | asked Aug 16 '10, 8:31 a.m.
While configuring the preference def for a viewlet; we have many types; viz; Integer, String, etc.

Can anybody plz let me know the example; how to use the Custom and Computed type?

As in wiki examples are only of String; but I am unable to find any for Custom and Computed type.

2 answers



permanent link
Ashutosh Buxi (631) | answered Aug 18 '10, 4:31 a.m.
Thanks a lot Adam !! :)

It really helped me a lot to understand the Custom/Computed type preferences of viewlet.

permanent link
Adam Archer (83639) | answered Aug 17 '10, 11:10 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
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

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.