You need to sign in to do that
Don't have an account?
dgindy
Page:
Any ideas?
Select list And Users
I tried to create a selectlist with a controller using output from the user table.
I get a read only error with user table
Controller:
Code:
public LIST<User> getUsers() { list<User> usr = [select id,firstname,lastname from user]; return usr; }
Page:
Code:
<apex:form id="theForm" > <apex:selectList id="Id" value="{!Users}" size="1" readonly="true" > <apex:selectoption itemValue="{!Users.Id}" itemLabel="{!Users.firstname} {!Users.lastname}"></apex:selectoption> </apex:selectList> </apex:form>
Any ideas?
I think this is more what you are trying to do. The doc for selectList in the component reference is pretty much spot on with what I think you're attempting, so please take a look at it.
So when you submit your form, whatever User is selected in your list will have its id stored in selectedUser.
Message Edited by jwetzler on 06-20-2008 03:54 PM
Better yet can you just have the database return it ordered how you want it?