Classes (1)  /  ColdFusion (12)  /  ColdFusion Jobs (2)  /  General (6)  /  JQuery (7)  /  Quick and Dirty (3)  / 
Search Blog

 

Archives
RSS

 

 

 

Adobe Community Expert in ColdFusion

 

Adobe Ceritfied Instructor

 

CTT+ Certified Technical Trainer

 

Hosted By:

Alurium Hosting

Powered by BlogCFM v1.14

15 May 2012

ColdFusion 10 is Released

http://www.adobe.com/products/coldfusion-family.h
Share |
Posted by admin at 6:03 AM| Link  |  0 comments |

 

19 April 2012

Error Executing Database Query. [Macromedia][SQLServer JDBCDriver][SQLServer]Could not find prepared statement with handle 0

Simple solution to a weird problem

Here's a quick one. Yesterday I was trying to get a site up and running locally, lots of code in Coldspring. When I ran the site for the first time one of the queries errored out. I corrected the query and re ran and got the following error: Error Executing Database Query. [Macromedia][SQLServer JDBCDriver][SQLServer]Could not find prepared statement with handle 0

I went around and around with different blogs suggesting that it's a driver issue and various other things.. However I found a very simple solution:

Go into the ColdFusion Administrator and find the datasource for the query that's causing the error, open up the advanced settings and turn off "Maintain Connections Across Multiple Requests"and click the submit button. Immdiatly go back into the same datasource and turn this setting back on.

Problem Solved.

Share |
Posted by admin at 8:42 AM| Link  |  0 comments |

 

17 January 2012

This site will go dark for 24 hours

Starting tomorrow at 8:00AM
As part of the internet blackout protesting SOPA and PIPA, my blog will go dark for 24 hours, starting tomorrow at 8:00AM. See http://sopastrike.com for details.
Share |
Posted by admin at 4:35 PM| Link  |  0 comments |

 

13 December 2011

Why is there an Amazon Wish list button on my blog?

The short answer is "because I can" :)

The long answer is this: If you've found something usefull on my blog, feel free to hit the wish list link.
I don't ask for donations or payment. Alot of what you'll see here are things that I've run into as a developer, that I feel are worth passing along..

Share |
Posted by admin at 12:00 PM| Link  |  0 comments |

 

Security Hotfix Available for ColdFusion 8 & 9

Released today
Released today, this has a "recommended" status from Adobe
http://www.adobe.com/support/security/bulletins/apsb11-29.html
Share |
Posted by admin at 11:54 AM| Link  |  0 comments |

 

21 November 2011

Twister -It's not just a game anymore

The next version of ColdFusion Builder is code named "Twister"

 

Hemant Khandelwal, part of the CF Builder team posted this to the CF Builder blog: Code Name: Twister

If there's a pet bug that you'd like to see fixed, post it here

Share |
Posted by admin at 5:29 AM| Link  |  0 comments |

 

17 November 2011

Dynamic colspans with jQuery

making sure that dynamic columns don't break a table structure

If you've ever had to create forms that have a user-clonable rows or columns you've probably had to figure out how to change column or row spanning, here's a quick run through of how I did i with jQuery.

The requirement: Click an element and add a column to a table, the table happens to be a form.

First: capture the click event, the form is part of a larger Ajax feature so I'm using the "live" method to keep the reuqest alive

$('#addFlight').live('click', function(event){

});

Inside of this function, we need to get the current value of the "colspan" attribute of the cell in question, using the jQuery .attr() function.

/* get the current colspan value from the row containing the segment info */
var cSpanL = $('td.depFormTitleTop').attr('colspan');

We're adding one column at a time so we can add one to the value and get away with it

/* add 1 to it */
cSpanL = cSpanL + 1

One of the other things that .attr() can do is update existing attributes, so we'll use the variable we created above

/*update the colspan value and we have a dynamic columnspan*/
$('td.depFormTitleTop').attr('colspan', cSpanL);

and voila, a dynamic colspan attribute that updates when we add a column.

To complete the requirement we need to do the actual column add, there's a couple of things to point out:

  • I'm using X-Path to find any table row inside of my table(id="departureGridTable") that contains the word "week".
  • Secondly I'm using chaining to grab the last cell in a particular row, clone it and append it into the new column

