Skip to main content
3 of 3
added 60 characters in body; edited tags
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431

Simple getter setter

How to pass value from user side or vf page side by using this type of getter setter is there any way to pass value using this type?

Here is the Code

public class simplegetset
{
    public String userinput{
        get{
            return userinput;
        }
        set{
            this.userinput = userinput;
        }
    }
}

Here is the visualforce page

<apex:page controller="simplegetset">
  <!--<apex:form>
    <apex:outputlabel value="Enter your name here"/>
       <apex:inputtext value="{!userinput}"/>          
  </apex:form>    -->
  
  <apex:form >
    <apex:outputlabel value="Enter your name here"/>
       <apex:inputtext value="{!userinput}">
           <apex:actionsupport event="onclick" rerender="display" />
       </apex:inputtext><br/>                   
    <apex:outputpanel id="display">
        <apex:outputtext value=<b>"The name entered is = {!userinput}" </b> />
    </apex:outputpanel>                   
  </apex:form>    
</apex:page>
Bonny
  • 367
  • 3
  • 12