Solved

CFGRID selectmode

Posted on 2001-08-28
2
521 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

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…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

738 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