You need to sign in to do that
Don't have an account?
❤Code
redirect to same page
Hi,
Could u please help me in the following scnearios -
1. I have a vf page which displays list of cases with a picklist in each row and a save button. I want when i press save button it will save the record and redirect me to the same page.
Currently i am not using any custom controller and the save button after click is re-directing to home page.
Could u please help me in the following scnearios -
1. I have a vf page which displays list of cases with a picklist in each row and a save button. I want when i press save button it will save the record and redirect me to the same page.
Currently i am not using any custom controller and the save button after click is re-directing to home page.
I have a simple page that does some actions based on a button push, and then comes back to the original object page. Each 'action' (i.e. button on a VF page) has its own function. In my code, the function does a bunch of things and then calls this function as its last line.
private pageReference returnToOrigination(){
PageReference page = new PageReference('/' + orgDashboardID);
page.setRedirect(true);
return page;
}
I have tried using the following apex code . But i am getting the error . Please help -
public class VioPage {
ApexPages.StandardController stdCtrl;
Public List <Violation__c> lead {get;set;}
public VioPage(ApexPages.StandardSetController controller) {
stdCtrl= controller; //////////////////////////// Error: Compile Error: Illegal assignment from ApexPages.StandardSetController to ApexPages.StandardController at line 6 column 9
lead = [SELECT Application__c,Business_Platform__c,Component__c,Severity__c,Status__c,Summary__c FROM Violation__c];
}
public PageReference save(){
upsert lead;
PageReference reRend = new PageReference('/apex/test8');
reRend.setRedirect(true);
return reRend;
}
}
Regards
Please find below my vf page code .Could you please suggest where can i modify.. Above is the controller
<apex:page standardController="Violation__c" recordSetVar="violations" tabStyle="Opportunity" sidebar="false"
extensions="VioPage ">
<apex:form >
<apex:pageBlock >
<apex:pageMessages />
<apex:pageBlock >
<apex:panelGrid columns="2">
<apex:outputLabel value="Severity Of Violation Selection:"/>
<apex:selectList value="{!filterId}" size="1">
<apex:actionSupport event="onchange" rerender="opp_table"/>
<apex:selectOptions value="{!listviewoptions}"/>
</apex:selectList>
</apex:panelGrid>
</apex:pageBlock>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!violations}" var="opp" id="opp_table">
<apex:column value="{!opp.Release_platform__c}"/>
<apex:column value="{!opp.Component__c}"/>
<apex:column headerValue="Stage">
<apex:outputField value="{!opp.Summary__c}"/>
</apex:column>
<apex:column headerValue="Line Number">
<apex:outputField value="{!opp.Line_Number__c}"/>
</apex:column>
<apex:column headerValue="Severity">
<apex:outputField value="{!opp.Severity__c}"/>
</apex:column>
<apex:column headerValue="Status">
<apex:inputField value="{!opp.Status__c}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Should i remove the
stdCtrl= controller;
Could you please help
I don't know enough VF to give a good explanation of the differences between these two. I'm sure there's online SFDC documentation on this. I also don't know enough about what you're trying to do and which is the preferred. If I had to guess, I would say use StandardController.
Can u please share me the vf and the controller code if it is ok with you.
Regards