Last updated on
Feb 25, 2025
Alert:
All mobile and mobile-related features are removed in ColdFusion (2025 release).
View Deprecated features in ColdFusion for more information.
Before you begin, see Event Functions.
Handling the back button event
<cfclientsettings enableDeviceAPI=true>
<cfclient>
<cfset cfclient.events.onBackButton("callbackfunc")>
<cffunction access="public" name="callbackfunc" returntype="void" >
<!--- Back button pressed --->
</cffunction>
</cfclient>
<cfclientsettings enableDeviceAPI=true>
<cfclient>
<cfset cfclient.events.onBackButton("callbackfunc")>
<cffunction access="public" name="callbackfunc" returntype="void" >
<!--- Back button pressed --->
</cffunction>
</cfclient>
<cfclientsettings enableDeviceAPI=true> <cfclient> <cfset cfclient.events.onBackButton("callbackfunc")> <cffunction access="public" name="callbackfunc" returntype="void" > <!--- Back button pressed ---> </cffunction> </cfclient>
Handling the critical battery event
<cfclientsettings enableDeviceAPI=true>
<cfclient>
<cfset cfclient.events.onBatteryCritical("callbackfunc")>
<cffunction access="public" name="callbackfunc" returntype="void" >
<!--- Battery critically low! --->
</cffunction>
</cfclient>
<cfclientsettings enableDeviceAPI=true>
<cfclient>
<cfset cfclient.events.onBatteryCritical("callbackfunc")>
<cffunction access="public" name="callbackfunc" returntype="void" >
<!--- Battery critically low! --->
</cffunction>
</cfclient>
<cfclientsettings enableDeviceAPI=true> <cfclient> <cfset cfclient.events.onBatteryCritical("callbackfunc")> <cffunction access="public" name="callbackfunc" returntype="void" > <!--- Battery critically low! ---> </cffunction> </cfclient>
Handling the low battery event
<cfclientsettings enableDeviceAPI=true>
<cfclient>
<cfset cfclient.events.onBatteryLow("callbackfunc")>
<cffunction access="public" name="callbackfunc" returntype="void" >
<!--- Battery low! --->
</cffunction>
</cfclient>
<cfclientsettings enableDeviceAPI=true>
<cfclient>
<cfset cfclient.events.onBatteryLow("callbackfunc")>
<cffunction access="public" name="callbackfunc" returntype="void" >
<!--- Battery low! --->
</cffunction>
</cfclient>
<cfclientsettings enableDeviceAPI=true> <cfclient> <cfset cfclient.events.onBatteryLow("callbackfunc")> <cffunction access="public" name="callbackfunc" returntype="void" > <!--- Battery low! ---> </cffunction> </cfclient>