You need to sign in to do that
Don't have an account?
Ranadheer ch
How to save my <apex:inputfield> with my custom save method which is in controller
Here inthis page using the {!SaveDueFrom} i can insert the input text values into object..but i also want to insert the inputfiled values also with the same action what to do? How to pass that to that SaveDueFrom method in controller.
My vf page:
<apex:page standardController="File_New_Protest__c" Extensions="Filenewexten">
<apex:form>
<apex:pageBlock >
<apex:pageBlockSection title="Protester " columns="3">
<apex:inputText value="{!CompanyName}" />
<apex:inputText value="{!StreetName}" id="cstreet"/>
<apex:inputField value="{!File_New_Protest__c.Agency_Tier1__c}"/>
<apex:inputField value="{!File_New_Protest__c.Comments__c}"/>
<apex:commandButton value="Save" action="{!SaveDueFrom}"/>
</apex:pageBlockSection>
</apex:pageBlock >
<apex:form>
<<apex:page>
My controller:
public with sharing class Filenewexten {
public Filenewexten(ApexPages.StandardController controller) {
}
public string CompanyName{get;set;}
public string StreetName{get;set;}
public Void SaveDueFrom(){
File_New_Protest__c Insertfile=New File_New_Protest__c();
Insertfile.Company_Name__c=CompanyName;
Insertfile.Street_Name__c=StreetName;
insert(Insertfile);
}
please help me inthis ...thanks in advance
My vf page:
<apex:page standardController="File_New_Protest__c" Extensions="Filenewexten">
<apex:form>
<apex:pageBlock >
<apex:pageBlockSection title="Protester " columns="3">
<apex:inputText value="{!CompanyName}" />
<apex:inputText value="{!StreetName}" id="cstreet"/>
<apex:inputField value="{!File_New_Protest__c.Agency_Tier1__c}"/>
<apex:inputField value="{!File_New_Protest__c.Comments__c}"/>
<apex:commandButton value="Save" action="{!SaveDueFrom}"/>
</apex:pageBlockSection>
</apex:pageBlock >
<apex:form>
<<apex:page>
My controller:
public with sharing class Filenewexten {
public Filenewexten(ApexPages.StandardController controller) {
}
public string CompanyName{get;set;}
public string StreetName{get;set;}
public Void SaveDueFrom(){
File_New_Protest__c Insertfile=New File_New_Protest__c();
Insertfile.Company_Name__c=CompanyName;
Insertfile.Street_Name__c=StreetName;
insert(Insertfile);
}
please help me inthis ...thanks in advance
Visualforce:
Apex Classes:
Hope this helps!
PS: if this solves your problem then mark it as solution.