It's all about the answers!

Ask a question

Conditional Values in Editor Presentation?


David Fay (4164) | asked Sep 01 '09, 3:40 p.m.
Does anyone know if it is possible to have conditional values within presentations?

For example, let's say I have two enumerations, one with values 1, 2, 3, 4 and the other with values a and b. Then I have two presentations, both combo boxes. The first combo box contains the values a and b. If 'a' is selected, I only want to be able to select '1' or '3' from the other combo box. If 'b' is selected, I only want to be able to select '2' or '4'.

Possible?


Thanks!

6 answers



permanent link
Ralph Schoon (62.9k33645) | answered Sep 03 '09, 2:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,

there are several Posts around this already.

My personal summary around it is: the development team has put some code to support it into RTC 2 but we are not there yet. I have been pointed to these links about capabilities for dependent fields on custom attributes in RTC 2.0 :

https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=68050

https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=73683

Thanks,

Ralph

permanent link
Patrick Streule (4.9k21) | answered Sep 04 '09, 8:57 a.m.
JAZZ DEVELOPER
My personal summary around it is: the development team has put some
code to support it into RTC 2 but we are not there yet. I have been
pointed to these links about capabilities for dependent fields on
custom attributes in RTC 2.0 :

https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=68050

https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=73683

There are possibilities in 2.0 to implement conditional values in terms of
Attribute Presentations. But we currently don't have a non-programmatic
option to specify dependent value sets.

However, we are currently exploring and implementing some solutions in the
area of conditional value sets, dependent attributes etc., so stay tuned.

--
Regards,
Patrick
Jazz Work Item Team

permanent link
David Fay (4164) | answered Sep 24 '09, 11:52 a.m.
I have looked at the work items and found the Calculated Attribute Presentation on the Wiki and am using those as references to create my own custom presentation.

My custom presentation will be a combobox but I'm not sure how to create that component. Here's what I have so far based on what I have seen in the Calculated Attribute Presentation example:

@Override

protected void createControlContent(ITeamFormLayout formLayout) {
final WorkItemEditorToolkit toolkit = (WorkItemEditorToolkit) getSite().getToolkit();
Composite parent = formLayout.getContainer();

cboDefectTypes = toolkit.create...?

}


Can anyone tell me which method I need to call on the toolkit to create a combo box? I can't seem to find an API that describes the methods.

Or, is there a different toolkit or different container that I should be trying to use?

Thanks,
David

permanent link
Patrick Streule (4.9k21) | answered Sep 25 '09, 3:31 a.m.
JAZZ DEVELOPER
Can anyone tell me which method I need to call on the toolkit to
create a combo box? I can't seem to find an API that describes the
methods.

You can create a regular combo box and use toolkit.adapt(combo).

There is also an (internal) combo class that provides more convenience,
which you may want to take a look at:
com.ibm.team.workitem.ide.ui.internal.editor.DecoratedCombo

--
Regards,
Patrick
Jazz Work Item Team

permanent link
David Fay (4164) | answered Sep 30 '09, 10:30 a.m.
After thinking about my problem a little more, it occurs to me that I may not need a custom combo box after all. Also, I can't get it to display in the list of available attributes in the 'Add Presentation' dialog, so I'm looking for other solutions.

What I really need is just to be able to access a combo box and manipulate its contents so that they are different based on the selection of another presentation. So...

1) Do I really need to create a custom presentation for that?

2) If I can just get away with just manipulating the contents of a combo box that was created in the Process Configuration editor, then what kind of plug-in would I need to write to do this? In other words, for creating a custom combo box, I subclassed an AttributePart. What kind of "Part" would I need to subclass?

Thanks,

David

permanent link
Patrick Streule (4.9k21) | answered Sep 30 '09, 2:20 p.m.
JAZZ DEVELOPER
After thinking about my problem a little more, it occurs to me that I
may not need a custom combo box after all. Also, I can't get it to
display in the list of available attributes in the 'Add Presentation'
dialog, so I'm looking for other solutions.

What I really need is just to be able to access a combo box and
manipulate its contents so that they are different based on the
selection of another presentation. So...

1) Do I really need to create a custom presentation for that?

2) If I can just get away with just manipulating the contents of a
combo box that was created in the Process Configuration editor, then
what kind of plug-in would I need to write to do this? In other
words, for creating a custom combo box, I subclassed an
AttributePart. What kind of "Part" would I need to
subclass?

In 2.0.0.1 or earlier, implementing a presentation is your only
possibility to realize the dependent value sets.

For 2.0.0.2, we are working on a solution for your problem and we will
extend it further for 3.0. See e.g.

https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/93937
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/95179
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/95177

--
Regards,
Patrick
Jazz Work Item Team

Your answer


Register or to post your answer.