Sample code:
Visualforce page:
<apex:page controller="Sample" >
<apex:form >
<apex:pageBlock id="pg" >
<apex:pageblockSection >
<apex:pageblockSectionItem >Check it to view the button:</apex:pageblockSectionItem>
<apex:pageblockSectionItem >
<apex:inputCheckbox value="{!option}" >
<apex:actionsupport event="onclick" action="{!change}" reRender="pg"/>
</apex:inputCheckbox>
</apex:pageblockSectionItem>
</apex:pageblockSection>
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Submit" rendered="{!bool}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Apex Controller:
public class Sample
{
public Boolean option {get;set;}
public Boolean bool {get;set;}
public Sample()
{
bool = false;
}
public void change()
{
if(option == true)
{
bool = true;
}
else
{
bool = false;
}
}
}
Output:
Visualforce page:
<apex:page controller="Sample" >
<apex:form >
<apex:pageBlock id="pg" >
<apex:pageblockSection >
<apex:pageblockSectionItem >Check it to view the button:</apex:pageblockSectionItem>
<apex:pageblockSectionItem >
<apex:inputCheckbox value="{!option}" >
<apex:actionsupport event="onclick" action="{!change}" reRender="pg"/>
</apex:inputCheckbox>
</apex:pageblockSectionItem>
</apex:pageblockSection>
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Submit" rendered="{!bool}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Apex Controller:
public class Sample
{
public Boolean option {get;set;}
public Boolean bool {get;set;}
public Sample()
{
bool = false;
}
public void change()
{
if(option == true)
{
bool = true;
}
else
{
bool = false;
}
}
}
Output:
when we use actionSupport,ActionFunction,ActionStatus in salesforce
ReplyDeletehttp://infallibletechie.blogspot.in/2012/12/apexactionstatus.html
Deletehttp://infallibletechie.blogspot.in/2012/12/rerender-based-on-selectlist-option.html
http://infallibletechie.blogspot.in/2012/10/calling-controller-method-using.html
Hello nice blog..
ReplyDeletethank you for shearing.custom check designs