You need to sign in to do that
Don't have an account?
SalesRed
Unknown Property String.length
Hello,
I am trying to check the length of a string in a visualforce page but I cannot save the page due to the following error
"Unknown Property. 'String.length'
My code is as follows
rendered="{!if(selectedItem.length==0)}"
I'm sure I must be doing something silly here but I would have thought the length function could have been used within a visualforce apex:outputPanel render check. Do you notice any typo's above. Missed brackets etc or are string functions just not allowed within a visualforce page?
Thanks in advance.
I believe you can use Len(string) in formula expressions.... i.e.
rendered="{!if(len(selectedItem)==0)}"
All Answers
I believe you can use Len(string) in formula expressions.... i.e.
rendered="{!if(len(selectedItem)==0)}"
U can try this in javascript
var y = "{!selectedItem}";
var x = y.length;
or
var x = " "{!selectedItem}".length;