You need to sign in to do that
Don't have an account?
Sudhir_Meru
How to store SelectList Value from Visual force to Controller
Hi,
I want to store below visualforce code inside controller based on the selection is made .
VisualForce
<apex:pageBlockSectionItem >
<apex:outputLabel value="Expiry Term:" for="expireterm"/>
<apex:selectList value="{!ExpireTerms}" multiselect="false" size="1" id="expterms" readonly="true">
<apex:selectOption itemValue="1" itemLabel="1 Year"/>
<apex:selectOption itemValue="3" itemLabel="3 Year"/>
<apex:selectOption itemValue="5" itemLabel="5 Year"/>
</apex:selectList>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="Expiry Term:" for="expireterm"/>
<apex:selectList value="{!ExpireTerms}" multiselect="false" size="1" id="expterms" readonly="true">
<apex:selectOption itemValue="1" itemLabel="1 Year"/>
<apex:selectOption itemValue="3" itemLabel="3 Year"/>
<apex:selectOption itemValue="5" itemLabel="5 Year"/>
</apex:selectList>
</apex:pageBlockSectionItem>
Please suggest me.
Thanks
Sudhir
I want to store below visualforce code inside controller based on the selection is made .
VisualForce
<apex:pageBlockSectionItem >
<apex:outputLabel value="Expiry Term:" for="expireterm"/>
<apex:selectList value="{!ExpireTerms}" multiselect="false" size="1" id="expterms" readonly="true">
<apex:selectOption itemValue="1" itemLabel="1 Year"/>
<apex:selectOption itemValue="3" itemLabel="3 Year"/>
<apex:selectOption itemValue="5" itemLabel="5 Year"/>
</apex:selectList>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="Expiry Term:" for="expireterm"/>
<apex:selectList value="{!ExpireTerms}" multiselect="false" size="1" id="expterms" readonly="true">
<apex:selectOption itemValue="1" itemLabel="1 Year"/>
<apex:selectOption itemValue="3" itemLabel="3 Year"/>
<apex:selectOption itemValue="5" itemLabel="5 Year"/>
</apex:selectList>
</apex:pageBlockSectionItem>
Please suggest me.
Thanks
Sudhir
the value selected in the list will be stored in the controller variable ExpireTerms which you have mentioned in the value attribute.
did u check in this variable using debug logs ? is it not getting assiged in here ?
also i noticed you are having readonly = true in your select list. if you want to change the options then it should not be readonly.
All Answers
--KC
the value selected in the list will be stored in the controller variable ExpireTerms which you have mentioned in the value attribute.
did u check in this variable using debug logs ? is it not getting assiged in here ?
also i noticed you are having readonly = true in your select list. if you want to change the options then it should not be readonly.
Also , you need to be ensure that ExpireTerms variable has getter and setter methods in the related controller.If it has not setter method the selected value will not be assigned to this variable.
--KC
Hi All,
Thanks for your reply I changed readonly=false still values is not getting stored inside object. What is issue in get and set method am doing here.
Please suggest.
Thanks
Sudhir