Question

flash cfgrid behavior

Asked by: richardsimnett

Hello,
I am writing a web based email app that uses the flash capabilities in Coldfusion. In this particular instance I am having problems with the behavior of cfgrid. First I have a checkbox which is intended to be clickable so that the user can choose messages and delete them or move them to another message folder. Then if the user clicks on the subject line cell of the grid the user should be taken to another screen (via a specific url) where they can view the message. How do I accomplish this behavior?  The correct answer is worth 500 points.

Thanks,
Rick

Here is my code as you can see I have a onchange even commented out, but if I enable it (this should cause the user to go to the view mail cfm) the flash doesnt render. But it will work if I take the grid out of edit mode:

      <cfform name="#application.applicationname#_navForm" timeout=20 format=flash width=590 height=490 skin="haloBlue" >
      <cfformgroup type="tabnavigator" name = "mytab" id="mytab">
      <cfformgroup type="page" label="Inbox" id= "kt1" enabled = "true">
            <cfformgroup type="hbox">
            <cfgrid
                  name="Inbox"
                  <!----onchange="getUrl('manager.cfm?where=newcampaign&where2=viewcampaign&id=' + mailstats.dataProvider[mailstats.selectedIndex]['id']);"---->
                  height=400
                  width=550
                  autoWidth=yes
                  align=center
                  colheaderfont=verdana
                  colheaderfontsize=10
                  colheaderbold=yes
                  font=verdana
                  fontsize=10
                  rowheaders=no
                  selectmode="edit"
                  <!----query="getemailheaders"---->
                  notSupported="ExacTrack Requires Macromedia Flash. Please install Macromedia Flash.">

                  <cfgridcolumn Name="select" Header="" width="35" Type="Boolean" dataalign=center>
                  <cfgridcolumn name="From" header="From" headeralign=center width=105>
                  <cfgridcolumn name="Subject" header="Subject" headeralign=center width=330>
                  <cfgridcolumn name="Date" header="Date" headeralign=center width=75>
                  <cfgridcolumn name="id" header="id" width=10>

                  <cfloop query=getemailheaders>
                        <cfset rdate = dateformat(date,'mm/dd/yyyy')>
                        <cfgridrow data="0,#from#,#subject#,#rdate#,#id#">
                  </cfloop>
            </cfgrid>
      </cfformgroup>
      </cfformgroup>
      </cfformgroup>
      </cfform>

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2006-01-18 at 18:58:43ID21701947
Tags

cfgrid

,

flash

Topic

ColdFusion Application Server

Participating Experts
4
Points
500
Comments
10

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. <cfset inside <cfloop
    i have the below code which is on a page that is receiving a form post. it seems to stop working whenever i include the <cfset...> tags. i am not able to view the error page because it is a different server that is submitting to this page. anways, i guess my question is...
  2. Read the content of CFGRID
    Is there a way to read the contents of a CFGRID using CFLOOP ?
  3. CFGRID finding column names
    How do you find the column names that are returned from a CFGRID form dynamically. I can see they are returned when I do a cfdump but don't know how to call them. My code: <cfif IsDefined("form.__CFGRID__CFFORM_2__GRIDEDIT") is True> <cfdump var="#...
  4. I need to prevent duplicate rows in cfgrid (flash) and DB t…
    Hello, I have a page in my member-admin area where the member can edit their service area (zip codes). This page contains a cfgrid (format:flash) with the only editable column being zipCode. The action page that this grid subt to uses cfquery method to update, delete or inser...
  5. ColdFusion 8.0 CFGRID changes on FLASH CFFORM not …
    I'm working on creating a feature in ColdFusion 8.0.1 to allow table rows to be quickly visually moved around in a flash cfgrid, then post the form and update the data records for whatever rows were moved around. So, I populate a Flash CFGRID (inside a CFFORM) by using a que...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: javasharpPosted on 2006-01-18 at 20:46:20ID: 15736230

 

by: richardsimnettPosted on 2006-01-18 at 21:21:46ID: 15736341

