transient Keyword
transient - keyword is used to declare instance variables that can't be saved, and shouldn't be transmitted as part of the view state for a Visualforce page (i.e. transient variables are not part of view state).
Example 1 :
Transient Integer currentTotal;
Example 2 : uing datetime variables
Example 1 :
Transient Integer currentTotal;
Example 2 : uing datetime variables
- <apex:page controller="datetimecontroller" >
- T1 : {!t1} - non transient - part of VF page viewstate - viewstate holds its value for after refresh use <br/>
- T2 : {!t2} - transient - not part of VF page viewstate - gets new value from server for after refresh use <br/>
- <apex:form >
- <apex:commandLink value="refresh"/>
- </apex:form>
- </apex:page>
Comments
Post a Comment