You need to sign in to do that
Don't have an account?
How to display a relted record of selected list
<apex:page controller="SelectList3">
<apex:form >
<apex:selectList value="{!slv}" size="1">
<apex:actionSupport event="onchange" reRender="out" />
<apex:selectOptions value="{!value}">
</apex:selectOptions>
</apex:selectList>
</apex:form>
<apex:outputPanel id="out">
<apex:outputText value="{!slv}">
</apex:outputText>
</apex:outputPanel>
</apex:page>
--------------------------controller------------------------
public with sharing class SelectList3
{
public list<selectoption> getValue()
{
list<SelectOption> ls= new list<SelectOption>();
for(Contact acc:[select id, name from Contact])
{
ls.add(new SelectOption(acc.id,acc.name));
}
return ls;
}
public String slv { get; set; }
}
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Now my question is how to pass the select value to a method..and fetch the value of record details with that id...Find detailed explination below..
In above code with the slv will return "id" of the selected value... Now using this Id I want to get related values of Account[ name etc..] please help me
Hmmm...lots of trials I got the solution, It is simple.. but It was taken so much time.. hence..My code is like below.. suggest if there is need of improvements.. Thankyou....please find the code below.