ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 9th, 2005, 02:40 PM
midimidi midimidi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 83 midimidi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 29 m
Reputation Power: 4
Flash Form - addItem to cfgrid?

Hi all, I'm building my first complicated Flash Form.

In my example I start with an editable cfgrid formed via a query. Secondly there are two cfinput boxes bound to the grid. A cfselect follows (formed via a different query). Finally, I have a second cfgrid formed via a third query.

What I'd like to do -
1) User selects item in the first cfgrid - values are bound to the two cfinput boxes.
2) User selects an item in the cfselect box.
3) User clicks a button to copy these three values to the second cfgrid.


I know the button requires addItem (?), but the farthest I can get with addItem is for it to add an empty row in he grid. Any values I pass on are not copied. Could someone take me through this?

Reply With Quote
  #2  
Old December 9th, 2005, 03:03 PM
midimidi midimidi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 83 midimidi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 29 m
Reputation Power: 4
Some code I'm working with:

Code:
	<cfquery name="qryNames" datasource="cmntmgmt">
	SELECT names.nameID, names.first, names.last, names.phone, names.departmentID, departments.departmentID, departments.department
	FROM names, departments
	</cfquery>
	
	<cfquery name="qryRoles" datasource="cmntmgmt">
	SELECT roleID, role
	FROM roles
	</cfquery>

	<cfquery name="qryRoleJoin" datasource="cmntmgmt">
	SELECT roles.roleID, roles.role, rolejoin.rolejoinID, rolejoin.projectID, rolejoin.nameID, rolejoin.roleID, names.nameID, names.first, names.last, projects.projectID, projects.title
	FROM roles, rolejoin, names, projects
	WHERE roles.roleID = rolejoin.roleID AND names.nameID = rolejoin.nameID AND projects.projectID = rolejoin.projectID
	</cfquery>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<cfform format="flash">
	<cfformgroup type="vbox">
		<cfgrid name="GridqryNames" query="qryNames" rowheaders="yes" width="700" height="200" insert="yes" delete="yes" selectmode="edit">
			<!--- hidden --->
			<cfgridcolumn name="nameID" display="no" select="no">
			<!--- display --->
			<cfgridcolumn name="first" header="First Name">
			<cfgridcolumn name="last" header="Last Name">
			<cfgridcolumn name="phone" header="Phone" mask="999-999-9999">
			<cfgridcolumn name="department" header="Department" select="no">
		</cfgrid>
	</cfformgroup>
	
	<cfformgroup type="vbox">
		<!--- hidden --->
		<cfinput type="text" label="" name="rolesNameID" visible="no" required="no" width="200" bind="{GridqryNames.selectedItem.nameID}">
		<!--- display --->
		<cfinput type="text" label="First" name="rolesFirst" required="no" width="200" bind="{GridqryNames.selectedItem.first}">
		<cfinput type="text" label="Last" name="rolesLast" required="no" width="200" bind="{GridqryNames.selectedItem.last}">
		<cfselect label="Role" name="roleslist" query="qryRoles" required="no" width="200" display="role" value="roleID"></cfselect>
		<cfinput type="button" name="addrolebtn" value="Add Role" onClick="<!--- some type of addItem code goes here --->">
	</cfformgroup>
		
	<cfformgroup type="vbox">
		<cfgrid name="GridRoles" query="qryRoleJoin" rowheaders="yes" width="500" height="200" delete="yes" insert="yes">
			<!--- hidden --->
			<cfgridcolumn name="roleID" display="no">
			<cfgridcolumn name="projectID" display="no">
			<cfgridcolumn name="nameID" display="no" >
			<!--- display --->
			<cfgridcolumn name="title" header="Project Name">
			<cfgridcolumn name="first" header="First Name">
			<cfgridcolumn name="last" header="Last Name">
			<cfgridcolumn name="role" header="Role">
		</cfgrid>
	</cfformgroup>
</cfform>

<body>
</body>
</html>

Reply With Quote
  #3  
Old December 12th, 2005, 11:36 AM
midimidi midimidi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 83 midimidi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 29 m
Reputation Power: 4
OK - got this to work with the following code in the Add Role button:

onClick="GridRoles.dataProvider.editField(GridRoles.selectedIndex, 'rolesFirst', rolesFirst.text);
GridRoles.dataProvider.editField(GridRoles.selectedIndex, 'rolesLast', rolesLast.text);
GridRoles.dataProvider.editField(GridRoles.selectedIndex, 'role', role.text);"

Reply With Quote
  #4  
Old December 12th, 2005, 01:49 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,742 kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level)kiteless User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 20 h 59 m 14 sec
Reputation Power: 62
Nice, this will be handy to know when I have the chance to mess with the Flash grid.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #5  
Old December 12th, 2005, 02:39 PM
midimidi midimidi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 83 midimidi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 29 m
Reputation Power: 4
Quote:
Originally Posted by kiteless
Nice, this will be handy to know when I have the chance to mess with the Flash grid.


np - I'm really finding some of the limitations in Flash Forms to be quite annoying - only because flash forms are so cool! I really need to get a better grasp of the AS actions and how they work...


Something that still doesn't work tho... - I'm still trying to add a line to the grid without doing it manually. i.e., in its current form, the user still has to click "Insert" on the cfgrid, then with that new line selected, the user clicks the Add Role button.

I've tried the following additional code, but it only enters empty rows. If anyone knows how to accomplish this, let me know!!

Code:
onClick="GridRoles.addItem();
GridRoles.dataProvider.editField(GridRoles.selectedIndex, 'rolesFirst', rolesFirst.text);
GridRoles.dataProvider.editField(GridRoles.selectedIndex, 'rolesLast', rolesLast.text);
GridRoles.dataProvider.editField(GridRoles.selectedIndex, 'role', role.text);"

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Flash Form - addItem to cfgrid?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT