Dropdown Requirement

Hi Experts,

I have a requirement to display list of items in a Dropdown in CAF and the dropdown items appear to be bit complex which is as follows :

****Header1
----SubHeader1
A
B
C
D
----SubHeader2
E
F
G
H
****Header2
----SubHeader1
G
H
I
J
----SubHeader2
K
L
M
N
----SubHeader2
O
P
Q
R
<--------------n number of times----------->

Could someone give some tips on how i could go about this requirement ?

Thank you.

Regards,
Nischal

Hi Nischal,

What about having the Headers and SubHeaders as options and defining the elements under the SubHeaders as option groups named OG_HeaderX_SubHeaderY?

The option groups might be bound to a data provider if their content is dynamic.

Regards,
Holger

Hi Holger,

Thank you for posting your replies . In my case the Header , Subheader all are dynamic which i get from a different end system . So having Header and Subheader as options i suppose would be little tricky . Between i should have mentioned this in my first post that everything would be dynamic , I am sorry about that.

Let me know if your suggestion would help me ?

Thank you.

Regards,
Nischal

Hi Nischal,

in this case there will be only one option group populated by a data provider.

When retrieving the data from the backend system put them all in the list which is returned to the data provider.

Regards,
Holger

Hi Nischal,

Is header/sub header is supposed to be selectable item.

Can it be brought in two drop down(nested drop down)

Thanks
Baharul Islam

Hi Nischal,

It can be done using this default constructor "DefaultSelectItemProvider(String label, Object value, String description, boolean disabled, String style, String icon)
Initializes this provider with everything it needs "

All you need to do is like, have your list which needs to be there in the dropdown which includes headers and sub headers in the list as well. Create your custom GroupProvider and add the options into that using DefaultSelectItemProvider with above said constructor making required items disabled true. :slight_smile:

Regards,
Niranth