You need to sign in to do that
Don't have an account?
swethasfdc
java.lang.IllegalArgumentException: Illegal view ID mybutton. The ID must begin with /
Hi all,
I need a help.
I am getting an exception "java.lang.IllegalArgumentException: Illegal view ID mybutton. The ID must begin with / "
VF Page:
<apex:page controller="urlclass" tabStyle="Account"> <apex:form> enter value of var1:<apex:inputText value="{!var1}"/> enter value of var2:<apex:inputText value="{!var2}"/> <apex:commandButton action="mybutton" value="my button"/> </apex:form> </apex:page>
Apex class:
public class urlclass { public String var2 { get; set; } public String var1 { get; set; } public PageReference mybutton() { PageReference pr=new PageReference('/apex/pagerefurlexamp'); //PageReference pr=Apexpages.currentpage(); //pr.setRedirect(true); return pr; } }
Here i am trying to return to a page which i mentioned as partialURL.
But i am getting that exception.
or else
How to return to a page using Page.existingPageName which is the other method.
I would like to know in both ways.
Use
instead of
If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.
All Answers
Use
instead of
If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.
Awww...that was my mistake.....it was so simple.
I am able to work with partialURL,but when that comes to full URL it is giving the URL doesnot exist which is outside of salesforce.How to make it work??
I would also like to know using 2nd method -------->page.existingPageName
For the second method:
Pagereference pr = page.PAGENAME
The only difference AFAIK is the fact that it will tie the page to the apex code metadat and thus not allow the page to be deleted while it is still referenced in the code.
Thanks
Chamil you solved my problem