You need to sign in to do that
Don't have an account?
noob123
Generate List based on a Picklist Value
I'm new to Visualforce and looking to create a page that maps out this basic workflow:
1) User selects a value from a picklist (not tied to any specific object).
2) A list of records for a specific entity is generated based on the value selected in the picklist.
How can I create a basic field and then use that selected value to plug-in to another query / list?
Thanks!
Use a page controller and have a SelectList that is filled with Select Options that you control. Use a command button with a page action that refreshes the page after filling a controller variable with the query results. You can get fancy with ajax as well (that's this whole action status bit)
<apex:page standardController="Custom_Object__c" extensions="QueryController" >
Controller code (named QueryController as an example, change it to whatever):
and finally, the doQuery:
public void doQuery(){
queryResults = [select id, name from Custom_Object__c where name = :selectedItems[0]];
}
I haven't tested the doQuery but the rest of the stuff works for me in a slightly different implementation. you should get the gist of it
There's some good docs on this in the Visualforce Developer's guide here:
http://www.salesforce.com/us/developer/docs/pages/index.htm