How to convert Integer to String in Visualforce page?

TEXT() is used to convert any data type to String in Visualforce page.

Sample Code:

Visualforce page:

<apex:page controller="SampleController" id="pag">
    <apex:form id="frm">    
        <apex:pageBlock >
            <apex:pageBlockSection rendered="{! CONTAINS(setIntegerString, TEXT(aa))}">
                <apex:pageBlockSectionItem >Name: <apex:inputText /></apex:pageBlockSectionItem>                  


public class SampleController {
   Set<Integer> setInteger = new Set<Integer>{1, 3};
   public String setIntegerString {get;set;}
   public Integer aa {get;set;}
   public SampleController(){
       aa = 1;
       setIntegerString = '';
       for(Integer i : setInteger){
           setIntegerString += String.valueOf(i);


No comments:

Post a Comment

Sharing is Caring!!! Share this with your friends!!!

submit to reddit