Does anyone know if there its possible to use a cfform within a cflayout, using type="tab"? I'd like to use the ajax calendar for a date input within the cflayoutarea but it doesn't seem to work.
Thanks
Avi Reiter
<FAKE SIGNATURE>
Does anyone know if there its possible to use a cfform within a cflayout, using type="tab"? I'd like to use the ajax calendar for a date input within the cflayoutarea but it doesn't seem to work.
Thanks
Avi Reiter
<FAKE SIGNATURE>
Short summary and focused troubleshooting for (and thanks to for the suggestions).
The calendar used by ColdFusion cfform/cfinput often fails inside a cflayout tab because of when and how CF injects scripts. If the tab content is loaded via AJAX (the source approach) the markup may arrive but the CF-generated initialization scripts either never run or run too early. That is the simplest explanation for seeing a plain text field instead of a working popup calendar.
Concrete steps to isolate and fix the issue
source, initialize the date control after the content is injected. If the ColdFusion init is hard to trigger, use a lightweight JS datepicker (jQuery UI, Pikaday, etc.) and explicitly call its initializer on the newly displayed tab element.ColdFusion's built-in Ajax UI can be brittle in these edge cases; explicit initialization from the parent or switching to a standalone JS datepicker gives a reliably reproducible solution.
Here is code for layout tabs, not sure it helps, could you put the cfform and datefield input in page1 and page2 and page3.cfm pages?
<cfajaximport tags="cfform,cflayout-border,cflayout-tab">
<cflayout type="border" name="myLayout">
<cflayoutarea name="myregion"
position="center" overflow="hidden">
<cflayout name="myTabs" type="tab" style="background-color:cornsilk;height:100%">
<cflayoutarea
title="page1"
source="page1.cfm"
overflow="visible" />
<cflayoutarea
title="page2"
source="page2.cfm"
overflow="visible" />
<cflayoutarea
title="page3"
source="page3.cfm"
overflow="visible" />
</cflayout>
</cflayoutarea>
</cflayout> Or :
<cflayout type="border" name="myLayout">
<cflayoutarea name="myregion"
position="center" overflow="hidden">
<cflayout name="myTabs" type="tab" style="background-color:cornsilk;height:100%">
<cflayoutarea
title="page1"
overflow="visible" >
<cfform>
<cfinput type="datefield" name="Mydate">
</cfform>
</cflayoutarea>
<cflayoutarea
title="Dataset"
overflow="visible" >
<cfform>
<cfinput type="datefield" name="Mydate">
</cfform>
</cflayoutarea>
<cflayoutarea
title="page3"
overflow="visible" >
<cfform>
<cfinput type="datefield" name="Mydate">
</cfform>
</cflayoutarea>
</cflayout>
</cflayoutarea>
</cflayout> We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.