+ Start a Discussion
FastSnailFastSnail 

How to pass a Select List with its Select Option List through a component attribute?

Hello everyone,
My component:
apex:component layout="block" access="global" language="{!lan}" id="ac" >
apex:attribute name="selA" type="String" default="" description="" />
apex:attribute name="SOList" type="map" default="" description="" />

apex:selectList value="{!selA}" size="1 id="aslLinOrgMan" >
apex:selectOption itemValue="" itemLabel="Select" />
/apex:selectList>
What I would like to do is dynamically building the list <apex:selectOption> with the itemValue/itemLabel passed in the SOList map attribute, or through another approach if this is not a good one.
Is there a way to achieve this? If so, how?
Thanks in advance for your support,
All the best,
Jerome
Best Answer chosen by FastSnail
sachinarorasfsachinarorasf
Hi FastSnail,

Here you can find the VF page tags from below link:

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_selectList.htm

You can use a repeat tag for iteration the list and related list tags.

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Sachin Arora
www.sachinsf.com

All Answers

sachinarorasfsachinarorasf
Hi FastSnail,

Here you can find the VF page tags from below link:

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_selectList.htm

You can use a repeat tag for iteration the list and related list tags.

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Sachin Arora
www.sachinsf.com
This was selected as the best answer
FastSnailFastSnail
Hello Sachin,
A big THANK YOU, for the quick reply and for putting me in the right direction. The solutions was indeed using a selectOptions with an controller on my component that builds the SOList based on the ids provided as an attribute.
Have a great day.
Stay home, stay safe,
Jerome