Answered
Can't figure out how to create an update form in a cfwindow tag
I finally was able to figure out how to do an add form inside
of a cfwindow tag yesterday. But I want this form to be
multipurpose, and allow edits as well. But for the life of me, I
can't figure out how to pass a row of data to the form inside a
cfwindow. Normally, I'd pass the primary key via the URL but if I
try to do that here, it basically reloads the page and closes out
the cfwindow since I have the window set to not show by default.
My page has a list of departments. My page is called departments.cfm. For each row in the department list, there is a link called edit. When the user clicks this link, I want the cfwindow to open with the cfform populated with the data from the department list for the row selected. Sounds simple enough, except how do I pass the department_id to the form? If my link is <a href="departments.cfm?id=#department_id#>Edit</a>, the cfwindow tag displays and I can see the data in it, but then closes right away. I finally figured out that it was calling the page again and the cfwindow is closing because I have it set to not display by default. I'm about ready to drop this cfwindow and just do real popup windows via javascript. And I'm normally not in favor of doing popup windows, but the application I'm working on doesn't have enough real estate on the screen to do a hidden form, so a separate window containing the form is my best solution.
Anyone have any suggestions?
My page has a list of departments. My page is called departments.cfm. For each row in the department list, there is a link called edit. When the user clicks this link, I want the cfwindow to open with the cfform populated with the data from the department list for the row selected. Sounds simple enough, except how do I pass the department_id to the form? If my link is <a href="departments.cfm?id=#department_id#>Edit</a>, the cfwindow tag displays and I can see the data in it, but then closes right away. I finally figured out that it was calling the page again and the cfwindow is closing because I have it set to not display by default. I'm about ready to drop this cfwindow and just do real popup windows via javascript. And I'm normally not in favor of doing popup windows, but the application I'm working on doesn't have enough real estate on the screen to do a hidden form, so a separate window containing the form is my best solution.
Anyone have any suggestions?