Posts

Jquery Mobile Dialogue box closes automatically

In Some of the browsers, jquery mobile dialogue box will close automatically without clicking on the close button. For fixing the same issue, we can set a timeout so that it won't close automatically. for example, we can set the timeout using the code: $(document).ready(function () {    setTimeout(function () {     $.mobile.changePage('#errorDialog', { transition: 'pop', role: 'dialog' }); }, 100); }); Code example: <link rel=stylesheet href=http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css /> <script src=http://code.jquery.com/jquery-1.6.min.js></script> <script src=http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js> </script> <script type="text/javascript"> $(document).ready(function () {    setTimeout(function () {     $.mobile.changePage('#errorDialog', { transition: 'pop', role: 'dialog' }); }, 100); }); </script> </head>  <bo

Fixing Cyrillic Character issue in coldfusion

For fixing cyrillic character issues, we can use the ways given below: way 1:  Keep <cfprocessingdirective pageenc oding = "utf-8"> line so that issue will get resolved. For example, <cfcomponent displayname="testCyrillic" hint="Replace special characters"> <!---To Fix Cyrillic character issue : starts---> <cfprocessingdirective pageencoding = "utf-8"> Way 2:  Create jdbc datasource and add use Unicode=yes&charactorEncoding=UTF-8 with JDBC URL. Driver class as usual:  com.mysql.jdbc.Driver For example, jdbc:mysql:// localhost:3306/mySite? useUnicode=yes& charactorEncoding=UTF-8

How to create password protected PDF documents in coldfusion

For creating password protected PDF documents, we can use the tag <cfdocument> with attributes userpassword,encryption . For example, the below code will create a PDF document which is protected by a password 'password'. <cfdocument format="PDF"  userpassword="password" encryption="128-bit">     <cfdocumentsection>         This document is password protected     </cfdocumentsection> </cfdocument>

how to find the execution time for partcular code blocks in ColdFusion

For finding the execution time of particular code blocks, we can use the ColdFusion function GetTickCount().  Without enabling the debugging information in the Administrator, we ca use the metho d GetTickCount() for finding the time used for executing a partcul ar code block. For example,  <cfset t1 = GetTickCount()> code block begin s.. ------------------------------------- code bloc k ends. <cfset  t2= GetTickCount()> <cfset t otal=t2-t1> <cfoutput> Time take n for execution was #total#</cfoutput >    

ColdFusion code to find the datasources in the server

<cfscript> adminObj = createObject("component","cfide.adminapi.administrator"); createObject("component","cfide.adminapi.administrator").login("CF admin password"); myObj = createObject("component","cfide.adminapi.datasource"); </cfscript> <cfdump var="#myObj.getDatasources()#">

Coldfusion code to get the mappings in the server

To find the mappings in the server, we can use the following code.     <cfset  mappings = StructNew()>     <cfset ServiceFactory = createObject("java","coldfusion.server.ServiceFactory")>         <cfset mappings = ServiceFactory.runtimeService.getMappings()>        <cfdump var="#mappings#">

Blank space validation in ColdFusion cfinput

For validating a required input field for blank space, we can use the attribute 'Validate="noblanks"  in the cfinput tag. For example, <cfform name="test" method="post" action="" > Name:<cfinput type="text" name="firstname"  required="yes" validate="noblanks"  message="Please Enter Your firstname"> <cfinput type=" submit" name="submit" value="Submit"> </cfform>