javasharp,
Thats not at all what Im after. I have the code written, its a web based email proggie... I just need the flash within it to behave a certain way.

-Rick

 

by: javasharpPosted on 2006-01-18 at 21:39:11ID: 15736405

Sorry ,Just now upgraded to windows 2003, IIS is not working. I am trying to correct that. Thats why I gave you that link.

 

by: digicidalPosted on 2006-01-19 at 04:29:09ID: 15738167

oh crap... just wrote this long answer and XP screwed me by opening a browser over it and I lost it... anywhoo... no there is not a way to do exactly what you want to do (you don't know how badly I wish there was) but there are some close possibilities:

First go here: http://www.cfform.com/flashforms/invoke.cfm?objectid=E2344892-4E22-1671-5496EEE941876E5E&method=full
(a great place for tips too if you haven't been to CFFORM before).

Next go here: http://www.asfusion.com/blog/category/cfform
(also a great place)

I wrote all this code, etc... in my last answer and I don't feel like doing it again unless you're still stumped.  Basically the solution I've used it to merely have a hidden section of the form (cfformgroup) which displays the message in your case (or detail info in mine).  It also has a set of buttons that are bound to links that pass the ID of the selected record from the grid (wont work if you have the grid set to edit) and in another case simply a dropdown menu and a button that is inactive until something is selected in the grid.  So the user in that case simply selects the row they wish to work with and then the action to perform from the cfselect at the bottom and then clicks the button... at which time they are taken to an action page which includes all code required for each of the menu functions (in a cfswitch).  So in an email app you could have either buttons that all submit but with different values like 'reply', 'forward', 'read', 'delete', etc... and then on the action page code which causes that page to process which ever action you wish.  you can even make the possibility of multiselect function as shown at the links above with checkboxes.  Unfortunately I can't figure out how you can have multiple links on a single row, and neither can any of the 'gurus' who are all infinitely smarter than I am.

Perhaps you will find the holy grail yourself, and if you happen to please let both myself and Macromedia/Adobe know because I've asked they repeatedly and no one can figure out how - they told me it can't at the moment.

 

by: Mr_NilPosted on 2006-01-19 at 05:51:41ID: 15738652

onchange is not valid on a cfgrid.

Populate your cfgrid using the query attribute rather than the loop you currently have.  The reason for this is that the form will only have to compile once when using the query attribute, whereas the loop will cause the form to recompile everytime the form is accessed.

You can't get the popup to display as soon as someone clicks on the subject, but what you can do is add a "view" button to your form, which calls a function onClick that will display the message in a new window.  Its a pretty simple function.

function displayEmail(EmailID:Number):Void {
      getURL('displayEmail.cfm?EmailID='+EmailID,'EmailDisplayWindow');
}

To call it just use  onclick="displayEmail(Inbox.selectedItem.EmailID)" as a part of the "view" button on your form. eg.

<cfinput type = "button" name="ViewEmail" width="100" value = "View Email" onclick="displayEmail(Inbox.selectedItem.EmailID)">

You will need to do something similar with a delete button to go with your checkboxes.

 

by: btrevarthenPosted on 2006-01-20 at 16:48:06ID: 15754074

OnChange is certainly totally valid on a CFGRID.  And you can read any of the values of the selected row when it's clicked too.
So when a user clicks a row this will trigger onChange, you then read any values (hidden or not) and use them to decide what to do next.

For example, I use onChange to activate an otherwise disabled button so that the user must click a row before they can click "continue".

                  <cfgrid name="myGrid" query="myData" sort="yes" appendkey="yes" selectmode="row" enabled="yes" visible="yes" format="flash" onchange="continueBtn.enabled=true">
                        <cfgridcolumn name="messageID" display="no">
                        <cfgridcolumn name="messageSubject" header="Name" display="yes" select="yes">
                        <cfgridcolumn name="recordTimeStamp" header="Time Stamp" display="yes" width="125" select="no">
                  </cfgrid>
                        <cfinput type="submit" name="continueBtn" value="Continue >>>" width="270" height="40" enabled="false">

For more complex usage, you can write a function earlier in the page and then trigger that function using the onChange event in the cfGrid.

So for your URL task, you can do this...

      <cfformitem type="script">
            getMessage = function(){
                  thisMessageID = myData.selectedItem.messageID;
                  getURL("index.cfm?layout=showMessage&messageID="+thisMessageID);
            }
      </cfformitem>
      
      <cfgrid name="myGrid" query="myData" sort="yes" appendkey="yes" selectmode="row" enabled="yes" visible="yes" format="flash" onchange="getMessage();">
            <cfgridcolumn name="messageID" display="no">
            <cfgridcolumn name="messageSubject" header="Name" display="yes" select="yes">
            <cfgridcolumn name="recordTimeStamp" header="Time Stamp" display="yes" width="125" select="no">
      </cfgrid>

 

by: richardsimnettPosted on 2006-01-20 at 16:58:20ID: 15754117

btrevarthen,
ok so I totally understand what your saying, and knew that I could use an onChange event. But the question is how do I detect which cell of a grid has been clicked, and invoke a response (checking or unchecking a checkbox) or if the subject line field is clicked open the next url?

Thanks,
Rick

 

by: btrevarthenPosted on 2006-01-20 at 17:12:22ID: 15754197

Here ya go.  I made a stand-alone version since I don't have your data.
Clicking the checkbox does not selected the row, so you'll only trigger the onChange for the cfGrid when a row is selected.

     <cfform name="my_navForm" timeout=20 format=flash width=590 height=520 skin="haloBlue" >
     <cfformgroup type="tabnavigator" name = "mytab" id="mytab">
     <cfformgroup type="page" label="Inbox" id= "kt1" enabled = "true">
          <cfformgroup type="hbox">
          <cfgrid
               name="Inbox"
                     onChange="viewBtn.enabled=true"
               <!--- onchange="getUrl('manager.cfm?where=newcampaign&where2=viewcampaign&id=' + mailstats.dataProvider[mailstats.selectedIndex]['id']);" --->
               height=300
               width=550
               autoWidth=yes
               align=center
               colheaderfont=verdana
               colheaderfontsize=10
               colheaderbold=yes
               font=verdana
               fontsize=10
               rowheaders=no
               selectmode="edit"
               <!----query="getemailheaders"---->
               notSupported="ExacTrack Requires Macromedia Flash. Please install Macromedia Flash.">

               <cfgridcolumn Name="select" Header="" width="35" Type="Boolean" dataalign=center>
               <cfgridcolumn name="From" header="From" headeralign=center width=105>
               <cfgridcolumn name="Subject" header="Subject" headeralign=center width=330>
               <cfgridcolumn name="Date" header="Date" headeralign=center width=75>
               <cfgridcolumn name="id" header="id" width=10>

               <cfloop index="index" from="1" to="10">
                    <cfset rdate = dateformat(now(),'mm/dd/yyyy')>
                    <cfgridrow data='0,"me@here.com","theSubject",#rdate#,#index#'>
               </cfloop>
          </cfgrid>
             
              <cfinput type="submit" name="viewBtn" value="View Selected Message" width="270" height="40" enabled="false">
              <cfinput type="text" name="selectedSubject" label="Selected Subject:" bind="{Inbox.selectedItem.Subject}">
              <cfinput type="text" name="selectedID" label="Selected ID:" bind="{Inbox.selectedItem.id}">
             
     </cfformgroup>
     </cfformgroup>
     </cfformgroup>
     </cfform>

 

by: Mr_NilPosted on 2006-01-22 at 08:12:41ID: 15760642

> OnChange is certainly totally valid on a CFGRID.  And you can read any of the values of the selected row when it's clicked too.
>
I do apologise... You are quite correct.  Some how I completely missed it when I was looking through the docs.

 

by: btrevarthenPosted on 2006-01-22 at 14:16:05ID: 15762266

:o) Can't expect anyone to memorise all the tags, no worries.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...