You need to sign in to do that
Don't have an account?
Vivek Viswanath
how do i Redirect on page load?
Hi I have a controller function that I call on page load and i also Have a condition specified which if satisfied it returns another PageReference however it dosent show the page. when I use the command with a command button it works.
public PageReference SFDCRegKitController() // This is my function
{
setOpportunityId();
setCampaignId();
getData.poplulateRegistritationKitItemsList(campaignId);
getData.populateOpportunity(this.opportunityId);
if( getData.changeToReOrderScreen == true)
{
return Page.reg_re_order;//registrationKitReOrder(); // this is the page I want to go to.
}
return null;
//getData.populateOrderItemList();
}
This is my page I put in debug statements and it goes into that part of the code and also returns the page. However its not displayed. Please let me know what I am doing wrong here
<apex:page controller="SFDCRegKitController" action="{!SFDCRegKitController}" >
</apex:page>
Message Edited by Vivek Viswanath on 07-22-2008 06:15 AM
public PageReference SFDCRegKitController() // This is my function
{
setOpportunityId();
setCampaignId();
getData.poplulateRegistritationKitItemsList(campaignId);
getData.populateOpportunity(this.opportunityId);
if( getData.changeToReOrderScreen == true)
{
return Page.reg_re_order;//registrationKitReOrder(); // this is the page I want to go to.
}
return null;
//getData.populateOrderItemList();
}
This is my page I put in debug statements and it goes into that part of the code and also returns the page. However its not displayed. Please let me know what I am doing wrong here
<apex:page controller="SFDCRegKitController" action="{!SFDCRegKitController}" >
</apex:page>
Message Edited by Vivek Viswanath on 07-22-2008 06:15 AM
public PageReference SFDCRegKitController()
{
....
String url = {your url};
PageReference p = new PageReference(url);
return p;
}
Most probably "Page.reg_re_order" merely returns the url of the other page.
Good luck
Call this function on page load.
<apex:page ............ action="{!methodname}">
write your markup here
</apex:page>
This will work.
<apex:page controller="SFDCRegKitController" action="{!SFDCRegKitController}" >
...
</apex:page>
dosent work and yes PageReference pageRef = ApexPages.currentPage(); dosee give me back a page reference.
Regards
Vivek
I Think this will be simpler the re-direct worked however the data behind it is not being shared any ideas on that?
Regards
Vivek
Message Edited by Vivek Viswanath on 07-22-2008 09:14 AM
I Think this will be simpler the re-direct worked however the data behind it is not being shared any ideas on that?
Regards
Vivek