• Home
  • About George
  • Contact Me
Blue Orange Green Pink Purple

Radios and JQuery and IE8

I have to send a thank you out to pixeltastic.com for their post: Selecting Checked Radio Button with JQuery in IE8 it really saved me some time. I was trying to figure out why I couldn’t get the checked qualifier to work for IE8 when it worked everywhere else. The best part about this is [...]

Read More 0 Comments   |   Posted by George
Oct 26

What a crazy time

So I’ve been meaning to post all kinds of things lately, and before I can remember to do them, I forget. That’s what happens when new children arrive as I’m being reminded of. Trying to find time to do the things you want to do when you have twins and a two year old just don’t happen. I also feel that a great deal of this blog is missing my personal flair, so more of that is going to come out. I hope that it will attract some readers as well as when I add more of the development items in that I have in mind. No more waiting for the big long post though!

Read More 0 Comments   |   Posted by George
Aug 05

Guest Post: cftransaction & multiple datasources

I ran across an interesting error today regarding cftransactions and multiple cfqueries inside of them.
The resulting error was

The root cause was that: java.sql.SQLException: Datasource names for all the database tags within CFTRANSACTION must be the same.

This seems pretty straightforward, until you start digging into the problem, and become led down a few wrongs paths courtesy of google serving up results that aren’t entirely true.
One of the discussions I found was an adobe tech note, which I discovered via a link from a post by Ben Nadal.  In this tech note, the solution was to simply replace all cfexit tags, with a cfabort.

Simple, yes, except that I had NO cfexit tags within my cftry/cftransaction statement, they were already cfaborts!

Further investigation revealed that you simply cannot have multiple datasource names withing a cftransaction.

Now, with no actual documentation on the subject, and not actually knowing what spell coldfusion is uttering while it waves its wand over its magic hat, I cannot give a ‘good’ reason as to why.  All I know is the problem was fixed once I removed the offending query to outside the cftransaction.

In order to duplicate the desired effect, you will have to keep track of the transactions, and rollback/commit based on the prior cftransaction attempts, which is a discussion for another post.

-Dave

Read More 0 Comments   |   Posted by superdave
Aug 05

Guest Post: structDeleteAt() doesn’t play nice with webservice returns

Sooner or later, we all experience it.  The chill runs down our spines, and we stare at the computer screen, not knowing whether to cry or curse at the cryptic error that rears its ugly head and laughs at us.

What I’m referring to is, of course, coldFusion deciding that it only wants to do things a certain way, regardless of how you *think* the process should go.

Not too long in the distant past, I encountered such a beast, and will relate my story now.

The task was simple:  connect to a webservice, and display the results.  As the project progressed, the rules changed slightly – now I needed to grab the results, and filter out any that didn’t belong based upon a criterion set.  Never you mind that usually, the web service would be changed or manipulated so that a parameter or two could be passed in & perform the filtering on the server side.  That wasn’t a possibility in this case, and wouldn’t prove to have been near as much fun.

The rumblings and mutterings from the nether world began when I attempted to loop over the results and filter out any which didn’t fall within the specified criteria.  Normally, this would just involve a cfif tag to test each set of returned data to decide to display it or not.  The crux of the problem was that before entering the loop, the count of how many records were returned was displayed.  Depending on how many records were excluded, this count could be, and was, way off of the actual records that were displayed.

My initial theory was to loop over the record set returned from the webservice, and use a structDeleteAt() call to remove any records which did not match what I was trying to display.

*KABOOM*

ColdFusion refused to delete the record.  I tried everything.  Setting the value to empty, using a Javacast to set it to null, even copying the returned result set, and working with the copy.

None of it worked.

ColdFusion liked how the returned result tasted, and wasn’t about to let go, not for any amount of cajoling or cursing at it.

Finally, defeated, I tried a different approach.  Instead of using any trickery, or established CF functions or methods, I decided to bring a howitzer to this knife fight.

