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.
Similar Messages
-
Mapping ArrayList in java to Actionscript Problem
Hi Guys,
This is wrecking my head. Had this issue for the last two days and cannot for the life of me understand why. I have a service defined as with the following method;
public List getIngredients(){
List list = null;
List ingredientList = new ArrayList();
SandwichDAOFactory fac = SandwichDAOFactory.getDAOFactory(1);
IngredientDAO ingDao = fac.getIngredientDao();
IngredientDTO ingDTO = new IngredientDTO();
Ingredient ing = new Ingredient();
list = ingDao.getAllIngredients();
for (Iterator it=list.iterator(); it.hasNext();) {
ing = (Ingredient) it.next();
ingDTO.setIngredientID(ing.getIngredientID());
ingDTO.setName(ing.getName());
ingDTO.setPrice(ing.getPrice());
ingDTO.setDescription(ing.getDescription());
ingDTO.setType(ing.getDescription());
ingredientList.add(ingDTO);
System.out.println("Calling Service");
System.out.println(list.toString());
return list;
Now I have defined a remotes object in my flex app;
I call this service method when I first load the application;
retrievalService.getAllIngredients();
then handle the result as follows;
private function getAllIngredientsResultHandler(event:ResultEvent):void
ingredientsListData = event.result as ArrayCollection;
var arrList:Array = event.result as Array;
trace("event.result.toString = "+event.result);
trace("ingredientsListData = "+ingredientsListData);
trace("arrList = "+arrList);
I would expect to see the object references delimited in some way for all the trace methods. But when I run the example I get the following output;
event.result.toString = [object IngredientDTO],[object IngredientDTO],[object IngredientDTO],[object IngredientDTO],[object IngredientDTO]
ingredientsListData = null
arrList = null
I dont understand why this is happening. Surely the variables should contain the same info. I did some debugging and found that the event.result object did in fact contain the data as an ArrayCollection. In addition all the elements were objects of the type IngredientDTO and contained all the relevant fields and data. So again I don't understand for the life of me why its not working.
Can you not caste an ArrayList in java to an Array or an ArrayCollection?
Its like the data isn't being mapped or cast properlu from the ArrayList in java to either the Array or the ArrayCollection in actionscript.
This is driving me insane. Has anyone else had this problem and lived to tell the tale?I figured it out. Silly, silly mistake. I was using the wrong import declaration.
import flex.messaging.io.ArrayList;
instead of
import java.util.ArrayList;
Silly silly... -
Flash CFGRID Insert Row Problem
I think others have posted similar issues, but I've been
unable to find a resolution to it. I have a Flash grid in an
Accordion page that I need users to be able to insert data into.
Most of the time, the grid will be empty when the user enters data.
I've tried using the picturebar insert button, I've tried using
onClick="GridData.insertRow(mygrid);". I even tried a fairly
extensive script that seemed to be a timer that would detect a
double click to insert. None of these work well. The
onClick="GridData.insertRow(mygrid);" is the best in that I only
have to click a column field about 3 times before I can enter data
in the field. Multiple clicks to activate the field is just not
useable.Hi,
Thanks for the reply, I have the same problem. The suggestion you gace did not work as it works only for flash grids. I am using an HTML grid.I just want to set a default value of OLST to the Client column. Please help!
<cfgrid name = "FirstGrid"
format="html"
height="320"
width="580"
font="Tahoma"
fontsize="12"
query = "rsIncidentTypes"
bgcolor="orange"
selectmode="edit"
selectcolor="teal"
delete="true"
insert="true"
insertButton = "Insert a Row"
deleteButton = "Delete selected row"
onChange="FirstGrid.dataProvider.editField(FirstGrid.selectedIndex,'Client', 'OLST');"
> -
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> -
Hi everyone, my first post one here so i hope someone can be of assistance.
I have been using CS4 with no problems for a couple of months, but i suddenly encountered a problem that i can't get beyond now.
when i click on 'actions' my timeline collapses. This happens whether from right clicking on my timeline or selecting it from the top menu.
Since this has happened i can't find a way of bringing up the actionscript screen.
Has anyone had this problem before?
I hope this makes sense!
Thanks very much in advance.This forum is for suite specific issues only. I can only assume you're looking for Flash help.
If so, please post in the Flash forum.
Bob -
Preloader Actionscript problem
As a relative newcomer to Actionscript, I came across a
preloader tutorial (from a trusted source) which reveals a cut out
photograph as the movie loads. I decided to use it, but although I
have checked and double-checked the Actionscript, Flash 2004 keeps
reporting an error and the preloader is not working.
The problem is obviously in line 6 and I just thought that
someone might be able to look at the Actionscript and see the
problem (which I can't!).
Here's the Actionscript;
stop();
mask_mc._height = 1;
this.onEnterFrame = function() :Void {
var loadedData:Number = this.getBytesLoaded();
var allData:Number = this.getBytesTotal();
var percent:Number = Math.round(loadedData/allData=100);
mask_mc._yscale = percent;
if (loadedData>=allData) {
gotoAndStop(10);
delete this.onEnterFrame;
Here's the error report from Flash;
**Error** Scene=Scene 1, layer=Actions, frame=1:
Line 6: Left side of assignment operator must be variable or
property.
var percent:Number = Math.round(loadedData/allData=100);
Total ActionScript Errors: 1 Reported Errors: 1
Many thanks for any help.you have an assignment operator (=) where you should have a
multiplication operator (*) at the END of that line. -
Reload CFGrid with Actionscript
I'm looking for some guidance on how to use actionscript to
reload a cfgrid on an onclick event. I am currently using getURL()
to call a cfc to asynchonously update the query driving the grid,
but I cannot figure out how to actually refresh the grid itself
without reloading the page.
Any help would be tremendously appreciated.
Thanks
JoelHi,
If you use flash remoting, then there is no reason for
refreshing the page.
In the onclick event you only need to make a call to the
function that populates or filters the grid. The refreshing is
almost instantaneous. So no worries about page refresh.
If you need any reference to this, check the following links
Introduction
to Flash Remoting
Populating
a cfgrid with Flash Remoting
How
to transfer data with Flash Remoting
Consuming
a Web Service through Flash Remoting and CFForm
Hope this helps.
If you've got any further query, don't hesitate -
Actionscript Problems.... HELP
Ok so heres the thing. I am kind of new to actionscript 3.0
and I am trying to figure out what I am doing wrong with my coding.
I have used this code time and time again and up until I got CS3 it
worked just fine. If there is anyone that can take a look at this
code and tell me what I am missing or what I might have done wrong
I would greatly appreciate your help. below is my coding I am using
to call the outside swf files and also call text documents that
hold my info. Thank you so much for looking and helping if you can
figure out what I messed up.
this.rootcontainer.onLoad = function ()
heightscale = 270.45;
this.btn_news.onRelease = function ()
if (_root.currMovie == undefined)
_root.currMovie = "news";
rootcontainer.loadMovie("News.swf",
this.getNextHighestDepth());
else if (_root.currMovie != "news")
if (rootcontainer._currentframe >=
rootcontainer.midframe)
_root.currMovie = "news";
rootcontainer.play();
} // end if
} // end else if
this.btn_band.onRelease = function ()
if (_root.currMovie == undefined)
_root.currMovie = "band";
rootcontainer.loadMovie("Band.swf",
this.getNextHighestDepth());
else if (_root.currMovie != "band")
if (rootcontainer._currentframe >=
rootcontainer.midframe)
_root.currMovie = "band";
rootcontainer.play();
} // end if
} // end else if
_root.currMovie = "news";
rootcontainer.loadMovie(_root.currMovie + ".swf");
stop ();I tried using that code and it came up with Duplicate
function definition, function onPress_but(event:MouseEvent). do you
know why this might be showing up or did I just place this script
in the wrong spot? I have added a few more lines of code but I
didnt change anything till I added this to it and thats when it
came up with that error. -
Just received my new CS3 Web Premium in the mail yesturday
and have been playing around with it, specially with flash. Do need
some help with it though while I my trying to learn it. I have C++,
VB, and PHP experience but have never really played around with
actionscript as far as programing (used it to do basic event
actions back in MX 2004). Anyways, to the point. I can't get this
code to work. I am assuming I need to change the string to an
integer, but not sure how.
Here is the code:
import fl.events.*;
import flash.events.*;
btnCalc.addEventListener(MouseEvent.CLICK, calculate);
function calculate(e:Event):void {
var Num1:Number = txtNum1.text;
var Num2:Number = txtNum2.text;
lblOutput.text = Num1 + Num2;
}int and uint (and void) are not object types, they are
primitive type
associations. Values with the type int in Flash are still
based around the
Number class (being capitalized, there is an actual Number
class in Flash),
but benefit from integer optimizations at a lower level.
"WebmastaDj" <[email protected]> wrote in
message
news:f0q66n$p2p$[email protected]..
>I have noticed that. Actionscript is very case sensitive
and not very
>consistent. But I am sure there is a reason why they do
that not sure what
>though. -
Javascript-actionscript problems
I am trying to set up a test app to get a grip on communications between
javascript and action script. I have successfully registered a call back function
with action script to be called by javascript, But a second registered function
is not getting recognized by javascript. <object/embed object>.callBack()
javascript error (FireFox on Mac)
<object/embed object>.callBack is not a function
The page is posted at
http://www.jekillen.com/jekillen/content/web_design/player/FLSHDev.html
javascript sourced file
http://www.jekillen.com/jekillen/content/web_design/player/dev.js
buttons labeled 'TEST' and 'TEST 1'
There is a link to the swf source code (text file). Notice the compatibility note.
Thanks for advice, suggestions.
JKI think I found the problem here;
I have to clear the browser cache occasionally to
get changes in code to show up.
That became obvious when things were happening that I
had eliminated from the swf source code, in the browser.
The sample I posted may actually work. The browser I
use to contact internet does not have Flash player 10
so I have not tested the posting.
JK -
ActionScript is a very bad language because its every year
change and it's changing in base that's very hard for me and very
bad thing I learn action script in 2 years and then sudden change
it.
action script very hard for me that I am working animation it
must very easy to use not hard component and database and xml
and.... is very hard for use.Yes yes yes, ActionScript is a very BAD language, Flash is a
very BAD software, Adobe is a very BAD company, this is a very BAD
forum, I'm a very BAD guy, so I love all these BAD things.
I learned flash for over 5 years, from a little bad AS1 to
some bad AS2 and now going to a very bad AS3. The world keep
changing, new technologies growing, we learn to adapt it. If you
think you are not able to follow the trend, you can stay on AS2
(AS1 perhap), nobody will force you to use AS3. -
Hi,
I'm trying to create a cfselect using a bind. I would like to
use 2 or more query columns in the "display" space of each select
item. Here is my code:
<cfselect name="residents"
bind="cfc:cnyapps.Components.patientProperty.findOnlySotpResidents()"
bindonload="true" value="case_num" display="lname">
</cfselect>
I would like to display the last name (lname) AND the first
name (fname), not just the last name (lname).
I would need something like display="lname,fname". Everything
i have tried has come up with an error message.
How can this be done?I'm not sure about the bind but I use a CONCAT in my SQl
query statement to run the two fields together. Is that something
you can use?
I'm sure there is a user with much more experience than me
that could provide a better answer. That's just the method I use... -
External .swf Intro ActionScript Problem
I have used a loader component to load to an external .swf
file (an intro animation). Once the external movie finishes playing
I want my parent movie to move to a certain frame on my parent
timeline. Nothing I try seems to work.So I could use the code that you provided in the timeline of
the intro movie that I am loading into my main timeline? -
I've tried everyway I can think of to modify the following
script so that it counts up instead of down with out
success....could you please tell me how to modify it so that it
counts up?i'm struggling to understand your code. your function
maincountxx doesn't have a closing parenthesis so it won't actually
work. also this function is never called...? so it appears as
though the first few lines of your code is all that is currently
working and making it count down perhaps by looping frames or
something? i don't know, but find attached some code to do what
you're after - count down. it puts the countdown text into a
textfield called countdown. -
CFGRID(html): editing problems
When using the html grid, to edit data, specifically the
dropdown editor - once the editing is complete, the value displayed
in the grid is the value and not the display value.
For example, if the following line is selected - <option
value="5">Five</option> - the 5 would be displayed and not
the Five.
Does anyone else experience this, and is this normal
behaviour?
many thanks
Mat EvansNot really. You can split the clip wherever you need to create a new 'scene,' and then split it again to isolate the 60 second clip. If you just want those and not the other parts of the movie, delete the rest or move it to the clips pane and leave the wanted clips in the timeline. It is not that hard to play through 8 minutes and make these clips....sometimes I have had to watch a lot longer clip to find the part I wanted!
If you are going to create a DVD of this movie and you will use the whole 8 minutes, but just want to mark the 'scenes,' then create chapter markers at the beginning of each scene, and iDVD will create those scene selections for you.
Maybe you are looking for
-
Hi all, When using the USB 6009 interface for reading out two sensors (temperature and pressure, using the Voltage they generate) and sending signals to valves, my program keeps working. But after a while the USB module crashes. Most of the time both
-
Search help in Web Dynpro in ABAP
Hi, I am starting with WD for ABAP (NW04s). I am using PA0022 table as model and displaying these values on the view. By default most of the fields like country, education centre, Faculty, Branch, Score come with an F4 option. But the value displayed
-
Daisy-chaining a ethernet hub to the time capsule
I am using all three of my wired ethernet ports on the time capsule, and I need a fourth. Current set up is 1) Vonage VoIP adapter; 2) printer w/o wireless option; and 3) connection to a EoPL adapter. I was wondering if I can buy a cheap ethernet hu
-
Audigy SE lost its applications in Windows 7
,Audigy SE lost its applications in Windows 7vHello, folks. I upgraded my OS to Windows 7 Home Premium 64 bits and My Audigy SE lost its applications, such as Graphic Equalizer, Surround Mixer, Speaker Settings and etc. The OS does not recognize thes
-
I have Photo Shop Elements 11. How do I find the clone tool?
I have Photoshop Elements 11. How do I find the clone tool?