Solved

CFGRID selectmode

Posted on 2001-08-28
2
516 Views
Last Modified: 2013-12-24
My form page has the following code.  On my action page I want to refer to the value of PersonID of the selected row.  I haven't been able to get this to work, even though it's probably pretty simple.  What is the exact variable name that I should use on the action page? (eg, form.MailingGrid.PersonID or what?)  Thx.



<cfform action="mailing_action.cfm" method="POST" name="loginform">

<cfgrid name="MailingGrid" height="290" width="760" query="GetListValues" selectmode="ROW" sort="yes" rowheaders="no" bgcolor="##ffffff" selectcolor="##cccccc">

<cfgridcolumn name="PersonID" select="no" display="no">
<cfgridcolumn name="NameFirst" header="First Name" select="no" width="90">
<cfgridcolumn name="NameLast" header="Last Name" select="no" width="90">

</cfgrid>
</cfform>

0
Comment
Question by:brettstil
  • 2
2 Comments
 
LVL 1

Expert Comment

by:FranzRinkleff
ID: 6437714
<cfset datasource="abc">
<html>
<head>
     <title>CFGRID</title>
</head>
<body>
     <cfif IsDefined("submitButton")>
          <cfoutput>
               #employeeGrid.full_name#
               <br>
               #employeeGrid.employee_number#
          </cfoutput>
     <cfelse>
          <cfquery name="employees" datasource="#datasource#">
               select full_name, employee_number from xyz.whiteGreen
               where current_employee = 'Y'
               order by full_name;
          </cfquery>
          <cfform name="employeeForm" action="empInfo.cfm" method="post">
               <CFGRID NAME="employeeGrid" query="employees" selectmode="ROW">
                    <cfgridcolumn name="full_name" header="Full Name">
                    <cfgridcolumn name="Employee_Number" header="Employee Number">
               </cfgrid>    
               <input type="submit" name="submitButton" value="submit">
          </cfform>
     </cfif>
</body>
</html>
0
 
LVL 1

Accepted Solution

by:
FranzRinkleff earned 50 total points
ID: 6437730
you will not be able to cut and past the code above to test it since you don't have access to my database

but this does what you want.  i think.

the big answer to your question is you put the gridname followed by the dot followed by the columnname enclosed by pound signs

so in your case on the page that is called by the form you would use the following code to display the selected information on the screen

<cfoutput>
  #MailingGrid.PersonID#
  #MailingGrid.NameFirst#
  #MailingGrid.NameLast
</cfoutput>

in my example the form calls the same page.  it checks to see if the submitbutton is defined if it is it displays the selected information.  if not it displays the form.  

if you have any questions let me know.  
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now