Search code examples
salesforceapex-codevisualforce

Error: Unknown function getHello. Check spelling


I am writing a visualforce page code:

<apex:page controller="AuthSubController" showHeader="false">
<head><title>Hello World</title>
<meta name="google-site-verification" content="XCzApP9fdbR3auxPHd3-X0g7uCNbrXZDQU_jm5GHXLI" />
</head>
     <apex:outputPanel rendered="{!$CurrentPage.parameters.token != null}"> 

The one time use token is :<b>{!$CurrentPage.parameters.token}</b>
            <br />
Record to update is {!$CurrentPage.parameters.id}
<br />
URL to update is {! getHello($CurrentPage.parameters.url)}


     </apex:outputPanel>

</apex:page>

and apex Controller segment is

public class AuthSubController {
    public string getHello(String x) {
        return x.substring(3);
    }
}

I defined getHello in my Controller class. Can someone please tell me why I am getting this error?


Solution

  • Change:

    URL to update is {! getHello($CurrentPage.parameters.url)}

    to:

    URL to update is { !Hello($CurrentPage.parameters.url) }

    will be fine.