+ Start a Discussion
Suresh RaghuramSuresh Raghuram 

what is the syntax for the following

Public boolean var1{get;set;}


In the Controller constructor


var1 =ApexPages.CurrentPages.getParameters.get('var1');



if i declare like this for a boolean parameter it is giving error.

where as for string it is fine.


Do any body suggest me how to declare one in the controller



Try this:


var1 = Boolean.valueOf(ApexPages.CurrentPages.getParameters.get('var1'));


Suresh RaghuramSuresh Raghuram
I tried and i got this error Visualforce Error

System.NullPointerException: Argument 1 cannot be null 


External entry point




Seems like ApexPages.CurrentPages.getParameters.get('var1') is null. Check your var1 querystring parameter in the URL.