Cfgrid prepopulate cfselect
I have trouble prepolualting cfselect in the flash form. When
i click on the cfgrid I want specific drop down to be prepopulated
(i have 18 of them) based on the type.
Here is my cfgrid
<cfgrid name="myGrid" query="tempQuery" height="445"
width="200" rowheaders="false" onchange="#getComboBoxValue#">
<cfif menuQuery.menuID is not lloc>
<cfgridcolumn name="menuID" header="menuID" display="no"
/>
<cfgridcolumn name="label" header="label" />
<!--- <cfgridcolumn name="link" header="link"
/>--->
<cfset lloc= menuQuery.menuID>
</cfif>
</cfgrid>
And here is the drop downs
<cfloop index="i" list="#lLIst#">
<cfscript>
LoadaccessLevelType =
createObject("component","Erik.maintenace").LoadaccessLevelType(#i#);
</cfscript>
<cfselect query="LoadaccessLevelType" value="accessLevel"
display="description" name="access#i#" width="200"
label="#LoadaccessLevelType.display#"/>
</cfloop>
Where lList is number from 1 to 18.
My actionScript is here
<cfsavecontent variable="getComboBoxValue">
<cfloop query="TempQuery">
<cfif TempQuery.accessType neq ''>
//Set a temp variable to hold the current comboBox value
var temp1;
//Loop through all the comboBox values
for(var i = 0; i < access#accessType#.length; i++){
//if (myGrid.selectedItem.accessType == temp1) {
//set the comboBox to the current index
access#accessType#.selectedIndex=i;
//set temp to the value of the comboBox
temp1=access#accessType#.value;
//if temp equals the selected clientID then stop looping
through the comboBox
if(temp1==myGrid.selectedItem.accessValue){
break;
</cfif>
</cfloop>
</cfsavecontent >
There are too many things going on: function call on an
object instance, actionscript function stored in a variable and the
grid itself. It is difficult to debug. I would start by using an
actual query to test the code.
Similar Messages
-
Cfselect, cfinvoke, cfgrid in flash forms
In an MX7.02 cfform format="flash"
I would like a user to select an option in a cfselect. (e.g.
name)
The selected value would be passed to a cfinvokeargument
the cfc returns the query results to a cfgrid
get agent names....
<CFINVOKE COMPONENT="agentQA"
METHOD="getAgents"
RETURNVARIABLE="aData">
populate cfselect....
<cfselect label="Agent" visable="yes" name="agent"
query="aData" value="message_author" display="message_author">
</cfselect>
query messages posted by the selected agent...
<CFINVOKE COMPONENT="agentQA"
METHOD="getquery"
RETURNVARIABLE="qData">
<cfinvokeargument name="agent" value="??????????????">
</cfinvoke>
don't know how to bind the selected agent name to the
argument????????
output only the selected agent's messages to messagesgrid
<cfgrid format="flash" width="100%" height="100%"
name="messagegrid" query="qData" rowheaders="false">
</cfgrid>
Any suggestions? I'm open to a different approach since I'm
just learning flash forms in CF.
Thanks,
DonUsing the
selected="[your value]" argument.
This can be a value from a query.
For instance, try the example in
http://livedocs.macromedia.com/coldfusion/7/htmldocs/00000331.htm
but add
selected="4" to the cfselect tag
i.e.:
<cfselect
name = "employeeid"
size = "1"
multiple="yes"
required = "No"
query = "GetAllEmployees"
display ="name"
value ="emp_id"
queryPosition="Below" width="100" selected="4">
4 is the emp_id value of Aaron Smith.
In your application, you would replace
selected="4" with
selected="[your database value]" -
Select in cfselect from cfgrid
Form is flash CF 7.01
Is there a way to have a cfselect "selected" option chosen by
a cfgrid
selection either by binding or flash remote?
Here is my form. Thanks for any help you can give...
The binding on the second cfselect does not work.
<cfform action="maina.cfm" method="post" name="usermaint"
preservedata="true" preloader="yes" format="flash"
height="500" width="400"
skin="haloblue">
<cfformgroup type="tabnavigator" visible="yes"
enabled="yes"
name="mytab" id="mytab" onchange="#getdata#"
style="backgroundAlpha: 0;"
wmode="transparent">
<cfformgroup type="page" label="New User"
selectedindex="1"
visible="yes" enabled="yes">
<cfinput type="text" name="uName" message="A user name is
required"
label="User Name" required="yes">
<cfinput type="password" name="password" message="A
password is
required" label="Password" required="yes">
<cfinput type="password" name="password1" message="A
confirming
password is required" label="Confirming password"
required="yes">
<cfselect name="SecLevel" size="1" label="Security"
query="secl"
value="level" display="level" selected="User"
width="75"></cfselect>
<cfinput type="button" name="Submit" value="Submit"
onclick="#adduser#">
</cfformgroup>
<cfformgroup type="page" label="Edit User"
selectedindex="1"
visible="yes" enabled="yes">
<cfgrid name="userslist" height="165" width="250"
query="listusers"
selectmode="edit" format="flash" autowidth="true">
<cfgridcolumn name="uName" header="User Name"
headeralign="left"
dataalign="left" width="86" bold="no" italic="no" select="no"
display="yes"
headerbold="no" headeritalic="no" />
<cfgridcolumn name="SecLevel" header="Admin"
headeralign="left"
dataalign="left" width="46" bold="no" italic="no" select="no"
display="yes"
headerbold="no" headeritalic="no" />
</cfgrid>
<cfinput type="text" name="uNameA" message="A user name
is required"
bind="{userslist.selectedItem.uName}" label="User Name"
required="yes">
<cfinput type="password" name="passwordA" message="A
password is
required" bind="{userslist.selectedItem.password}"
label="Password"
required="yes">
<cfinput type="password" name="password1A" message="A
confirming
password is required"
bind="{userslist.selectedItem.password}"
label="Confirming password" required="yes">
<cfselect name="SecLevelA" size="1" label="Security"
query="secl"
value="level" display="level"
selected="{userslist.selectedItem.SecLevel}"
width="75"></cfselect> <cfinput type="button"
name="SubmitA"
value="Update" onclick="#edituser#">
</cfformgroup>
</cfformgroup>
</cfform>Never mind figured it out using remoting.
myService.getselect(gridname.selectedItem.fieldname);
"Rick" <[email protected]> wrote in message
news:[email protected]...
> Form is flash CF 7.01
>
> Is there a way to have a cfselect "selected" option
chosen by a cfgrid
> selection either by binding or flash remote?
>
> Here is my form. Thanks for any help you can give...
>
> The binding on the second cfselect does not work.
>
> <cfform action="maina.cfm" method="post"
name="usermaint"
> preservedata="true" preloader="yes" format="flash"
height="500"
> width="400" skin="haloblue">
> <cfformgroup type="tabnavigator" visible="yes"
enabled="yes"
> name="mytab" id="mytab" onchange="#getdata#"
style="backgroundAlpha: 0;"
> wmode="transparent">
> <cfformgroup type="page" label="New User"
selectedindex="1"
> visible="yes" enabled="yes">
>
> <cfinput type="text" name="uName" message="A user
name is required"
> label="User Name" required="yes">
> <cfinput type="password" name="password" message="A
password is
> required" label="Password" required="yes">
> <cfinput type="password" name="password1" message="A
confirming
> password is required" label="Confirming password"
required="yes">
> <cfselect name="SecLevel" size="1" label="Security"
query="secl"
> value="level" display="level" selected="User"
width="75"></cfselect>
> <cfinput type="button" name="Submit" value="Submit"
> onclick="#adduser#">
> </cfformgroup>
> <cfformgroup type="page" label="Edit User"
selectedindex="1"
> visible="yes" enabled="yes">
> <cfgrid name="userslist" height="165" width="250"
query="listusers"
> selectmode="edit" format="flash" autowidth="true">
> <cfgridcolumn name="uName" header="User Name"
headeralign="left"
> dataalign="left" width="86" bold="no" italic="no"
select="no"
> display="yes" headerbold="no" headeritalic="no" />
> <cfgridcolumn name="SecLevel" header="Admin"
headeralign="left"
> dataalign="left" width="46" bold="no" italic="no"
select="no"
> display="yes" headerbold="no" headeritalic="no" />
> </cfgrid>
> <cfinput type="text" name="uNameA" message="A user
name is
> required" bind="{userslist.selectedItem.uName}"
label="User Name"
> required="yes">
> <cfinput type="password" name="passwordA" message="A
password is
> required" bind="{userslist.selectedItem.password}"
label="Password"
> required="yes">
> <cfinput type="password" name="password1A" message="A
confirming
> password is required"
bind="{userslist.selectedItem.password}"
> label="Confirming password" required="yes">
> <cfselect name="SecLevelA" size="1" label="Security"
query="secl"
> value="level" display="level"
selected="{userslist.selectedItem.SecLevel}"
> width="75"></cfselect> <cfinput
type="button" name="SubmitA"
> value="Update" onclick="#edituser#">
> </cfformgroup>
> </cfformgroup>
> </cfform>
> -
CF11 - CFGRID & CFSELECT binding issue
We just upgraded to CF11 and one of our apps had pieces stop functioning. We have figured out most of it, however one of our cfgrids is having issues. When the page is loaded the cfgrid hits the CFC that is specified in the bind settings (passes in the default employee ID of 0 and returns no data). When we select an employee name from the dropdown menu, we receive a 400 error saying the page can't be found. When the select is changed, it looks like it reverts to the root path instead of the cfc specific in the bind argument. Does anyone have any idea on the direction we should go to fix this? The exact same code works on CF8... but is completely broken on CF11.
Thanks for your help.BKBK Sorry for the confusion... we set an array for the arguments, below is the full block of code.
<cfform id="evaluation" name="evaluation">
<div style="height:30px; margin-top:10px;">
<div style=" margin-right:10px; float:left;">
<cfselect name="employee" query="EmployeeList" value="affiliateID" display="empName" queryPosition="below">
<option value="0" selected="selected">--- Select an employee ---</option>
</cfselect>
</div>
</div>
<cfset args = structNew()>
<cfset args.name = "ExistingEvals">
<cfset args.format = "html">
<cfset args.bindOnLoad = "true">
<cfset args.bind = "cfc:empEval.getCompletedEvals({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridso rtdirection},{employee})">
<cfset args.stripeRows = true>
<cfset args.selectColor = "##D9E8FB">
<cfset args.selectmode = "row">
<cfset args.selectOnLoad = "false">
<cfset args.autowidth = "no">
<cfset args.width = "335px">
<cfset args.pageSize = "6">
<cfset args.height = "200px">
<div style=" margin-top:5px;">
<cfgrid name="employeeEvals" attributeCollection="#args#">
<cfgridcolumn name="empAffiliateID" display="no">
<cfgridcolumn name="FY" display="no">
<cfgridcolumn name="evaluationID" display="no">
<cfgridcolumn name="typeID" header="Eval Type" display="yes" width="75">
<cfgridcolumn name="FY" header="Fiscal Year" display="yes" width="90">
<cfgridcolumn name="Status" header="Status" display="yes" width="125">
<!---<cfgridcolumn name="Date" header="Date" display="yes">--->
</cfgrid> -
Does anyone know how to place a cfselect element in a cfgrid
or if it is even possible? I need an editable grid. It would be
ideal if one of the columns was a select list. The same select list
would be present in each row, that is, it would repeat all the way
down the column. I am a total noob with ColdFusion. Any help or
links to good info will be greatly appreciated.As far as I can tell this is a known issue with flash forms,
but can be accomplished with the applet version.
http://www.houseoffusion.com/groups/CF-Talk/thread.cfm/threadid:38871
Does anyone know when this fix will be released? -
CFGRID/CFSELECT/ActionScript problem
I have CFGRID "onchange" code below that allows me to click
on a CFGRID row and correctly display (in a separate CFFORMGROUP)
the correct column value in via a CFSELECT object. The field name
is
priority and the grid name is
tasks_grid.
Works fine, but my problem is that I've been unable to get
this to work on non-integer fields. If the field contains a text
string, no matter how small, the ActionScript "if" statements don't
seem to produce results. Could it be incorrect use of the ==
operator? I'm not an AS programmer, so I'm unfortunately on the low
end of the learning curve here.
I hope the above makes sense. Any thoughts would be greatly
appreciated.So far the best solution seems to be to create an array for
each such field that creates a new query column containing the text
data. I then reference the new "text" column ("priorityText", in
this instance) via CFGRIDCOLUMN and use the original "integer"
column (i.e., the actual field data) for the ActionScript matching
code in the child form. The array code is from another post, in the
Rich Forms forum, I believe. -
How do you populate cfselect when cfgrid selected row is changed
hi can anyone enlighten me as to how to pass data to a
cfselect from a cfgrid
i am using a listner function so that the grid can populate
form controlswhen a row is selected
i use bindings on cfinputs so no problem there
how do u populate a cfselect drop down with data from a grid
and then how woul i also display query results from another
query as a second option
lost
yes i dont konw much as
realyy apprecitae your helpUnfortunately, there's no 'tab-out' event in ABAP standard dynpros - you've got to trigger a PAI event to make that happen (such as hitting 'Enter').
-
Ok, here is the scenario:
I have a flash cfgrid, love it. I then wanted to give the
user the ability to update the grid without having to open a new
page with a new form, so I enabled edit. Then, I learnt that you
cannot user select dropdowns in an flash editable grid, so I
thought ok, I will have a form below the grid, I can bind the
fields with the grid, then the user can click on any row they need
to update, and then submit. CFGRIDUPDATE will then sort through the
changes and bish bosh, we have a nice solution. However, I then
learnt you cannot just bind a cfselect in the same way as you can a
<cfinput. I have search for solutions but with no joy. I have
two problems I need to fix;
1) how to prepopulate the <cfselect with the data from the
selected row, as you do with a cftext
2) my <cfinput type=date field does not update the grid
when changed (also, the grid doesn't change when I select a new
date, but it does change to the previous one if I select a second
one! weird!)
Can anyone, please shed any light on this atall please?
I attach my code and will try and provide as much info as
possible, thanks in advance
(Why do i always find a great solution like a flash grid, to
then hit a brick wall like not being able to bind selects! aaarggh)
:)Ok I did something similar with the HTML cfgrid as I had more
data that could be visible to edit in the grid itself.
First create a <cfinput type="hidden"/> for each select
box with it bound to the grid like a normal text box.
Second create a function to handle assigning of the hidden
bound value to the CFSELECT:
function populateCFSelect(Grid,rowIndex,e){
var xyz = document.GridForm.hidden_xyz.value;
document.GridForm.xyz.value = xyz;
document.GridForm.xyz.text= xyz;
Third and almost important you need to ad a listener to your
Grid to run the function not sure if there is something differnet
with a flash gridb but here is the code for the html grid:
function init(){ //Build grid toolbars
grid = ColdFusion.Grid.getGridObject("<NAME OF YOUR
GRID>");
grid.addListener("rowclick",populateCFSelect);
Finally make sure your init() is being called at page
load....<cfset ajaxOnLoad("init")>
After you populate your inputs and select boxes you need to
update your datasource with the changes then refresh your grid to
show the changes. ColdFusion.Grid.refresh("<NAME OF YOUR
GRID>");will refresh your grid. -
Bound CFSelect not working (with or without search box)
Hello,
I'm on WS2008 (64-bit) with IIS and CF9.0.1 (32 bit) and can't seem to get a bound CFSelect to work at all. CFGrid and other AJAX contriols work great. The code (shown below) appears to run without errors but the option tags are never generated.The binding CFC method returns a query with the data I want (I can see it on a dump) but is dropped by CF somehow.
Ideally I want to use this approach on several complex forms but need to get something working first. Removing the lookup doesn't help either. I'm pulling this Oracle data via the 10G Client's ODBC driver.
I've been working on CF forever (4-9) and never was stumped like this. Otherwise CF 9 On this server is running without a hitch.
Long term I'm trying to move away from our Flash/Actionscript equivilants and move toward AJAX. But I'm stuck. Please help!
Thanks
Tim
Index.cfm
<cfparam name="form.lookup" type="string" default="A">
<cfform preservedata="Yes">
Search: <input type="text" name="lookup" id="lookup"><br />
<cfselect name="Emp" bind="cfc:application.getEmpList({lookup})" value="EMPL_NBR" display="EMPL_NM">
<option value="00000000">--- No Employees ---</option>
</cfselect>
</cfform><br>
<!--- Just for Testing --->
<cfinvoke component="Application" method="getemplist" returnVariable="qRead">
<cfinvokeargument name="likename" value="#form.lookup#">
</cfinvoke>
<cfdump var="#qRead#" output="browser">
Application.cfc
<cffunction name="getEmpList" access="remote" returntype="query" output="yes">
<cfargument name="LikeName" type="string" required="yes">
<cfquery name="Emps" datasource="#application.dsn#" maxrows=50>
Select EMPL_NBR, EMPL_NM from MNDOT_EMPLOYEE
Where EMPL_STAT_CD = 'A' <cfif isdefined("LikeName")> and upper(Empl_Nm) like '%#ucase(likename)#%'</cfif>
Order By Empl_NM</cfquery>
<cfreturn emps>
</cffunction>
Message was edited by: CFTim1965
Message was edited by: CFTim1965Turns out that bound (used for the CF AJAX tags) CFCs are processed by the Application.cfc event methods like CFMs are and will have any HTML tags added in. When my method returned the query it had all my template code at the top (and some on the bottom). I used the code (in the Application.cfc) below to only write the HTML when the CFM pages are processed. Hope this helps! There a lot of misleading half truths out the about this issue.
<cffunction name="onRequestStart">
<cfargument name="targetpage" type="string" required="true">
<cfset var isCFM = (lcase(ListLast(arguments.targetPage, '.')) eq 'cfm') />
<cfif isCFM>
<!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">
<body>
<cfset AppHeader() /><!--- Create the Template Header --->
</cfif>
</cffunction> -
CFGRID, was working in CF8 won't display results in CF11
Hi
I recently upgraded a client from CF 8 to CF 11.
In the code is a CFGRID which was working in CF8 but now in CF11 the grid displays but no data appears (the grid is simply empty).
With debugging enabled the Coldfusion Ajax Logger is reporting the following error:
Uncaught SyntaxError: Unexpected identifier (http://hiddenServer.com/index.cfm?action=job.manageJobOperations&jobId=2395&cfdebug, line 104)
Line 104 is the "</cfgrid>" tag.
Here is cfgrid code, complete with it's bound cfselect statement immediately before it:
<cfselect name="primarysupplier" query="getconcretecompanies" display="name" value="id" required="yes" />
<cfgrid name="mixdesigns" format="html" bind="cfc:controller.Controller.getMixDesign({primarysupplier},{cfgridpage},{cfgridpagesize},{c fgridsortcolumn},{cfgridsortdirection},{primaryconcrete:jobid})" bindonload="yes" height="400" selectmode="row" sort="yes" selectonload="false">
<cfgridcolumn name="id" display="no" />
<cfgridcolumn name="selectcode" select="yes" display="yes" header="Select" width="40" />
<cfgridcolumn name="shortcompanyname" display="yes" header="Supplier" width="75" select="no" />
<cfgridcolumn name="mixnumber" display="yes" header="Mix Number" width="75" select="no" />
<cfgridcolumn name="psistrength" display="yes" header="PSI" width="45" select="no" />
<cfgridcolumn name="cubicyardprice" display="yes" header="Price" width="50" select="no" />
<cfgridcolumn name="description" display="yes" header="Description" width="180" select="no" />
</cfgrid>
I've dumped the query that populates the cfselect and there are no empty rows.
The console at the bottom of Chrome simply reports the same error, "Uncaught syntaxError. Unexpected identifier".
Has anyone else encountered this issue? If nothing else I'd love to learn how to debug this error, it seems as if there is some extra data being fed to the cfgrid but I can't seem to trap it....
Anyone?
Thanks in advance for your help,
RichAnit
Could you please clarify?
In the Adobe bug report for this issue (Bug#3759630 - CFGRID with BIND to CFC failed for an incorrect JavaScript)
... it mentions
Build
Found In Build
CF11_Final
Fixed In Build
289972
Doesn't that mean if the Coldfusion version that I'm running is Coldfusion version 11,0,0,289974, then my build would already have the fix rolled up in it? Or am I not reading the versioning correctly?
Thanks,
Rich -
Bind in form works with cfinput, how to with cfselect and a href
Hi all
This code workks binding a cfinput in an HTML cfform:
Name:<cfinput type="text" name="FIRSTNAME" label="Name" required="yes" width="150" bind="{UsersGrid.FIRSTNAME}" >
However this href doesn't seem to bind correctly:
<a href="http://www.google.com/search?hl=en&output=search&sclient=psy-ab&q={UsersGrid.COMPANY}&btnK=" bind="{UsersGrid.COMPANY}">Google.com</a>
This cfselect doesn't either:
Department: <cfselect name="DEPARTMENT1" width="100" size="1" label="Department" required="yes" bind="UsersGrid.DEPARTMENT1">
<option></option><cfoutput query="dNames"><option value="#DEPARTMENTIDS#">#DEPARTMENTNOM#</option></cfoutput>
</cfselect>
How can I make them both work? Thank youSure, Aaaron here it is, it uses the same database tables and datasource as in the other thread:
<cfquery name="QNAMES" datasource="tester">
select * from company, industries, division
where company.SECTORS1 = industries.SECTORSIDS
<cfif structKeyExists(url,"sectorid")>
and industries.SECTORSIDS = #url.sectorid#</cfif>
and division.DEPARTMENTIDS = company.DEPARTMENT1
and company.WHEN = 2
ORDER BY company</cfquery>
<cfquery name="dNames" datasource="tester">
select DEPARTMENTIDS, DEPARTMENTNOM
from division
order by DEPARTMENTNOM</cfquery>
<CFQUERY name="industries" datasource="tester">
SELECT * FROM industries
</CFQUERY>
<CFQUERY name="salesstep" datasource="tester">
SELECT * FROM sales
</CFQUERY>
<CFQUERY name="xity" datasource="tester">
SELECT * FROM ciudad
</CFQUERY>
<CFQUERY name="hols" datasource="tester">
SELECT * FROM holidays
</CFQUERY>
<!--- UPDATE QUERY --->
<cfif isDefined("FORM.UPDATEADDBTN")>
<cfif FORM.ENTID GTE 1>
<cfset isCOMPANYNull = iif(len(trim(FORM.COMPANY)) EQ 0, true, false)>
<cfset isSECTORS1Null = iif(len(trim(FORM.SECTORS1)) EQ 0, true, false)>
<cfset isRANKINGNull = iif(len(trim(FORM.RANKING)) EQ 0, true, false)>
<cfset isPRICENull = iif(len(trim(FORM.PRICE)) EQ 0, true, false)>
<cfset isDEPARTMENT1Null = iif(len(trim(FORM.DEPARTMENT1)) EQ 0, true, false)>
<cfset isFIRSTNAMENull = iif(len(trim(FORM.FIRSTNAME)) EQ 0, true, false)>
<cfset isPOSNull = iif(len(trim(FORM.POS)) EQ 0, true, false)>
<cfset isPHONENull = iif(len(trim(FORM.PHONE)) EQ 0, true, false)>
<cfset isEMAILNull = iif(len(trim(FORM.EMAIL)) EQ 0, true, false)>
<cfset isMOBILENull = iif(len(trim(FORM.MOBILE)) EQ 0, true, false)>
<cfset isADDRESSNull = iif(len(trim(FORM.ADDRESS)) EQ 0, true, false)>
<cfset isCITYNull = iif(len(trim(FORM.CITY)) EQ 0, true, false)>
<cfset isCOMMENTSNull = iif(len(trim(FORM.COMMENTS)) EQ 0, true, false)>
<cfset MEETINGDATE = trim(FORM.ABUNDANCE)>
<!--- DATECFM--->
<cfset isMTGTNull = iif(len(trim(FORM.MTGT)) EQ 0, true, false)>
<cfset isSTATE1Null = iif(len(trim(FORM.STATE1)) EQ 0, true, false)>
<CFQUERY name="updatecompany" datasource="tester">
update COMPANY
SET COMPANY = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMPANY)#" null="#isCOMPANYNull#" />,
SECTORS1 = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.SECTORS1)#" null="#isSECTORS1Null#" />,
RANKING = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.RANKING)#" null="#isRANKINGNull#" />,
PRICE = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.PRICE)#" null="#isPRICENull#" />,
DEPARTMENT1 = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.DEPARTMENT1)#" null="#isDEPARTMENT1Null#" />,
FIRSTNAME = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.FIRSTNAME)#" null="#isFIRSTNAMENull#" />,
POS = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.POS)#" null="#isPOSNull#" />,
PHONE = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.PHONE)#" null="#isPHONENull#" />,
EMAIL = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.EMAIL)#" null="#isEMAILNull#" />,
MOBILE= <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MOBILE)#" null="#isMOBILENull#" />,
ADDRESS = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.ADDRESS)#" null="#isADDRESSNull#" />,
CITY = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.CITY)#" null="#isCITYNull#" />,
COMMENTS = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMMENTS)#" null="#isCOMMENTSNull#" />,
ABUNDANCE = <cfqueryparam cfsqltype="cf_sql_timestamp" value="#MEETINGDATE#" />,
MTGT = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MTGT)#" null="#isMTGTNull#" />,
STATE1 = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.STATE1)#" null="#isSTATE1Null#" />
WHERE ENTID = #FORM.ENTID#
</CFQUERY>
<CFLOCATION URL="testht.cfm?begin=1">
<cfelse>
<cfset isCOMPANYNull = iif(len(trim(FORM.COMPANY)) EQ 0, true, false)>
<cfset isSECTORS1Null = iif(len(trim(FORM.SECTORS1)) EQ 0, true, false)>
<cfset isRANKINGNull = iif(len(trim(FORM.RANKING)) EQ 0, true, false)>
<cfset isPRICENull = iif(len(trim(FORM.PRICE)) EQ 0, true, false)>
<cfset isDEPARTMENT1Null = iif(len(trim(FORM.DEPARTMENT1)) EQ 0, true, false)>
<cfset isFIRSTNAMENull = iif(len(trim(FORM.FIRSTNAME)) EQ 0, true, false)>
<cfset isPOSNull = iif(len(trim(FORM.POS)) EQ 0, true, false)>
<cfset isPHONENull = iif(len(trim(FORM.PHONE)) EQ 0, true, false)>
<cfset isEMAILNull = iif(len(trim(FORM.EMAIL)) EQ 0, true, false)>
<cfset isMOBILENull = iif(len(trim(FORM.MOBILE)) EQ 0, true, false)>
<cfset isADDRESSNull = iif(len(trim(FORM.ADDRESS)) EQ 0, true, false)>
<cfset isCITYNull = iif(len(trim(FORM.CITY)) EQ 0, true, false)>
<cfset isCOMMENTSNull = iif(len(trim(FORM.COMMENTS)) EQ 0, true, false)>
<cfset isMTGTNull = iif(len(trim(FORM.MTGT)) EQ 0, true, false)>
<cfset isSTATE1Null = iif(len(trim(FORM.STATE1)) EQ 0, true, false)>
<cfset MEETINGDATE = trim(FORM.ABUNDANCE)>
<!--- DATECFM --->
<!--- ADD COMPANY QUERY --->
<CFQUERY name="addcompany" datasource="tester">
INSERT INTO COMPANY(
COMPANY,
SECTORS1,
RANKING,
PRICE,
DEPARTMENT1,
FIRSTNAME,
POS,
PHONE,
EMAIL,
MOBILE,
ADDRESS,
CITY,
COMMENTS,
ABUNDANCE,
MTGT,
STATE1
VALUES (
<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMPANY)#" null="#isCOMPANYNull#" />,
<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.SECTORS1)#" null="#isSECTORS1Null#" />,
<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.RANKING)#" null="#isRANKINGNull#" />,
<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.PRICE)#" null="#isPRICENull#" />,
<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.DEPARTMENT1)#" null="#isDEPARTMENT1Null#" />,
<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.FIRSTNAME)#" null="#isFIRSTNAMENull#" />,
<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.POS)#" null="#isPOSNull#" />,
<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.PHONE)#" null="#isPHONENull#" />,
<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.EMAIL)#" null="#isEMAILNull#" />,
<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MOBILE)#" null="#isMOBILENull#" />,
<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.ADDRESS)#" null="#isADDRESSNull#" />,
<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.CITY)#" null="#isCITYNull#" />,
<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMMENTS)#" null="#isCOMMENTSNull#" />,
<cfqueryparam cfsqltype="cf_sql_timestamp" value="#MEETINGDATE#" />,
<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MTGT)#" null="#isMTGTNull#" />,
<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.STATE1)#" null="#isSTATE1Null#" />
</CFQUERY>
<!---DATE_FORMAT(datetime_field_name,'%Y-%m-%d');--->
<CFLOCATION URL="testht.cfm?begin=1">
</cfif>
</cfif>
<!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=utf-8" />
<title>Sales</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<link rel="stylesheet" href="formst.css" type="text/css" media="screen" />
</head>
<cfdump var=#qnames#>
<cfajaxproxy bind="javascript:myHandler({UsersGrid.COMPANY},{UsersGrid.SECTORS1},{UsersGrid.DEPARTMENT 1})"/>
<script type="text/javascript">
function myHandler(COMPANY,SECTORS1,DEPARTMENT1) {
//update the link's href
document.getElementById('myLink').href = 'http://www.google.com/search?q=' + COMPANY;
document.getElementById('Linkedin').href = 'http://www.google.com/search?q=linkedin' + COMPANY;
//update SECTORS1's selected
var theField = document.getElementById('SECTORS1');
for(var i=0; i<theField.options.length; i++) {
if(theField.options[i].value==SECTORS1) {
theField.options[i].selected = true;
} else {
theField.options[i].selected = false;
</script>
<!--- TOP --->
<body>
<div>
<cfform name="SFORM" FORMAT="html" width="1000" height="400" style="margin-left:140px;">
<cfgrid name="UsersGrid"
FORMAT="html"
query="QNAMES" width="920" height="200" rowheaders="No" striperows="yes" striperowcolor="fefefe">
<cfgridcolumn name="RANKING" width="40"header="Rank">
<cfgridcolumn name="COMPANY" width="170" header="Company">
<cfgridcolumn name="FIRSTNAME" header="Contact Name">
<cfgridcolumn name="POS" width="160" header="Position">
<cfgridcolumn name="DEPARTMENTNOM" width="150" header="Department">
<cfgridcolumn name="SECTORSNOM" width="120" header="Sectors">
<cfgridcolumn name="ABUNDANCE" width="120" header="Action date">
<cfgridcolumn name="SECTORS1" width="120" header="Action date" display="no">
<cfgridcolumn name="PRICE" width="120" header="Action date" display="no">
<cfgridcolumn name="PHONE" width="120" header="Action date" display="no">
<cfgridcolumn name="EMAIL" width="120" header="Action date" display="no">
<cfgridcolumn name="MOBILE" width="120" header="Action date" display="no">
<cfgridcolumn name="ADDRESS" width="120" header="Action date" display="no">
<cfgridcolumn name="CITY" width="120" header="Action date" display="no">
<cfgridcolumn name="COMMENTS" width="120" header="Action date" display="no">
<cfgridcolumn name="MTGT" width="120" header="Action date" display="no">
</cfgrid>
<!---FIRST--->
<table width="880" class="stat" >
<tr><td><cfoutput>#QNAMES.RecordCount# Companies</cfoutput></td></tr>
<tr>
<td>Company:<cfinput class="input" type="text" name="COMPANY" size="20" label="Company" required="yes" bind="{UsersGrid.COMPANY}" ></td>
<td>
Sector:<cfselect class="input" name="SECTORS1" size="1" label="Sector" required="yes">
<option></option><cfoutput query="industries"><option value="#SECTORSIDS#">#SECTORSNOM#</option></cfoutput></cfselect>
</td>
<td>Ranking:<cfinput class="input" type="TEXT" name="RANKING" size="3" label="Ranking" bind="{UsersGrid.RANKING}" ></td>
<td>Price:<cfinput class="input" type="TEXT" name="PRICE" size="3" label="Price" bind="{UsersGrid.PRICE}" >
<a href="" id="myLink" target="_blank">Google</a>
<a href="" id="Linkedin" target="_blank">Linkedin</a></td>
</tr>
<tr>
<td>Department:<cfselect class="input" name="DEPARTMENT1" size="1" label="Department" required="yes">
<option></option><cfoutput query="dNames"><option value="#DEPARTMENTIDS#">#DEPARTMENTNOM#</option></cfoutput></cfselect>
</td>
<td>Name:<cfinput class="input" type="text" name="FIRSTNAME" label="Name" required="yes" width="150" bind="{UsersGrid.FIRSTNAME}" ></td>
<td>Position:<cfinput class="input" type="text" name="POS" label="Position" width="150" bind="{UsersGrid.POS}" ></td>
<td>Phone:<cfinput class="input" type="text" name="PHONE" label="Phone" width="150" bind="{UsersGrid.PHONE}" ></td>
</tr>
<!--- THIRD--->
<tr><td>Email:<cfinput class="input" type="text" name="EMAIL" label="Email" width="150" bind="{UsersGrid.EMAIL}" ></td>
<td>Mobile:<cfinput class="input" type="text" name="MOBILE" label="Mobile" bind="{UsersGrid.MOBILE}" ></td>
<td>Address:<cfinput class="input" type="text" name="ADDRESS" label="Address" bind="{UsersGrid.ADDRESS}" ></td>
<td><cfselect class="input" name="CITY" width="80" size="1" >
<cfoutput query="xity"><option value="#CITYID#">#CITYNOM#</option></cfoutput>
</cfselect></td>
</tr>
<!--- FOURTH --->
<tr><td>Comments:<cftextarea class="input" name="COMMENTS" height="60" label="Comments" bind="{UsersGrid.COMMENTS}" /> </td>
<td>Action:<cfinput type="DateField" class="input" size="10" name="ABUNDANCE" label="Action" bind="{UsersGrid.ABUNDANCE}" ></td>
<td>Time:<cfselect class="input" name="MTGT" width="90" label="Time"><option>7:00AM</option></cfselect></td>
<td><cfselect class="input" name="STATE1" size="1" label="Action" >
<cfoutput query="salesstep"><option value="#SALESID#">#SALESNOM#</option></cfoutput>
</cfselect> </td>
<cfinput type="hidden" name="ENTID" label="ENTID" bind="{UsersGrid.ENTID}" >
</tr>
<tr> <td>
<cfinput type="submit" name="DELCOM" value="delete" class="button" >
<cfinput type="submit" name="UPDATEADDBTN" value="UPDATE or ADD NEW" class="button"></td>
</tr>
</table>
</cfform>
<cfif isDefined("FORM.DELCOM")>
<CFQUERY name="deletecompany" datasource="tester">
DELETE FROM COMPANY
WHERE ENTID = #FORM.ENTID#
</CFQUERY>
<CFLOCATION URL="testht.cfm">
</cfif>
</div>
</body>
</html> -
Jump menu + cfgrid image width height problems
2nd day and no answer of anyone, please help! Just to simple
questions:
1. HOw could I build a cfselect jump menu, since JavaScript
does not work with cfforms?
2. Does anyboy knows why the thumbnail inside a cfgrid does
crop beyond 75px x 70px dimension? HOw could I put a 120px x 94px ?
Thank you!once I removed the "auto" setting everything worked just fine, the images came in at the proper pixel size, and the thumb nail images where proportional in size seeing how I had a height set of 40 px the width took care of itself.
Any Ideas on where I can find a good tutorial on client login and password to access pages with their content? -
Outputting one cfselect fine now two
Hi all,
I am using coldfusion cfform in flash format -maybe this is
the place to come for an actionscript question. The cfgrid tag
works fine for one field the "state" field output with cfselect
with the following onchange actionscript:
<cfform format="Flash" skin="haloblue">
<cfgrid name="UsersGrid" format="Flash"
query="qNames" rowheaders="No"
onchange="for (var i:Number = 0; i<state.length; i++) {if
(state.getItemAt(
).data == UsersGrid.selectedItem.state) state.selectedIndex =
i}">
What I want to get is
onchange="for (var i:Number = 0; i<state.length; i++) {if
(state.getItemAt().data == UsersGrid.selectedItem.state)
state.selectedIndex = i}"
AND
onchange="for (var i:Number = 0; i<meetingtime.length;
i++) {if (meetingtime.getItemAt(
).data == UsersGrid.selectedItem.meetingtime)
meetingtime.selectedIndex = i}">
so I can connect to my meetingtime field and db field. I just
don´t know how , thank you for any help.
<cfgridcolumn name="FIRSTNAME" header="Contact Name">
<cfgridcolumn name="ENTID" display="FALSE">
<cfgridcolumn name="state" header="Next Step">
</cfgrid>
<cfformgroup type="tabnavigator">
<cfformgroup type="page" label="Details:
#dateFormat(now(), 'mmm dd, yyyy')#">
<cfformgroup type="horizontal">
<cfinput type="text" name="FIRSTNAME" label="First Name"
bind="{UsersGrid.dataProvider[UsersGrid.selectedIndex]['FIRSTNAME']}"
onChange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex,
'FIRSTNAME', FIRSTNAME.text);">
<cfselect name="state" width="200" size="1" label="Next
Step"
onchange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex,
'state', state.selectedItem.data);">
<option value="nulo">None</OPTION>
<option value="SEND STUDY">SEND STUDY</OPTION>
<option value="SEND PROPOSAL">SEND
PROPOSAL</OPTION>
<option value="CALL AND EMAIL">CALL AND
EMAIL</OPTION>
<option value="CALL">CALL</OPTION>
<option value="SEND PRESENTATION">SEND
PRESENTATION</OPTION>
<option value="MEETING">MEETING</OPTION>
</cfselect>
<cfinput type="hidden" name="ENTID" label="ENTID"
bind="{UsersGrid.dataProvider[UsersGrid.selectedIndex]['ENTID']}"
onChange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex,
'ENTID', ENTID.text);">
</cfformgroup>
</cfform>A similar thing happened to me. My MacBook went in two weeks ago because the built-in iSight was failing intermittently. It spent some time at the repair depot waiting for a main logic board.
I got the call this morning that it was back at the local Apple Store.
The clerk brought it out from the storeroom, I pressed the power button, and was treated to a weird display of multi-colored vertical lines.
Now, the MacBook is on its way back to the repair depot to see what's wrong now.
The only small consolation is that I've learned Apple's term for such not-quite-repaired machines. I'm the proud owner of a "looper."
MacBook 2.0GHz SuperDrive "the looper" Mac OS X (10.4.7) My MacBook's getting more vacation this summer than I am! -
So I have a cfgrid that is based on a query, in that query
there is a FK for stateID, I can get all my other test fields to
bind to the selected item, everything but the cfselect for the
state, the state cfselect is populated by a different query. I have
tried to do a bind and selected. but no joy. ANy help would be very
much appreciated. I have attached the code.While I would not call this a solution, it is fixed - for
now.
I noticed that in the other areas of my application that also
use this cfselect bind feature they had also stopped functioning,
even though the CFCs could be successfully invoked and data
returned and all looked ok. While I would love to find out what
exactly that "Internal Server Error" message is, I simply copied
the /CFIDE folder from one of my boxes that works to the troubled
server, restarted and it now works. I thought if all of the
cfselect binds were failing then maybe it was a supporting .js file
that possibly got corrupted or deleted.
Anyway, back in business. Like I said, not a true fix, but
we're moving forward again.
Rich -
Cfselect within a cfgridcolumn
Is there a way to combine a <cfselect> within a <cfgridcolumn> in a <cfgrid> table?
Here's what I'm looking to do. I would have a <cfgrid> with First Name, Last Name and then a column with States. The States column within the <cfgrid> would be popluated by a query listing all the states.
<cfgrid>
First Name Last Name State
John Doe AL (dropdown list of states)
Jane Doe MO (dropdown list of states)
</cfgrid>You can't do it with a key. You have to use the little magnifier thing to get the cursor to the left of the letter. Put your finger on the word, and hold it for a moment, and small magnifying glass appears. You can the roll your finger to get the cursor to move.
Maybe you are looking for
-
When using coverflow screen goes black
Having installed 7.1.1.5 of itunes I now find that my computer crashes (with the screen first going black) when i flick through more than a couple of album covers. Have not had this problem before on my pc, is this something that can be fixed? Wind
-
hI, I need to build UI using ADobe flex that will connect BPM system. I have concurrent 500 users. Is this is feasible to develop application(UI) using Flex for such kind of application. Thanks, Vikash
-
Is BC4J a viabl option for database with stored procedure (ref cursor) API?
I'm about to begin a Web application development project. As foundation, we have a (Oracle) database of certain complexity that have a data access API developed with PL/SQL packages. This API is designed to get data through stored procedures/function
-
How do I keep my notes from my iPhone from showing up in my e-mail?
Every time I enter a note in my iPhone, it is then sent to my e-mail. It is in the "Notes" folder under reminders, but I can't get rid of it from my mail inbox. I would like to leave it in the reminders but remove from the inbox.
-
Querying for custom picklist values
Hello all, I have created a new field on my opportunity type called "Industry" and gave it picklist values. However, the system is not allowing me to query for the values using the Picklist web service. Am I missing a step here, or does the system no