VF
<apex:page controller="temp">
<apex:form >
<apex:commandButton value="Click!" action="{!hai}">
<apex:actionSupport event="onclick" reRender="hi"/>
</apex:commandButton>
<apex:outputPanel id="hi">
{!msg}<!--By default it won't display, After clicking on button it will display-->
</apex:outputPanel>
</apex:form>
</apex:page>
public String msg { get; set; } //By default it has null value
public PageReference hai() {
msg = 'Hi'; //After clicking on this button it will display this value
return null;
}
}
<apex:page controller="temp">
<apex:form >
<apex:commandButton value="Click!" action="{!hai}">
<apex:actionSupport event="onclick" reRender="hi"/>
</apex:commandButton>
<apex:outputPanel id="hi">
{!msg}<!--By default it won't display, After clicking on button it will display-->
</apex:outputPanel>
</apex:form>
</apex:page>
APEX
public wih sharing class temp {public String msg { get; set; } //By default it has null value
public PageReference hai() {
msg = 'Hi'; //After clicking on this button it will display this value
return null;
}
}
No comments:
Post a Comment