jQuery autoselect
Today I wanted to use the jQuery autoselect feature to add an autoselect to an input field on a web page. I have heard alot about jQuery but until yesterday I really hadn't done anything with it. (how horrible is that) Yesterday I used it for the simple task of updating a text field with the value of a select dropdown field. Simple, this is all it took:
$("#jid").change(function(){
$("#city").val($("#jid option:selected").text());
});
Where jid is the select dropdown and city is the text input I wanted the text from the dropdown to be copied to.
The autocomplete was a little more complicated, but not much. I use the following as the basis for this project and pretty much just copied it and adapted it to my site:
http://www.coldfusionjedi.com/index.cfm/2010/4/12/Playing-with-jQuery-UIs-Autocomplete-Control
jQuery does make things easy. I use a cfc as in the 2nd to last example on above to return dynamic results.
Showing posts with label ColdFusion. Show all posts
Showing posts with label ColdFusion. Show all posts
Friday, May 06, 2011
Monday, May 10, 2010
Coldfusion 9 orm where in clause
I was trying to do a where in clause using coldfusion 9 orm and it just didn't work. I know pretty fast when something is over my head. A quick search revealed this thread: http://groups.google.com/group/cf-orm-dev/browse_thread/thread/19dc48732d58fca0/f47f3d4ef2e75aab?lnk=raot&fwc=1 in the cf9 orm mailing list. This thread discusses the exact issue I was wondering about. At the end, Barney Boisvert gives an example of how to do this (you have to click on "show Text" in the Bob Sivlerberg Post)
Since I can't figure out how to post code to this STUPID blog, you will have to visit the link.
I also had another issue, I wanted to still use offset and maxrows. That was easy enough even though I tried to make it hard, and you can see that solution in my post to the same group: http://groups.google.com/group/cf-orm-dev/browse_thread/thread/ab1f8badf28dfbb5?hl=en
I was trying to do a where in clause using coldfusion 9 orm and it just didn't work. I know pretty fast when something is over my head. A quick search revealed this thread: http://groups.google.com/group/cf-orm-dev/browse_thread/thread/19dc48732d58fca0/f47f3d4ef2e75aab?lnk=raot&fwc=1 in the cf9 orm mailing list. This thread discusses the exact issue I was wondering about. At the end, Barney Boisvert gives an example of how to do this (you have to click on "show Text" in the Bob Sivlerberg Post)
Since I can't figure out how to post code to this STUPID blog, you will have to visit the link.
I also had another issue, I wanted to still use offset and maxrows. That was easy enough even though I tried to make it hard, and you can see that solution in my post to the same group: http://groups.google.com/group/cf-orm-dev/browse_thread/thread/ab1f8badf28dfbb5?hl=en
Monday, January 11, 2010
Error while executing the Hibernate query.
org.hibernate.hql.ast.QuerySyntaxException: state is not mapped [from state]
This is the error I got when trying to do a simple ORMExecute("from state"). This happened because the from statement is case sensitive. I did change the name of the .cfc but I still am forced to use a uppercase "s" in "State". The tablename is tblState, so I am still confused on this one, but changing the case to match the original cfc did fix it.
org.hibernate.hql.ast.QuerySyntaxException: state is not mapped [from state]
This is the error I got when trying to do a simple ORMExecute("from state"). This happened because the from statement is case sensitive. I did change the name of the .cfc but I still am forced to use a uppercase "s" in "State". The tablename is tblState, so I am still confused on this one, but changing the case to match the original cfc did fix it.
Sunday, January 03, 2010
ColdFusion Builder Beta 3 and subclipse (subversion)
The ColdFusion Beta Builder 2 expired on Jan 1, 2010 so I was forced to do something that I wanted to do anyway, install beta 3. I did that on my mac over the weekend. Once I installed it I had a problem getting subversion back on so I could update my repositories.
The first problem was when i selected the subversion components from their site http://subclipse.tigris.org/ It had required dependencies. After unchecking a few, I think mylyn and the graphing one It allowed me to go to the accept licenses screen. However the next and finish buttons stayed greyed out no matter what I chose. I chose the radio button to accept the license agreements and even made sure to scroll through all of them to the end and everything. Nothing worked. Google search gave me this: http://hippiex.instantspot.com/blog/2009/07/13/Easy-Subclipse-and-Coldfusion-Builder. I don't know how it made a difference because I didn't choose any of the components from that site, but just adding it as a site seemed to fix the licensing issue.
After that, I got subclipse to install but upon trying to update to head my repository I got the error "Thread attempted to read nesting count of a lock it did not own". After googling that I found some advice to add all the optional components, which I went back and did, one at a time. I can't remember what order I did them in but I ended up having to add them all except for collabnet merge client before it actuall worked without giving me that error.
The ColdFusion Beta Builder 2 expired on Jan 1, 2010 so I was forced to do something that I wanted to do anyway, install beta 3. I did that on my mac over the weekend. Once I installed it I had a problem getting subversion back on so I could update my repositories.
The first problem was when i selected the subversion components from their site http://subclipse.tigris.org/ It had required dependencies. After unchecking a few, I think mylyn and the graphing one It allowed me to go to the accept licenses screen. However the next and finish buttons stayed greyed out no matter what I chose. I chose the radio button to accept the license agreements and even made sure to scroll through all of them to the end and everything. Nothing worked. Google search gave me this: http://hippiex.instantspot.com/blog/2009/07/13/Easy-Subclipse-and-Coldfusion-Builder. I don't know how it made a difference because I didn't choose any of the components from that site, but just adding it as a site seemed to fix the licensing issue.
After that, I got subclipse to install but upon trying to update to head my repository I got the error "Thread attempted to read nesting count of a lock it did not own". After googling that I found some advice to add all the optional components, which I went back and did, one at a time. I can't remember what order I did them in but I ended up having to add them all except for collabnet merge client before it actuall worked without giving me that error.
Wednesday, October 21, 2009
Displaying the Copyright Symbol © in Coldfusion Report Builder
I wanted to display the copyright symbol in coldfusion report builder. We put that at the bottom of each page in our report to state our copyright protection of our content. This took me a while to find, but it is simple. I created a query field and added the following to that field:
chr(169) & ' Copyright 2009 Companyname'
The chr(169) was the trick.
I wanted to display the copyright symbol in coldfusion report builder. We put that at the bottom of each page in our report to state our copyright protection of our content. This took me a while to find, but it is simple. I created a query field and added the following to that field:
chr(169) & ' Copyright 2009 Companyname'
The chr(169) was the trick.
Thursday, April 23, 2009
Returning SQL and other query metadata
I wanted to return the sql from a query that I was running to find out why no records were returned. Found information here about query metadata that not only returns the sql run at the server, but tells you about returning the parameters too.
qryTest.getMetaData().getExtendedMetaData().sql
qryTest.getMetaData().getExtendedMetaData().sqlparameters
I wanted to return the sql from a query that I was running to find out why no records were returned. Found information here about query metadata that not only returns the sql run at the server, but tells you about returning the parameters too.
qryTest.getMetaData().getExtendedMetaData().sql
qryTest.getMetaData().getExtendedMetaData().sqlparameters
Monday, April 20, 2009
_f is undefined
I was getting the above error in my firebug output. It was coming from an included template that I use elsewhere on the website and I couldn't figure it out. Turns out that the page from where the cfwindow is called had a form without a name and id on it. Once I gave the cfform a name and id the problem went away and it works now.
I was getting the above error in my firebug output. It was coming from an included template that I use elsewhere on the website and I couldn't figure it out. Turns out that the page from where the cfwindow is called had a form without a name and id on it. Once I gave the cfform a name and id the problem went away and it works now.
Monday, March 23, 2009
CFDIV CFFORM and Asynchronous submitting
When you submit a form inside a cfdiv it submits without refreshing the whole page, only the cfdiv. This was working great unless I hit submit a second time while but you can use ColdFusion.navigate to fix this.
onclick="ColdFusion.navigate('#event.linkto('admin.countyupdate')#','countydiv','mycallBack','myerrorHandler','POST','countyform')"
Putting this in the onclick event of the cfform button fixed the issue. I had a hard time for a while because I didn't need the mycallback and myerrorhandler arguments, but putting empty quotes worked. I know, I should probably define them.
When you submit a form inside a cfdiv it submits without refreshing the whole page, only the cfdiv. This was working great unless I hit submit a second time while but you can use ColdFusion.navigate to fix this.
onclick="ColdFusion.navigate('#event.linkto('admin.countyupdate')#','countydiv','mycallBack','myerrorHandler','POST','countyform')"
Putting this in the onclick event of the cfform button fixed the issue. I had a hard time for a while because I didn't need the mycallback and myerrorhandler arguments, but putting empty quotes worked. I know, I should probably define them.
Friday, March 20, 2009
coldfusion is not defined
I finally got my development environment setup and navigated to my local site and I got "ColdFusion is not defined" error. This had to do with being able to find the CFIDE directory for the coldfusion scripts. I had a cfmapping, but that,k I guess is not enough, I had to create a virtual directory pointing to the CFIDE directory in my IIS settings.
Got the idea from this blog entry:
http://www.mattwoodward.com/blog/index.cfm?event=showEntry&entryId=607BAA40-E199-27C4-02F5BE29E69C4318
I finally got my development environment setup and navigated to my local site and I got "ColdFusion is not defined" error. This had to do with being able to find the CFIDE directory for the coldfusion scripts. I had a cfmapping, but that,k I guess is not enough, I had to create a virtual directory pointing to the CFIDE directory in my IIS settings.
Got the idea from this blog entry:
http://www.mattwoodward.com/blog/index.cfm?event=showEntry&entryId=607BAA40-E199-27C4-02F5BE29E69C4318
Installing coldfusion 8 on vista using IIS
I am trying to install coldfusion 8 on my new dell laptop and it isn't working at all. It installs with no errors, but doesn't work. I can't choose a web server and even using the web server configuration tool says there is no webserver found. But the webserver does work. The fix?
http://dale.fraser.id.au/2008/05/coldfusion-8-vista-sp1-solution.html
I think the part that really fixed it was the comment about modifying the hosts file:
Fix: The c:\windows\system32\drivers\etc\hosts file has a bizarre entry:
::1 localhost
Comment it out using notepad run as administrator like so.
#::1 localhost
127.0.0.1 localhost
I added the 127 part on my own, but this did work. Might have been the combination of changing the iis options and modifying the hosts file, but it worked. I am up and running now.
I am trying to install coldfusion 8 on my new dell laptop and it isn't working at all. It installs with no errors, but doesn't work. I can't choose a web server and even using the web server configuration tool says there is no webserver found. But the webserver does work. The fix?
http://dale.fraser.id.au/2008/05/coldfusion-8-vista-sp1-solution.html
I think the part that really fixed it was the comment about modifying the hosts file:
Fix: The c:\windows\system32\drivers\etc\hosts file has a bizarre entry:
::1 localhost
Comment it out using notepad run as administrator like so.
#::1 localhost
127.0.0.1 localhost
I added the 127 part on my own, but this did work. Might have been the combination of changing the iis options and modifying the hosts file, but it worked. I am up and running now.
Thursday, January 22, 2009
Adding All Option CFSELECT
I am creating a web page that makes use of related cfselect's. This is a handy feature of coldfusion that allows the contents of one select box to be dependent on the contents of another. For me that means I have one select that lists areas that our company covers. Another box lists the counties we cover. Using the related selects the counties will only show for the area selected in the first box. Very nice. I also link a jurisdiction select to the counties select.
I wanted to add a default "All" option to these selects. Colfusion has an atribute for CFSELECT - queryposition which you can set to above or below. This works great if you are not using the bind attribute in CFSELECT. I was using bind to connect those cfselects so I had to find another way to add "All". I found a comment on Ben Forta's Blog by Matt Bennett that gave me sample code like the following which I adapted slightly for my own use:
sortArray = ArrayNew(1);
QueryAddColumn(qry, "sort_order", sortArray);
QueryAddRow(qry);
querySetCell(qry, "name", "All");
querySetCell(qry, "id", "0");
QuerySetCell(qry, "sort_order", "1");
SELECT *
FROM qry
ORDER BY sort_order desc, name asc
Works great, I just added that code after the qry I was already returning and boom, success.
I am creating a web page that makes use of related cfselect's. This is a handy feature of coldfusion that allows the contents of one select box to be dependent on the contents of another. For me that means I have one select that lists areas that our company covers. Another box lists the counties we cover. Using the related selects the counties will only show for the area selected in the first box. Very nice. I also link a jurisdiction select to the counties select.
I wanted to add a default "All" option to these selects. Colfusion has an atribute for CFSELECT - queryposition which you can set to above or below. This works great if you are not using the bind attribute in CFSELECT. I was using bind to connect those cfselects so I had to find another way to add "All". I found a comment on Ben Forta's Blog by Matt Bennett that gave me sample code like the following which I adapted slightly for my own use:
sortArray = ArrayNew(1);
QueryAddColumn(qry, "sort_order", sortArray);
QueryAddRow(qry);
querySetCell(qry, "name", "All");
querySetCell(qry, "id", "0");
QuerySetCell(qry, "sort_order", "1");
SELECT *
FROM qry
ORDER BY sort_order desc, name asc
Works great, I just added that code after the qry I was already returning and boom, success.
Monday, December 01, 2008
Export to CSV with Coldfusion
I am trying to finally get a good export to CSV working, using coldfusion. There are alot of posts, many of them by Ben Nadel.
Ended up using the example from: Converting A ColdFusion Query To CSV Using QueryToCSV()
This worked great except there were lots of blank rows at the top of the file and at the bottom. The fix was found here: Extra white-space after page proccess
<cfcontent reset="yes"><cfoutput>#Trim (yourvar)#</cfoutput><cfabort>
It was important to put it on one line to, otherwise there was an extra line for each line return.
I am trying to finally get a good export to CSV working, using coldfusion. There are alot of posts, many of them by Ben Nadel.
Ended up using the example from: Converting A ColdFusion Query To CSV Using QueryToCSV()
This worked great except there were lots of blank rows at the top of the file and at the bottom. The fix was found here: Extra white-space after page proccess
<cfcontent reset="yes"><cfoutput>#Trim (yourvar)#</cfoutput><cfabort>
It was important to put it on one line to, otherwise there was an extra line for each line return.
Thursday, November 27, 2008
CF 8 - "ColdFusion is not defined" JavaScript Error
I am trying to get ajax select dropdowns to work in coldfusion 8. I eventually want them to be related also. That is, the results of the second are based on the choice in the first. Well hit a wall and couldn't get the data to show up. using a test page I was able to return the correct results with a cfinvoke of the .cfc, but no data in the selects.
I didn't have firebug installed on this computer, so I went and got it and looking at the javascript error's I saw the error: CF 8 - "ColdFusion is not defined" JavaScript Error. Google that and I found the following that explained the cause:
CF 8 - "ColdFusion is not defined" JavaScript Error
The solution was to not only have a cf mapping to the cfide directory (which I already had) but also a web server virtual directory (which I didn't have). I added the virtual directory and it works.
I am trying to get ajax select dropdowns to work in coldfusion 8. I eventually want them to be related also. That is, the results of the second are based on the choice in the first. Well hit a wall and couldn't get the data to show up. using a test page I was able to return the correct results with a cfinvoke of the .cfc, but no data in the selects.
I didn't have firebug installed on this computer, so I went and got it and looking at the javascript error's I saw the error: CF 8 - "ColdFusion is not defined" JavaScript Error. Google that and I found the following that explained the cause:
CF 8 - "ColdFusion is not defined" JavaScript Error
The solution was to not only have a cf mapping to the cfide directory (which I already had) but also a web server virtual directory (which I didn't have). I added the virtual directory and it works.
Monday, November 24, 2008
Start and Stop ColdFusion and othe services.
One of those little nuggets that I picked up at the adobe conference was leaving services you don't always use stopped until you need them. Like coldfusion for instance. I will get developing and use coldfusion locally for development for days at a time. But, I don't always use it, so there is no need for it to be running if I am not using it.
Quick search and I found this: Batch files for Starting and Stopping ColdFusion.
In Vista I had to use "Run as Administrator" for those to work, but they did work like a charm. Took a long time on the main CF service the first time, but it did eventually work.
One of those little nuggets that I picked up at the adobe conference was leaving services you don't always use stopped until you need them. Like coldfusion for instance. I will get developing and use coldfusion locally for development for days at a time. But, I don't always use it, so there is no need for it to be running if I am not using it.
Quick search and I found this: Batch files for Starting and Stopping ColdFusion.
In Vista I had to use "Run as Administrator" for those to work, but they did work like a charm. Took a long time on the main CF service the first time, but it did eventually work.
Dreamforce, Adobe MAX, and BIS in Long Beach
I have been out of town 4 days each of the last 3 weeks attending one show and 2 conferences.
First was Dreamforce. Salesforce.com's annual big event. This was fantastic. I am amazed at what salesforce.com has been able to do with their platform. We have been using salesforce.com since April and I can't imagine being without it. They really have a fantastic vision and have been able to grow their business and keep most of their customers happy.
One of the Big announcements was salesforce sites. Public facing web pages that your customers can access without loggin in. Before, any access to salesforce was via controlled login access. Now you will be able to design pages for the public based on your salesforce data. This does have tremendous possibilities, especially if I was to ever move my data entry app into salesforce. We will see. But all the other stuff was cool. I learned alot and they treated us like royalty. Tons of food all the time. Free shirts, books and more. I have never before been treated so good as we were treated at Dreamforce. They seem to really care about their customers.
The second week I was at BIS in Long Beach. This is a builders show where we buy a booth and market our magazine. We also walk around and speak with other booths. This show is a good place for us to get our name out and we had pretty good success with it last year.
The 3rd week (last week) was the Adobe MAX user conference. I went to this one when it was in Salt Lake about 4 or 5 years ago. This conference was great also. They had decent food, although not as good as dreamforce and the content was above average. I learned alot and got to shake hands with and meet some of the top coldfusion guys. I am sure there a great minds in everywhere, but I feel we have some great ones in the coldfusion community.
Both these conferences where held at the Mascone Center in San Francisco. This made it easy for me because I was a little familiar with the area since I went there in late Sept for a salesforce.com administrator test.
I have been out of town 4 days each of the last 3 weeks attending one show and 2 conferences.
First was Dreamforce. Salesforce.com's annual big event. This was fantastic. I am amazed at what salesforce.com has been able to do with their platform. We have been using salesforce.com since April and I can't imagine being without it. They really have a fantastic vision and have been able to grow their business and keep most of their customers happy.
One of the Big announcements was salesforce sites. Public facing web pages that your customers can access without loggin in. Before, any access to salesforce was via controlled login access. Now you will be able to design pages for the public based on your salesforce data. This does have tremendous possibilities, especially if I was to ever move my data entry app into salesforce. We will see. But all the other stuff was cool. I learned alot and they treated us like royalty. Tons of food all the time. Free shirts, books and more. I have never before been treated so good as we were treated at Dreamforce. They seem to really care about their customers.
The second week I was at BIS in Long Beach. This is a builders show where we buy a booth and market our magazine. We also walk around and speak with other booths. This show is a good place for us to get our name out and we had pretty good success with it last year.
The 3rd week (last week) was the Adobe MAX user conference. I went to this one when it was in Salt Lake about 4 or 5 years ago. This conference was great also. They had decent food, although not as good as dreamforce and the content was above average. I learned alot and got to shake hands with and meet some of the top coldfusion guys. I am sure there a great minds in everywhere, but I feel we have some great ones in the coldfusion community.
Both these conferences where held at the Mascone Center in San Francisco. This made it easy for me because I was a little familiar with the area since I went there in late Sept for a salesforce.com administrator test.
Thursday, August 28, 2008
Installing Coldfusion 8 on Mac OSX Leopard
I just installed coldfusion 8 on my macbook pro and didn't have any problems. I read through this post first and it had instructions, but all the settings in that article were the defaults so I just clicked through and it installed no problem.
I am, once again, not sure about the directory structure. Not sure if the default /library/documents/webserver is the best place but it does work, at least the CF administrator does.
I installed the 64 bit version. The way I understand it is that with the core 2 duo processors you can get the 64 bit versions of the files
Now on to mySql.
I just installed coldfusion 8 on my macbook pro and didn't have any problems. I read through this post first and it had instructions, but all the settings in that article were the defaults so I just clicked through and it installed no problem.
I am, once again, not sure about the directory structure. Not sure if the default /library/documents/webserver is the best place but it does work, at least the CF administrator does.
I installed the 64 bit version. The way I understand it is that with the core 2 duo processors you can get the 64 bit versions of the files
Now on to mySql.
Thursday, August 02, 2007
Ten ColdFusion 8 OneLiners
Ten ColdFusion 8 OneLiners
Blog entry about some of CF8's best new features.
Ten ColdFusion 8 OneLiners
Blog entry about some of CF8's best new features.
Monday, February 26, 2007
Refreshing web services
Are you trying to create web services with CFMX, but for some reason when you make a change it is not picked up. One of those things that can frustrate you to no end. Coldfusion makes a list of web services you create and you can view them in the administrator. You can also create them in the administrator. But the key here, is you can refresh them in the administrator also.
Open your administrator for the server that publishes the web service, login, and go to Data & Services > Web Services. There you will see the services and you can refresh, delete or add.
A good article with more about it and how to do refresh web services without opening up the administrator can be found here, by Charlie Arehart.
Are you trying to create web services with CFMX, but for some reason when you make a change it is not picked up. One of those things that can frustrate you to no end. Coldfusion makes a list of web services you create and you can view them in the administrator. You can also create them in the administrator. But the key here, is you can refresh them in the administrator also.
Open your administrator for the server that publishes the web service, login, and go to Data & Services > Web Services. There you will see the services and you can refresh, delete or add.
A good article with more about it and how to do refresh web services without opening up the administrator can be found here, by Charlie Arehart.
Subscribe to:
Posts (Atom)