Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / March 2004



Tip: Looking for answers? Try searching our database.

How do I get values from List.selectedItems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bluestix - 01 Mar 2004 10:06 GMT
I am trying to use data from the List.selectedItems to print only the selected
items from a datagrid.

My code so far looks like this:

on(press) {
    selItems = MyDataGrid.selectedIndices;
    trace("The selected indices are "+selItems);
    trace("selItems.length is "+selItems.length);
   
    var myArray = MyDataGrid.selectedItems;
    trace("The selexted items are "+MyDataGrid.selectedItems)
    trace("The selected Items are "+myArray)
   
}

My datagrid has a column called PKeyAccountID which contains the primary key
information for a recordset.
I want to use the data from the selected cells of this column to send back to
Coldfusion so that I can print only the selected records. (Flash doesnt seem to
be capable of doing this on its own thats why I am sending back to Coldfusion)

The help manual says:
Usage
listInstance.selectedItems

Description
Property (read-only); an array of the selected item objects. In a
multiple-selection list, selectedItems allows you to access the set of items
selected as item objects.

So how do I access the items selected as item objects?
I have tried using array syntax but that doesnt seem to work.

Any help would be greatly appreciated.

Kelly

[L=DigitalRorschach]http://www.digitalrorschach.com/AnomalousData.cfm[/L]
rllewellyn04 - 02 Mar 2004 02:58 GMT
try setting up a Listener Object so you get an eventobject passed to you. then
you can get at it like this:

eventObject.target.selectedItem.PKeyAccountID

It works for me but my grid contains a recordset, don't understand it well
enough to know if it works in your case

good luck.
bluestix - 02 Mar 2004 10:28 GMT
I actually already knew how to get the value of the List.selectedItem but I
wanted to do the same for multiple Items.
I figured out a way to do it but it doesnt really make sense to me and doesnt
work exaclty as I would like.

It looks like this:

on(press) {
    selItems = Contract.selectedIndices;
    trace("The selected indices are "+selItems);
    trace("selItems.length is "+selItems.length);
   
   
    var IndexArray = "";
    var IndexArray = new Array(selItems.length);
   
   
    var myArray = Contract.selectedItems;
   
   
   
    trace("The selexted items are "+Contract.selectedItems);
    trace("The selected Items are "+myArray);
   
    for (i=0; i<selItems.length; i++) {

    for (PKeyAccountID in myArray[i]) {
        trace ("myArray." + PKeyAccountID + " = " + myArray[i][PKeyAccountID]);
        var pushed = IndexArray.unshift(myArray[i].PKeyAccountID)
        trace("Items added to Index Array are "+pushed);
        trace(IndexArray);
       
}

}
    var IndexArray2 = IndexArray.toString()
    trace("the String is "+IndexArray2)
}
on(release) {
    getURL("PrintSort.cfm", "_blank", "POST");
}

This only kindof works. I am still trying to make sense of it.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.