You need to sign in to do that
Don't have an account?
Shirish Dwivedi
Set Default string value to a textbox on my vf page.
I want the textbox on my page to have a String value "True" in the textbox area. It should be set automatically whenever the page is opened/reloaded.
I tried using get & set but did not work.
Here is what my code looks like -
VF page -
<apex:inputText value="{!searchString}" onkeydown="if(event.keyCode==13){this.blur();}else{resetTimer();}" style="width:200px"/>
Controller -
public string searchString {get;set;}
public String getsearchString(){
return 'True';
}
public String setsearchString(String searchString){
if (this.searchString==searchString) {
return 'True';
}
else {
return null;
}
}
I dont know but the value in the textbox is not pre-set to "True" when I load the page. Any help will be appreciated?
I tried using get & set but did not work.
Here is what my code looks like -
VF page -
<apex:inputText value="{!searchString}" onkeydown="if(event.keyCode==13){this.blur();}else{resetTimer();}" style="width:200px"/>
Controller -
public string searchString {get;set;}
public String getsearchString(){
return 'True';
}
public String setsearchString(String searchString){
if (this.searchString==searchString) {
return 'True';
}
else {
return null;
}
}
I dont know but the value in the textbox is not pre-set to "True" when I load the page. Any help will be appreciated?
It did not work this way. My textbox still does not have a "true" value written in it.
Is there any other way around?