So here we go:

First, we need to find the rows in question, regardless of how many their are and loop over them, jQuery can do for each loops with the each() function.

$('#departureGridTable tr[id~="week"]').each(function(){

});

Then we grab the last existing cell in the row, clone it and append it to the row

$(this).append($(this).children().last().clone());

$(this) refers to the row that were dealing with through each iteration

/* find the last flight number cell, clone it and append it to the flight number row*/
$('#departureGridTable tr[id~="week"]').each(function(){

})

Similarly we can now populate the cells in the column

/* clone the flight status drop down for each row sun - sat*/
$('[data-spack]').each(function(){
var dCell = $('td:last', this).clone();
$(this).append(dCell);
});

If you're wondering what this is: $('[data-spack]'). JQuery allows you to use HTML 5 'data-' elements. I use them all over the place as a data transport mechanism.

The complete code looks like this:

$('#addFlight').live('click', function(event){

/* get the current colspan value from the row containing the segment info */
var cSpanL = $('td.depFormTitleTop').attr('colspan');

/* add 1 to it */
cSpanL = cSpanL + 1

/*update the colspan value and we have a dynamic columnspan*/
$('td.depFormTitleTop').attr('colspan', cSpanL);

/* find the last flight number cell, clone it and append it to the flight number row*/
$('#departureGridTable tr[id~="week"]').each(function(){
$(this).append($(this).children().last().clone());
})

/* clone the flight status drop down for each row sun - sat*/
$('[data-spack]').each(function(){
var dCell = $('td:last', this).clone();
$(this).append(dCell);
});


});




Share |
Posted by admin at 10:10 AM| Link  |  0 comments |

 

09 November 2011

BitAnd

a different way to alternate
We've all found a billion ways to achieve some kind of alternating event in our websites, whether it's alternating row colors, content or a myriad of other things..

In the ColdFusion world we use the CF Mod() function alot.. but did you know how much overhead it actually creates? For each iteration it must divide the numbers in question and look at the remainder. Based on that remainder the Mod is either odd or even...

but..

I stumbled on to a better way, ColdFusion has a function called BitAnd(), instead of dividing numbers this works at the bit level and it's substantially faster:

Ben Nadel does a great overview here: http://www.bennadel.com/blog/668-Using-BitAnd-To-Determine-Odd-Even-Rows-Thanks-Tony-Petruzzi-.htm.

I've found a significant performance increase, especially with large data outputs needing alternating something..

Share |
Posted by admin at 10:18 AM| Link  |  0 comments |

 

27 July 2011

Technorati Verification

E3FWQWS6J75C
Technorati wants to verify my blog so here's the verification code: E3FWQWS6J75C
Share |
Posted by admin at 2:19 PM| Link  |  0 comments |

 

25 July 2011

Restoring .Net Connectivity in CF 9.01

...DotNet Side does not seem to be running

It's been a while since I've posted anything.. I'm in the process of rebuilding this blog backend and patching some security holes. But I ran into something important that needs to be shared.

I ran into an issue with the ColdFusion 9.01 Upgrade and .Net connectivity..

The Issue:

To be brief, when you upgrade, it breaks .Net connectivity.

What I did:

I installed the 9.01 Upgrade, all seemed well, all of the proper services were running, until I made a call to a .Net assembly..

"Ensure that the DotNet agent is running and you have provided the correct  host and port information
DotNet Side does not seem to be running. ".

Obviously this is not good..

The solution:

there are two parts to the solution

When you upgrade to 9.01 it doesn't upgrade the .Net Connector, it's a separate download (note: make sure you choose the 9.01 Installer) but this is only part of the solution. In some cases, namely mine, The install doesn't sync the port numbers correctly in “C:\ColdFusion9\jnbridge\JNBDotNetSide.exe.config and neo-dotnet.xml. The port assignments in these files must be identical as shown in this article: How to resolve error “DotNet Side does not seem to be running” with Coldfusion 901 on Windows . Once youve cleaned these files up.. restart the box.

Share |
Posted by admin at 12:12 PM| Link  |  0 comments |

 

 

© 2011 Scott Stewart / SSTWebworks
Design by Contented Designs