The answer lies in the code below.

<cfloop from="#ArrayLen(serviceReturn.contacts.anyType)#" to="1" step="-1" index="i">
<cfset tmp = serviceReturn.contacts.anyType[i] />
<cfset tmpPaidThrough = tmp.getPaidThrough() />
<cfif EXPRESSION_TO_CHECK_AGAINST >
<cfset tmpInsert = arrayappend(session.searchResults,serviceReturn.contacts.anyType[i]) />
</cfif>
</cfloop>

To explain:

  • loop over the record set returned by the webservice.
  • set the record to a temp variable, and get the part that we want to check against (in this case, paidThrough)
  • if the record passes the test, append it to a new variable (session.searchResults)
  • note that I have gone from the end of the struct to the beginning, but I believe it would work either way

Then, in the display portion of the code, instead of using the returned record set, we use the new variable we set up that only has the records in it that have passed the test for display purposes.

*VOILA*

ColdFusion, realizing that it has been defeated, slinks off to haunt some other poor soul.

I’m not entirely sure why CF would not relinquish the record of the returned set.  In discussion with other developers, we reasoned that perhaps since the return was a struct of struct of structs, somewhere in the vast underlying java mysteries, the pointers could not be moved or deleted, so CF did not want to delete the data.  Copying the returned structure resulted in a structure of the same design, so CF wasn’t able to delete from a copy any more than it could from the original record set.

So there you have it.  Wipe the blood off your sword, hoist a beer, and move on to another realm, full of it’s share of demons and battles.

-Dave

Read More 0 Comments   |   Posted by superdave
Jul 20

CFGoogle – Now that’s neat

So I stumbled across this on my twitter feed while reading what Ray Camden had put up about the rework of the riaforge.org backend to incorporate the CFGoogle api interface written by Todd Sharp. It looks really need and could provide a great deal of use to us ColdFusion junkies out there. I say check it out!

CFSilence:
CFGoogle

RiaForge:
http://cfgoogle.riaforge.org/

Read More 0 Comments   |   Posted by George
Jun 29

DefaultProperties for ColdSpring Bean Factories

So I was playing with the defaultProperties configuration as mentioned on several sites, including this article by Dan Vega that got me going down the path. I wasn’t able to get it working at first, until I did a little messing around. Turns out that this:

1
2
3
      <entry key="devFilepath">
               <value>${baseFilepath}logs</value>
      </entry>

Won’t work. The ColdSpring engine won’t find this as a configuration to populate. Instead, you have to make sure the whole space between the tags is what you want to have replaced, like so:

1
2
3
      <entry key="devFilepath">
               <value>${devFilepath}</value>
      </entry>

Hope that helps someone out!

Read More 0 Comments   |   Posted by George
Jun 17

datefield cfinputs and _f is undefined

So there have been two occasions I’ve run into this error on a page – and it’s very ambiguous and hard to track down both times I’ve experienced it.  Fortunately, both times have also involved a very easy solution once I looked through the page for the 40th time.  The first time I encountered this, the previous form designer had named both cfforms on the page the same thing.  While this worked, it’s never advisable.  By doing this, the cfcalendar script could not locate the item because it couldn’t track down the form properly.

The second time I ran into this – just a few moments ago – was the same problem surfacing because the declaration for the form had been placed inside the declaration for the table.

1
2
3
<table>
         <form></form>
</table>

This just did not sit well with the browser, being invalid and all.  Once I moved them outside of that formation and made it this:

1
2
3
<form>
      <table></table>
</form>

it worked like a champ.    Hopefully this helps someone out there with this error in the future!

Read More 8 Comments   |   Posted by George
Jun 01

Flash Builder 4 and ColdFusion for Flex

Saw this video through a link provided by Hal Helms (@halhelms) on Twitter.   Really interesting stuff about using the new Flash Builder 4 interface to import Coldfusion CFCs directly and then once you have them imported, wire them right into your Flash piece without writing any Flex code at all.

