function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Koen (BvD)Koen (BvD) 

Problems encoding properties from custom controller

Hi, 

I found in the doc examples of how to use JSENCODE and HTMLENCODE, but somehow cannot get it to work in my case. I have on my custom controller a property called CurrentDefault. It always worked ok for example used like this on the page

<apex:inputHidden id="DefaultSelection" value="{!CurrentDefault}" />

but now I want to ensure values are properly encoded, so I try for example to add HTMENCODE 

<apex:inputHidden id="DefaultSelection" value="{!HTMLENCODE(CurrentDefault)}" />

But when I try to save this I get the error

Error: Unknown property 'HTMLENCODE( CurrentDefault)'

And I don't see why, because Ithe samples from the doc do work. Also if I try the same outside of the value property it does work. So if I just put this in the page somewhere I get no errors
{!HTMLENCODE(CurrentDefault)}

As a side question, anyway I can call these functions also from the controller? I seem to have passed across an example, but can't find it back.

Koen.


Ashish_SFDCAshish_SFDC

Hi Koen , 


This is a Syntax error, Check the Modifiers , 

Remove getter methods and use Get -  Set to pass the value, 

See the thread below for similar error, 

http://stackoverflow.com/questions/7635588/unknown-property-while-using-a-list-of-class-in-vf-page


Regards,

Ashish