+ Start a Discussion
Nitesh ChaureNitesh Chaure 

Pass Fields Values from VisualForce page to another redirecting page using same controller.

Hi,
I am using same Standardcontroller and Extension for both the pages, and set redirect as false. But still it create new instance of Controller and view state gets Null.
Guys Please send me anty idea, if you have to resolve this problem.
One one more error if I set setRedirect(False) then it has been  showing
the page you submitted is invalid for this session. Please click save again to confirm you chenges.  
Ankur Saini 9Ankur Saini 9
Hi Nitesh

Could you please paste your code here?

Thanks 
Ankur Saini
Nitesh ChaureNitesh Chaure
Page1

<apex:page StandardController="Account" extensions="Wizard">
  <apex:form >
      <apex:pageBlock >
          <apex:pageBlockSection >
              <apex:inputText label="Name" value="{!new1}"/>
              <apex:commandButton value="Next" action="{!nextPage}"/>
          </apex:pageBlockSection>
      </apex:pageBlock>
  </apex:form>
</apex:page>

Page2

<apex:page StandardController="Account" extensions="Wizard">
<apex:form >
  <apex:pageBlock >
  <apex:pageBlockSection >
     <apex:pageBlockTable value="{!acc}" var="a">
      <apex:column value="{!a.phone}"/>
     </apex:pageBlockTable>
      </apex:pageBlockSection>
  </apex:pageBlock>
  <apex:inputtext label="Name" value="{!new1}"/>
</apex:form>  
</apex:page>

Controller

public class Wizard
    {
    public List<account> acc{get;set;}
    public Wizard(ApexPages.StandardController controller) {
    
    acc=[select phone from Account where name=:new1];

    }

       public String new1{get;set;}
       
       public pageReference nextPage()
           {
           PageReference page1=new PageReference('/apex/Page2');
           page1.setRedirect(false);
               return page1;
           } 
    }