http://snurl.com/j7e56

Read More 0 Comments   |   Posted by George
May 14

Microsoft Access Truncating Memo Fields

Okay – so today one of the previous sites I had worked on was having difficulty because text was being truncated on a display section.  I looked in the database and sure enough all of the data was there, but when I ran the query that was on the page, I noticed that it was cutting off the data at about string length, 255 characters.  After some quick digging around, I came across this website:  http://allenbrowne.com/ser-63.html.  Well wouldn’t you know it.  I had a DISTINCT operator in my query, which was causing the field to be truncated down to string length.  Now that problem is solved, on to the next!

Read More 0 Comments   |   Posted by George
May 07

Limit on CFC Size?

So a few months ago I wrote a post about a java.lang.StackOverflowError I had experienced with Model-Glue and ColdSpring.   You can read about it here and here.  We it reared it’s ugly head again today.  I’m not sure exactly what is happening and maybe someone with a better knowledge of ColdSpring can help me out here.  I solved the problem by moving my new function into a different Service.cfc.  Why this worked?  I don’t know, but it seems that it has something to do with the size of the file.  It’s only running about 1500 lines in the service, but I have another service with more functions that runs 3000 lines of code.  But moving it out, definitely solves the ColdSpring compile error and allows me to move forward with development.

Any thoughts out there?

Read More 0 Comments   |   Posted by George
Apr 23

Design Considerations

So a few days ago a friend sent me this link from A List Apart that I found very useful In Defense of Eye Candy.  I found it a good read, and right on point.  There’s a lot to think about when it comes to good design.  I mean, when do we every see a bad looking site – aside from the original Plenty of Fish see this old version from the Internet Archive.  It worked because it was free.  Sometimes that helps out.  But I’m a developer – I can understand what the guy who designed Plenty of Fish was thinking.  Let’s get it working and take it from there.

To tie into this, I was recently reminded of an article I’d read quite some time ago when Hal Helms twitted about a design for developers article he’d come across.  It’s got some really good points in it.  Reset your styles so you’re forced to do things for yourself – which removes some of the unpredictability.  Set some line-height, etc.  I really enjoyed reading through it again.  I highly recommend it if you’re a developer and don’t know for sure what you’re doing when it comes to design.  My favorite point from the article by Stefano’s Linotype is when it mentions that most developers can look at two different designs and tell you which one is better.  We generally just don’t know how to do it for ourselves.

On a related note – if you’re as design challenged as I normally am, I recommend looking at templates to get an idea of what designers think looks good.  And then if you’re really feeling like taking the easy route – use the Skins from the YUI for your site.  Will give you some basic style without having to worry about what you’re truly doing.   They also have a reset stylesheet and a base stylesheet if you’re interested.

Read More 0 Comments   |   Posted by George
Previous Page 2 of 4 Next Page

Web Development By George

  • About
    About me. Edit this in the options panel.
  • Photo Stream
  • Categories
    • ColdFusion
    • coldspring
    • Databases
    • Design
    • Flash
    • Flex
    • Internet
    • JavaScript
    • jQuery
    • Model-Glue
    • Personal
    • Subversion
    • Uncategorized
    • YUI
  • Recent Articles
    • Radios and JQuery and IE8
    • Coldfusion, Flex, and SSL
    • Leaving it to the Experts
    • CFAjaxProxy Problems or RTFM
    • I love the Internet
    • Interesting ColdFusion Survey
  • Archives
    • November 2011
    • May 2011
    • May 2010
    • April 2010
    • March 2010
    • February 2010
    • January 2010
    • November 2009
    • October 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
  • Search




Add to Technorati Favorites

  • Home
  • About George
  • Contact Me

© Copyright Web Development By George. All rights reserved.
Designed by FTL Wordpress Themes brought to you by Smashing Magazine

Back to Top