Solved

CFGRID selectmode

Posted on 2001-08-28
2
522 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

695 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