Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CFGRID selectmode

Posted on 2001-08-28
2
Medium Priority
?
525 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 200 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

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

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

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

604 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