You need to sign in to do that
Don't have an account?
Satish Prajapat
How to get imput value from <apex:inputText> tag in Apex class
Hello Experts,
- I have one apex class and I displaying the list of fileds from FieldSet on VF page.
- There are some input fields, which i want in my apex code.
<!-- VF Page Snippet--> ******* ******* <apex:repeat value="{!fields}" var="f"> <apex:outputText value="{!f.Label}"/> <apex:inputText WHAT_LOGIC_I_SHOULD_USE_HERE /> <br/> </apex:repeat> ******* ******* /* Apex Code Snippet */ public List<Schema.FieldSetMember> getFields() { return SObjectType.Contact.FieldSets.Quiz_Field_Set.getFields(); }
- Whatever values I put into Input Text Box, that all value I want into my Apex Code.
For more details on working with the fieldsets, go through this documentation on fieldsets: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_dynamic_vf_field_sets.htm
Thanks,
Vivek Shinde
Hello Vivek,
I agree with your suggestion but when I tried your logic then I can not able to get the inputText value into My apex code.
It may possible that i am doing some mistake, And thanks for your reply.
You need to use inputField instead of inputText and then let's say you need to access the value of First Name, for this you need to use objContact.FirstName. Similar approach needs to be followed fo the other fields.
Thanks