You need to sign in to do that
Don't have an account?
mritz
Why am i getting above mentioned error when i click on BUTTON and go to next page.
Also, The url also remain same ---> /apex/test_pg1
I think it should change to /paex/text_pg2
Formula Expression is required on the action attributes
test_pg1 <apex:page controller="myController"> <apex:form > <apex:inputText value="{!myStr}"/> <apex:commandButton value="Click Here" action="!test_pg2"/> </apex:form> </apex:page> test_pg2 <apex:page controller="myController"> <apex:outputText value="{!myStr}"/> </apex:page> Controller public class myController{ public string myStr{get;set;} public myController(){ myStr=null; } }
Why am i getting above mentioned error when i click on BUTTON and go to next page.
Also, The url also remain same ---> /apex/test_pg1
I think it should change to /paex/text_pg2
It should be formula expression
replace the command button with this..
<apex:commandButton value="Click Here" action="{!test_pg2}"/>
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
Thanks,
Sandeep
Salesforce Certified Developer
You can not redirect the page from button directly by providing in action..
You should create one method inside your controller and then that method you shoudl call from action of this command button ..
inside that method you should use page reference tpo redirect it to another page...
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
Thanks,
Sandeep
Salesforce Certified Developer
/Apex/text_pg1
how do i change it to /Apex/test_pg2
when i redirect it??
Can you share your code so i can help you out ?
changes that i have made
test_pg1
<apex:commandButton value="Click Here" action="{!redr}"/>
myController
public PageReference redr(){
PageReference pageRef= new PageReference('/Apex/test_pg2');
pageRef.setRedirect(false);
return pageRef;
}
rest remains the same
Can you paste your entire class code here ?
public string myStr{get;set;}
public myController(){
myStr=null;
}
public PageReference redr(){
PageReference pageRef= new PageReference('/Apex/test_pg2');
pageRef.setRedirect(false);
return pageRef;
}
}
Please check below link..
The issue can happen beause may b you are working in Development mode. So Salesforce treating the page as if it had frames. So the page never updated the URL. The moment you turned development mode off it will works perfectly.
But the problem persists :(
Check the below link for the same issue which you are talking about
https://developer.salesforce.com/forums/ForumsMain?id=906F000000096rNIAQ
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
Thanks,
Sandeep
Salesforce Certified Developer