Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Related select problem

Status
Not open for further replies.

johk02

Programmer
Aug 20, 2003
169
AU
Hi,

I am working on an registration page which will require a Related Select of 3 levels.
I have been trying both CF_ThreeSelectsRelated and MultiRelatedSelects (a tutorial found on easycfm They both work but the it takes FOREVER for the page to load.
What can I do to speed it up??
I have used cachedwithin for the query and I have 2 tables one for the localities (and postcodes) and one for the states.

Should I split the locality table up in to a table for each state i.e. one locality table for only QLD etc?
I am using MySQL 4.0 and I believe it doesn't support stored procedures otherwise that would have been a good option??
My other thought was to use CFAJAX. But wouldn't the initial page load be as long as for the the above custom tags??
And can you have 3 "levels" with CFAJAX - haven't seen any example out there.
Would it help to cache the page i.e. use cfcache - I tried it but it still doesn't make any different as it still get stuck when processing the query.

Any help or direction would be much appreciated

Please have a look here
This page is using CF_TwoSelectsRelated

Jonas
 
Hello Jonas,

What version of CF are you using? i know that if you are running MX7 then you'll be able to use FlashForms as an alternative to that AJAX method, you'll be able to use the Asycrinous (bad spelling) connection that AS provides so you'll be able to generate related selects without having to refresh the browser.

ASFusion has an excelent tutorial on this, and they use it in thier demo to find states and Zip Codes etc

I appreciate the Flash form isnt Zippety Quick, but its certainly quicker than your current version, and at least gives the user a progress bar.

If you've not worked with Flash Forms before you'll find plenty of perks, it organises the form layout real nice, and you'll also find a few nice Client Side validation type features that can be tied in with Action Scripting if you're feeling creative.

But ASFusion is an excelent rescource for anything that is FlashForm based.

I appreciate there is the whole AJax route, which i havnt really explored properly myself, but with MacroMedia producing CF, and slowly implementing this new Flex stuff, it makes sense to look down this avenue for RIA.

Hope that gives you a little food for thought.

Rob
 
Hi,

Tamedtech - thanks for the link. The client recons that most of here clients properly still use modem and she doesn't want any FLASH too as she also recons that most of her clients doesn't have FLASH. I tried to tell her that properly about 97% of all computers out there are using FLASH but didn't really get through.

I have updated the query and it runs a bit faster now but still to slow.
You see this dropdown all over the web and I just wonder how they get them to load so much faster??
I tried to use CFSAVECONTENT around the customtag to see if it helped - didn't improve much at all.
Can I somehow load the query before they hit the registration page so the query is already executed when someone goes to the page??
These dropdowns are not changing very often.

Another question is why is it such a big difference in performance btw Mozilla and IE??

Thanks

Jonas
 
Yep, i think you can use cfcache in your query to save it to the server ...

Code:
<cfquery name="yourQuery" datasource="managem6" cachedwithin="#CreateTimeSpan(0,0,15,0)#">
SELECT * FROM content_management WHERE id_ctg = 5
</cfquery>

Notice that i set a time span of 15 minutes before it clears the cache of the query, this should speed things up quite a bit.

As for differenaces in IE and FF i dont know whats causing that, i cant say i've noticed it myself.

Hope that helps,

Rob
 
I have already used cachedwithin.
I have the registration form (everything btw cfform tags and queries) in an include as I am reusing the form in other pages.
I tried to wrap the include in cfsavecontent tag but it didn't do any difference what so ever.
Code:
  <CFIF NOT IsDefined("Application.FormCache")>  
	<CFSAVECONTENT VARIABLE="FormCache">  

<cfinclude template="includes/inc_registerForm.cfm"> 
	</CFSAVECONTENT> 
	<CFLOCK SCOPE="Application" TYPE="Exclusive" TIMEOUT=30> 
		<CFSET Application.FormCache = FormCache> 
	</CFLOCK> 
</CFIF> 
<CFOUTPUT>#Application.FormCache#</CFOUTPUT>
And with regards to the mozilla and IE issue I find it very frustrating that there is such a big difference.

Thanks for your comments
Jonas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top