• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFCalendar in loop?

New Here ,
Feb 23, 2008 Feb 23, 2008

Copy link to clipboard

Copied

Is it possible to create multiple <CFCalendar> tags in a loop?

I have a loop that creates a unique form for each record in a result set. My goal is to create a calendar for each of the records and use the form to allow updates to a due_date field related the record. I have used the following code (stripped down to include only necessary sections) to attempt this. When I do, only the first CFCalendar loads. I assume this has something to do with how the CFCalendar is integrated with javascript.

Is there anyway to accomplish this?

<cfloop query = "DueDateResultSet" >
<cfform format="html" name="CalenderForm_#DueDateResultSet.order_unit_id#" action="DueDate_Update.cfm" >
<cfcalendar
name="Calendar_#DueDateResultSet.order_unit_id#"
mask="mmm dd, yyyy"
dayNames="SU,MO,TU,WE,TH,FR,SA"
monthNames="JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC"
style="rollOverColor:##FF0000"
width="200" height="150"
</cfform>
</cfloop>
TOPICS
Advanced techniques

Views

350

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
community guidelines
LEGEND ,
Feb 23, 2008 Feb 23, 2008

Copy link to clipboard

Copied

I don't know why your calendar does not load, but I'm curious about why you have more than one form. The user can only submit one of them.

By the way, I see no cfoutput tag. Is that something you stripped away for brevity?

Finally, how many records did your query return?

Votes

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
community guidelines
New Here ,
Feb 23, 2008 Feb 23, 2008

Copy link to clipboard

Copied

I went with separate forms as the requirements call that the user should only submit one update. In fact, the business rules never call for a scenario to be updating more than one at a time so I thought it would be easier just to break them out as individual forms.

Regarding the <cfoutput> tags. I do not have cfoutput tags around the calendar section, but it does not appear to be affecting the dynamic outputing of my calendar name. When I do a view on source of the output page, I see name="Calendar_6665758" which is what I expected. I tried to include the <cfoutput> around the <cfcalendar> but it did not make a difference.

The query is returning 2 records.

Votes

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
community guidelines
New Here ,
Feb 24, 2008 Feb 24, 2008

Copy link to clipboard

Copied

LATEST
Well.. not sure why, but when I pull the <cfform> tags out of the loop, it did work successfully showing a new calendar for each row. Thanks Dan for leading me in the right direction with your question.

Votes

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
community guidelines
Resources
Documentation