function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AndraskoAndrasko 

create a select from name of users

Hy everyone,

 

I need a select html element with the name of users. I find the following code in the devloper's guide:

 

<apex:selectList value="{!filterId}" size="1">

    <apex:actionSupport event="onchange" rerender="list"/>

    <apex:selectOptions value="{!listviewoptions}"/>
</apex:selectList>
 
 <apex:dataList var="a" value="{!accounts}" id="list">
    {!a.name}
 </apex:dataList>

 

 

This code looks like this in the page:

http://picasaweb.google.com/adam.andrasko/Works?authkey=Gv1sRgCOWCobLA8rreUw#5559000137063594930

 

But I want to put the user in a select list:

http://picasaweb.google.com/adam.andrasko/Works?authkey=Gv1sRgCOWCobLA8rreUw#5559000137386569426

 

If anyone knows how to do this, please tell me, because I have benn trying to do this for a long time.

WesNolte__cWesNolte__c

Hey,

 

You shouldn't need the datalist element. Try this instead:

 

<apex:selectList value="{!selectedName}" size="1"> <!-- This is just a string that holds the selected value -->

    <apex:actionSupport event="onchange" rerender="list"/>

    <apex:selectOptions value="{!nameList}"/> <!-- in your controller this must be a List<SelectOption> that contains all the ids & names e.g. List<SelectOption> nameList = new List<SelectOption>{new SelectOption('Wes','00sa0ssdfxdxfd')};-->
</apex:selectList>
Wes