0
public with sharing class soption
{
public list<selectoption> list1 = new list<selectoption>();
public list<Patient_Registration__c > list2 = new list<Patient_Registration__c >();
public String listvalue {get;set;}
public String outputtextvalue {get; set;}
public Patient_Registration__c value {get; set;}
public soption(ApexPages.StandardController controller) {
value=(Patient_Registration__c)controller.getRecord();
}
public list<selectoption> getoptionlist()
{
list2=[select id, Name__c from Patient_Registration__c ];
list1.add(new selectoption('--Select options--', '--Select options--'));
for(Patient_Registration__c pr:list2)
{
list1.add(new selectoption(pr.id,pr.Name__c));
}
return list1;
}
public String getselectedtext()
{
outputtextvalue =listvalue;
return listvalue;
}
}
비주얼 페이지 코드의 정점 코드를 통해 selectList의 값을 outputtexvalue에 listvalue의 값을 얻을 수는이 outputText
<apex:page standardController="Patient_Registration__c" extensions="soption">
<apex:form >
<apex:selectList size="1" value="{!listvalue}" onchange="{!selectedtext}">
<apex:selectOptions value="{!optionlist}">
</apex:selectOptions>
</apex:selectList>
<apex:outputText value="{!selectedtext}"/>
</apex:form>
</apex:page>
되지 않음 얻을. outputtext 값은 출력 텍스트 및 선택 목록에 사용 된 목록 값에 사용됩니다. 출력 텍스트에서 선택 목록의 가치를 얻도록 도와주세요.
변경 사항을 적용했지만 아직 작동하지 않습니다. – user3358916