Highlighted

Why is cfajax.js not *initially* loading in mobile platform/version?

Explorer ,
Oct 08, 2014

Copy link to clipboard

Copied

I am on a team developing and supporting a CF10 web application that is used on both desktop and mobile (iPad) platforms.  I have a form with 2 CFSELECTs which are bound to CFCs.

There are views for both the desktop and mobile version.  They are virtually identical *except* for the mobile form fields are in <div> tags instead of an HTML table.  They both use the same CFSELECT code:

<cfoutput>
<cfselect name="region" selected="#rc.region#" bind="cfc:applications.theApp.model.services.myApp.getRegions('#rc.DSN#',{district})" bindOnLoad="true">
</cfselect>
</cfoutput>

The desktop version works as expected, the region options change based on the 'district' select box option,but the mobile version will not work on initial page load. 

Using Chrome to emulate the mobile version, I noticed in the console that cfajax.js does not load the first time the page is accessed.  The CFSELECT form fields shows no options.

But, if I F5 refresh the page, cfajax.js does load.  The CFSELECTs appear to show no options *until* I click on them, and even then they don't quite behave correctly.

Why doesn't cfajax.js load on the initial page access?

Any help or suggestions would be greatly appreciated!

TOPICS
Advanced techniques

Views

315

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Why is cfajax.js not *initially* loading in mobile platform/version?

Explorer ,
Oct 08, 2014

Copy link to clipboard

Copied

I am on a team developing and supporting a CF10 web application that is used on both desktop and mobile (iPad) platforms.  I have a form with 2 CFSELECTs which are bound to CFCs.

There are views for both the desktop and mobile version.  They are virtually identical *except* for the mobile form fields are in <div> tags instead of an HTML table.  They both use the same CFSELECT code:

<cfoutput>
<cfselect name="region" selected="#rc.region#" bind="cfc:applications.theApp.model.services.myApp.getRegions('#rc.DSN#',{district})" bindOnLoad="true">
</cfselect>
</cfoutput>

The desktop version works as expected, the region options change based on the 'district' select box option,but the mobile version will not work on initial page load. 

Using Chrome to emulate the mobile version, I noticed in the console that cfajax.js does not load the first time the page is accessed.  The CFSELECT form fields shows no options.

But, if I F5 refresh the page, cfajax.js does load.  The CFSELECTs appear to show no options *until* I click on them, and even then they don't quite behave correctly.

Why doesn't cfajax.js load on the initial page access?

Any help or suggestions would be greatly appreciated!

TOPICS
Advanced techniques

Views

316

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 08, 2014 0
Adobe Community Professional ,
Oct 12, 2014

Copy link to clipboard

Copied

A suggestion:

<head>

<script type="text/javascript" src="/CFIDE/scripts/ajax/package/cfajax.js"></script>

</head>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 12, 2014 0
Explorer ,
Oct 13, 2014

Copy link to clipboard

Copied

I gave that very line of code a try, and all it seems to do is make the page load hang.  The dev console shows it in the queue to load or being loaded, but that's about it.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 13, 2014 0