Attorney Label System
public function formOnLoad(){ attorneySearch.myGlobalObjects = {}; setUpRemoting(); setStyles(); } public function setUpRemoting(){ var connection:mx.remoting.Connection = mx.remoting.NetServices.createGatewayConnection("http://localhost/flashservices/ gateway/"); var componentPath = "Applications.labels.services.labelservice"; var myService:mx.remoting.NetServiceProxy; var responseHandler:Object = {}; var listingGrid:mx.controls.DataGrid = listingGrid; responseHandler.onResult = function( results: Object ):Void { listingGrid.dataProvider = results; listingGrid.selectedIndex = undefined; listingGrid.multipleSelection = true; mx.managers.CursorManager.removeBusyCursor(); //show a message alert(listingGrid.dataProvider.length + " Attorneys Found." , "Results"); } responseHandler.onStatus = function( stat: Object ):Void { //if there is any error, show an alert alert("Error: " + stat.description); mx.managers.CursorManager.removeBusyCursor(); } attorneySearch.myGlobalObjects.labelservice = connection.getService(componentPath, responseHandler ); } public function setStyles():Void { _global.styles.ComboBox.setStyle("color", 0x00253D); _global.styles.Label.setStyle("color", 0x222222); _global.styles.CheckBox.setStyle("color", 0x00253D); _global.styles.RadioButton.setStyle("color", 0x00253D); _global.styles.Form.setStyle("color", 0x222222); _global.styles.Button.setStyle("color", 0x222222); _global.styles.Button.setStyle("borderThickness", 1); _global.styles.Panel.setStyle("backgroundColor", 0xE5F0F9); _global.styles.Panel.setStyle("color", 0xffffff); _global.styles.Panel.setStyle("headerColors", [0x277DC6,0x50ABF7]); } public function submitSearch():Void { var searchArguments = {}; searchArguments.caseyear = caseyear.text; searchArguments.casenumber = casenumber.text; searchArguments.terminated = terminated.selected; searchArguments.nef = nef.selected; searchArguments.office = office.selectedItem.data; searchArguments.casetype = casetype.selectedItem.data; mx.managers.CursorManager.setBusyCursor(); attorneySearch.myGlobalObjects.labelservice.search(searchArguments); } Label Type:
[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => roninDLC [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 5 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> var query = QueryNew(''); QueryAddColumn(query,'nome',ListToArray('Pedro,Pedro Claudio,pcsilva')); QueryAddColumn(query,'email',ListToArray('Pedro@email.com,Pedro_CLaudio@email ..com,pcsilva@email.com')); [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Pedro Claudio [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 15 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> Select Multiple Rows within CFGRID? - Coldfusion Flash Integration

Select Multiple Rows within CFGRID? - Coldfusion Flash Integration

Is it possible to select multiple records within a CFGRID?...

Sponsored Links
  1. #1

    Default Select Multiple Rows within CFGRID?

    Is it possible to select multiple records within a CFGRID?

    Sponsored Links
    roninDLC Guest

  2. #2

    Default Re: Select Multiple Rows within CFGRID?

    [url]http://livedocs.macromedia.com/flash/mx2004/main_7_2/00002232.html[/url]
    Is lists all of the methods, properites, and events for the datagrid class.
    This simple line of action script will allow my users to use the contorl-click
    and shift-click multiple highlight functinality:
    datagrid.multipleSelection = true;
    And this property returns an array of selected indicies:
    datagrid.selectedIndices


    bradwood.com Guest

  3. #3

    Default Re: Select Multiple Rows within CFGRID?

    How would I pass the selected records to the action page after submitting the form? I am using CF Flash Forms.
    roninDLC Guest

  4. #4

    Default Re: Select Multiple Rows within CFGRID?

    <cfscript>
    query = QueryNew('');
    QueryAddColumn(query,'nome',ListToArray('Pedro, Pedro CLaudio'));
    QueryAddColumn(query,'email',ListToArray('Pedroem ail.com,
    [email]Pedro_CLaudioemail.com[/email]'));
    </cfscript>
    <cfform name="form1" format="flash" width="600" height="530">
    <cfgrid name="grid" query="query" rowheaders="no" selectmode="edit">
    <cfgridcolumn name="nome" header="Nome" width="260" />
    <cfgridcolumn name="email" header="E-mail" />
    </cfgrid>
    <cfsavecontent variable="actionscript">
    if(_root.grid.dataProvider.length>0){
    for(var i = 0; i < _root.grid.dataProvider.length; i++){
    _root.grid.dataProvider.editField(i, 'nome',
    _root.grid.dataProvider.nome+' ');
    }
    }
    _root.submitForm();
    </cfsavecontent>
    <cfinput type="button" name="send" value="send" onClick="#actionscript#" />
    </cfform>
    <cfdump var="#FORM#" />


    Pedro Claudio Guest

  5. #5

    Default Re: Select Multiple Rows within CFGRID?

    It seems that the example above selects all records in the grid. Maybe I
    miscommunicated. Let me post my code. What is needed is to pass the multiple
    user-selected records after submit has been pushed. Keep in mind that I am an
    actionscript noob. Thanks again.




    <!--- Retrieve Case Types --->
    <cfinvoke
    component="labels.functions.labels"
    method="fnGetCaseType"
    datasource="#application.ds#"
    returnvariable="rsGetCaseType">

    <!--- Remember User-Entered Form Vars --->
    <cfparam name="session.user.caseyear" default="5">
    <cfparam name="session.user.casenumber" default="">
    <cfparam name="session.user.terminated" default="">
    <cfparam name="session.user.office" default="1">
    <cfparam name="session.user.casetype" default="cv">
    <cfparam name="session.user.nef" default="">
    <cfparam name="session.user.labeltype" default="wrapper">


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; cht=iso-8859-1">
    <title>Attorney Label System</title>
    <style >
    html, body{
    height:100%;
    margin:0;
    }
    body{
    background: #202020 url(assets/images/patternBg.gif);
    }
    #container{
    margin: auto;
    background: #195075 url(assets/images/background.gif) center center repeat-x;
    width: 990px;
    border: 1px solid #222;
    height: 100%;
    }
    </style>
    </head>
    <body>
    <table id="container">
    <tr>
    <td>
    <cfform
    name="attorneySearch"
    format="flash"
    method="post"
    action="labelsprint.cfm"
    skin="haloblue"
    width="990"
    height="610"
    preloader="true"
    timeout="60"
    onload="formOnLoad()"
    style="themeColor:##56A1E1; marginRight:0; background-color:##37749D;">


    <cfformitem type="script">
    public function formOnLoad(){
    attorneySearch.myGlobalObjects = {};
    <!--- set up remoting service --->
    setUpRemoting();
    <!--- set up styles --->
    setStyles();
    }

    public function setUpRemoting(){
    var connection:mx.remoting.Connection =
    mx.remoting.NetServices.createGatewayConnection("h ttp://localhost/flashservices/
    gateway/");
    var componentPath = "Applications.labels.services.labelservice";
    var myService:mx.remoting.NetServiceProxy;
    var responseHandler:Object = {};

    <!--- put controls in function scope --->
    var listingGrid:mx.controls.DataGrid = listingGrid;

    <!--- handle search by default onResult function --->
    responseHandler.onResult = function( results: Object ):Void {
    listingGrid.dataProvider = results;
    listingGrid.selectedIndex = undefined;
    listingGrid.multipleSelection = true;
    mx.managers.CursorManager.removeBusyCursor();
    //show a message
    alert(listingGrid.dataProvider.length + " Attorneys Found." , "Results");
    }

    <!--- default error handler --->
    responseHandler.onStatus = function( stat: Object ):Void {
    //if there is any error, show an alert
    alert("Error: " + stat.description);
    mx.managers.CursorManager.removeBusyCursor();
    }

    <!--- store service in global variable --->
    attorneySearch.myGlobalObjects.labelservice =
    connection.getService(componentPath, responseHandler );
    }

    public function setStyles():Void {
    _global.styles.ComboBox.setStyle("color", 0x00253D);
    _global.styles.Label.setStyle("color", 0x222222);
    _global.styles.CheckBox.setStyle("color", 0x00253D);
    _global.styles.RadioButton.setStyle("color", 0x00253D);
    _global.styles.Form.setStyle("color", 0x222222);
    _global.styles.Button.setStyle("color", 0x222222);
    _global.styles.Button.setStyle("borderThickness", 1);
    _global.styles.Panel.setStyle("backgroundColor", 0xE5F0F9);
    _global.styles.Panel.setStyle("color", 0xffffff);
    _global.styles.Panel.setStyle("headerColors", [0x277DC6,0x50ABF7]);
    }


    <!--- this function is called when search button is clicked --->
    public function submitSearch():Void {
    <!--- get all the search criteria items --->
    var searchArguments = {};
    <!--- simple text input --->
    searchArguments.caseyear = caseyear.text;
    searchArguments.casenumber = casenumber.text;
    <!--- checkboxes --->
    searchArguments.terminated = terminated.selected;
    searchArguments.nef = nef.selected;
    <!--- dropdowns --->
    searchArguments.office = office.selectedItem.data;
    searchArguments.casetype = casetype.selectedItem.data;
    <!--- show clock cursor --->
    mx.managers.CursorManager.setBusyCursor();
    <!--- call service --->
    attorneySearch.myGlobalObjects.labelservice.search (searchArguments);
    }

    </cfformitem>

    <cfformgroup type="hbox" width="990">
    <!--- logo --->
    <cfformgroup type="panel" width="218" style="headerHeight: 0; cornerRadius:
    0;">
    <cfformitem type="spacer"/>
    <cfformitem type="html" name="imageDisplay" height="125" width="198"><img
    src='assets/images/labels.jpg' /></cfformitem>
    <cfformitem type="spacer"/>
    </cfformgroup>

    <!--- Search panel --->
    <cfformgroup type="Panel" label="Search" style="indicatorGap:0;
    verticalGap:5;" width="750" height="180" >
    <cfformgroup type="vertical">
    <cfformgroup type="horizontal">
    <cfformitem type="spacer"/>
    <cfselect
    name="office"
    width="100"
    label="Office:">
    <option value="1" <cfif #session.user.office# eq 1>selected</cfif> >El
    Dorado</option>
    <option value="2" <cfif #session.user.office# eq 2>selected</cfif>>Fort
    Smith</option>
    <option value="3" <cfif #session.user.office# eq
    3>selected</cfif>>Harrison</option>
    <option value="4" <cfif #session.user.office# eq
    4>selected</cfif>>Texarkana</option>
    <option value="5" <cfif #session.user.office# eq
    5>selected</cfif>>Fayetteville</option>
    <option value="6" <cfif #session.user.office# eq 6>selected</cfif>>Hot
    Springs</option>
    </cfselect>
    <cfinput name="caseyear" width="40" label="Year:"
    value="#session.user.caseyear#" validate="integer" maxlength="4">
    <cfselect
    name="casetype"
    width="135"
    query="rsGetCaseType"
    value="type"
    queryPosition="below"
    display="description"
    selected="#session.user.casetype#"
    label="Case Type:">
    </cfselect>
    <cfinput name="casenumber" width="50" label="Number:"
    value="#session.user.casenumber#" maxlength="5">
    <cfformitem type="spacer"/>
    </cfformgroup>
    <cfformgroup type="horizontal">
    <cfformitem type="spacer"/>
    <cfif isdefined('session.user.terminated') and #session.user.terminated#
    neq '1'>
    <cfinput type="checkbox" name="terminated" label="Include terminated
    attorneys">
    <cfelse>
    <cfinput type="checkbox" checked="yes" name="terminated" label="Include
    terminated attorneys">
    </cfif>
    <cfif isdefined('session.user.nef') and #session.user.nef# neq '1'>
    <cfinput type="checkbox" name="nef" label="Include parties receiving
    e-mail notices">
    <cfelse>
    <cfinput type="checkbox" name="nef" checked="yes" label="Include parties
    receiving e-mail notices">
    </cfif>
    <cfformitem type="spacer"/>
    </cfformgroup>
    <cfformgroup type="horizontal">
    <cfformitem type="spacer" />
    <cfformitem type="text" width="70">Label Type:</cfformitem>
    <cfif #session.user.labeltype# eq "wrapper">
    <cfinput type="radio" name="labeltype" value="wrapper" label="Wrapper"
    checked="yes">
    <cfelse>
    <cfinput type="radio" name="labeltype" value="wrapper" label="Wrapper" >
    </cfif>
    <cfif #session.user.labeltype# eq "avery">
    <cfinput type="radio" name="labeltype" value="avery" label="Avery"
    checked="yes">
    <cfelse>
    <cfinput type="radio" name="labeltype" value="avery" label="Avery">
    </cfif>
    <cfif #session.user.labeltype# eq "dymo">
    <cfinput type="radio" name="labeltype" value="dymo" label="Dymo Printer"
    checked="yes">
    <cfelse>
    <cfinput type="radio" name="labeltype" value="dymo" label="Dymo Printer">
    </cfif>
    <cfformitem type="spacer"/>
    </cfformgroup>
    <cfformgroup type="horizontal">
    <cfformitem type="spacer"/>
    <cfinput type="button" onclick="submitSearch()" value="Lookup Attorneys"
    width="230" name="lookup">
    <cfinput type="reset" value="Reset" width="230" name="reset">
    <cfformitem type="spacer"/>
    </cfformgroup>
    </cfformgroup>
    </cfformgroup>
    </cfformgroup>

    <cfformgroup type="Panel" label="Attorneys" height="380">
    <cfgrid name="listingGrid"
    height="300"
    sort="yes"
    colheaderalign="center"
    colheaderbold="yes"
    delete="no"
    insert="no"
    rowheaders="false">
    <cfgridcolumn name="pr_prid" header="Prid" display="no">
    <cfgridcolumn name="pr_first_name" header="First Name" width="70"
    select="no" />
    <cfgridcolumn name="pr_last_name" header="Last Name" width="80"
    select="no" />
    <cfgridcolumn name="pr_generation" header="" width="20" select="no" />
    <cfgridcolumn name="pr_office" header="Office" select="no" />
    <cfgridcolumn name="pr_address1" header="Address" select="no" />
    <cfgridcolumn name="pr_address2" header="Address" width="150" select="no"
    />
    <cfgridcolumn name="pr_city" header="City" width="100" select="no" />
    <cfgridcolumn name="pr_state" header="State" dataalign="center"
    width="50" select="no" />
    <cfgridcolumn name="pr_zip" header="Zip" width="70" select="no" />
    </cfgrid>

    <cfformgroup type="horizontal">
    <cfformitem type="spacer"/>
    <cfinput type="submit" name="submit" width="230" value="Print Labels"/>
    <cfformitem type="spacer"/>
    </cfformgroup>
    </cfformgroup>
    </cfform>
    </td>
    </tr>
    </table>
    </body>
    </html>

    roninDLC Guest

  6. #6

    Default Re: Select Multiple Rows within CFGRID?

    I did not use its code not to confuse

    <cfscript>
    query = QueryNew('');
    QueryAddColumn(query,'nome',ListToArray('Pedro,Ped ro Claudio,pcsilva'));

    QueryAddColumn(query,'email',ListToArray('Pedroem ail.com,Pedro_CLaudioemail.c
    om,pcsilvaemail.com'));
    </cfscript>
    <cfform name="form1" format="flash" width="600" height="530"
    onload="loadAS();">
    <cfformitem type="script">
    function loadAS(){
    _root.grid.multipleSelection = true;
    }
    </cfformitem>
    <cfgrid name="grid" query="query" rowheaders="no">
    <cfgridcolumn name="nome" header="Nome" width="260" />
    <cfgridcolumn name="email" header="E-mail" />
    </cfgrid>
    <cfsavecontent variable="actionscript">
    if(_root.grid.selectedIndices != null){
    for(var i = 0; i < _root.grid.selectedIndices.length; i++){
    var index = _root.grid.selectedIndices;
    _root.grid.dataProvider.editField(index, 'nome',
    _root.grid.dataProvider[index].nome+' ');
    }
    }
    _root.submitForm();
    </cfsavecontent>
    <cfinput type="button" name="send" value="send" onClick="#actionscript#" />
    </cfform>
    <cfdump var="#FORM#" />


    Pedro Claudio Guest

  7. #7

    Default Re: Select Multiple Rows within CFGRID?

    Pedro, the code is does not appear to be working properly. Sorry about the
    formatting, but here is what is returned when selecting multiple records from
    your code. Am I doing something wrong?

    The <cfdump var="#form#"> is returning...

    FIELDNAMES: __CFGRID__FORM1__GRID
    GRID.EMAIL: array 1 undefined
    GRID.NOME: array 1 undefined
    GRID.ORIGINAL.EMAIL: array 1 [empty string]
    GRID.ORIGINAL.NOME: array 1 [empty string]
    GRID.ROWSTATUS.ACTION: array 1 U
    __CFGRID__FORM1__GRID
    __CFGRID__EDIT__=2nomeYemailY1Uundefined undefined

    Thanks very much for your help!


    roninDLC Guest

  8. #8

    Default Re: Select Multiple Rows within CFGRID?

    here it returned successfully this code, you is using which version of the CF, I I am using the 7.1
    Pedro Claudio Guest

  9. #9

    Default Re: Select Multiple Rows within CFGRID?

    it looks at the result
    [url]http://www.mxstudio.com.br/apoio/upload/flas_forn_grid.GIF[/url]
    Pedro Claudio Guest

  10. #10

    Default Re: Select Multiple Rows within CFGRID?

    I have version 7,0,1,116466 . Please take a look....

    Results: [url]http://www.arwd.uscourts.gov/cfgrid.cfm[/url]
    roninDLC Guest

  11. #11

    Default Re: Select Multiple Rows within CFGRID?

    The only way of this mistake occur are you be using an index with an index
    value for a line of grid that does not exist.
    For example, in this grid have 3 elements, which they can be called by an
    index value from 0 to 2, then for provoke this mistake you could place as index
    the number 3, or any number greater than 2, that why the array in actionscript
    initiates the counting of the zero.


    it tries thus, instead of placing a fixed value for index

    <cfscript>
    query = QueryNew('');
    QueryAddColumn(query,'nome',ListToArray('Pedro, Pedro CLaudio'));
    QueryAddColumn(query,'email',ListToArray('Pedroem ail.com,
    [email]Pedro_CLaudioemail.com[/email]'));
    </cfscript>
    <cfform name="form1" format="flash" width="600" height="530">
    <cfgrid name="grid" query="query" rowheaders="no" selectmode="edit">
    <cfgridcolumn name="nome" header="Nome" width="260" />
    <cfgridcolumn name="email" header="E-mail" />
    </cfgrid>
    <cfsavecontent variable="actionscript">
    if(_root.grid.dataProvider.length>0){
    for(var i = 0; i < _root.grid.dataProvider.length; i++){
    _root.grid.dataProvider.editField(i, 'nome', _root.grid.dataProvider.nome+' ');
    }
    _root.submitForm();
    }else{
    alert('it selects an item please');
    }

    </cfsavecontent>
    <cfinput type="button" name="send" value="send" onClick="#actionscript#" />
    </cfform>
    <cfdump var="#FORM#" />





    Pedro Claudio Guest

  12. #12

    Default Re: Select Multiple Rows within CFGRID?

    Pedro, that works great for a query! Thanks very much. Is it possible to get
    it to work with populated data that was retrieved from flash remoting? Would I
    just need to change a variable name?

    Thanks again!

    roninDLC Guest

  13. #13

    Default Re: Select Multiple Rows within CFGRID?

    it observes results._items



    <cfform name="form1" format="flash" width="600" height="250"
    onload="loadAS();">
    <cfformitem type="script">
    function loadAS(){
    _root.grid.multipleSelection = true;
    }
    </cfformitem>
    <cfgrid name="grid" rowheaders="no">
    <cfgridcolumn name="nome" header="Nome" width="260" />
    <cfgridcolumn name="email" header="E-mail" />
    </cfgrid>
    <cfsavecontent variable="actionscript">
    if(_root.grid.selectedIndices != null){
    var arr_data:Array = _root.grid.selectedIndices;
    while(arr_data.length > 0 ){
    var index = arr_data.pop();
    _root.grid.dataProvider.editField(index, 'nome',
    _root.grid.dataProvider[index].nome+' ');
    }
    _root.submitForm();
    }else{
    alert('');
    }
    </cfsavecontent>
    <cfinput type="button" name="send" value="send" onClick="#actionscript#" />
    <cfsavecontent variable="actionscript">
    mx.managers.CursorManager.setBusyCursor();
    var conn:mx.remoting.Connection;
    var Proxy:mx.remoting.NetServiceProxy;
    var response={};
    var gateway ='http://localhost:8080/cfusion/flashservices/gateway/';
    conn = mx.remoting.NetServices.createGatewayConnection(ga teway);
    response.onStatus = function(stat:Object):Void {
    alert("Error: " + stat.description);
    mx.managers.CursorManager.removeBusyCursor();
    };
    response.onResult = function(results:Object):Void {
    if(results){
    _root.grid.dataProvider = results._items;
    }else{
    alert("error - loged");
    }
    mx.managers.CursorManager.removeBusyCursor();
    };
    Proxy = conn.getService('cfcomp', response);
    Proxy.getData();
    </cfsavecontent>
    <cfinput type="button" name="get" value="get" onClick="#actionscript#" />
    </cfform>
    <cfdump var="#FORM#" />

    <cfcomponent>
    <cffunction name="getData" access="remote" returntype="query">
    <cfscript>
    var query = QueryNew('');
    QueryAddColumn(query,'nome',ListToArray('Pedro,Ped ro Claudio,pcsilva'));

    QueryAddColumn(query,'email',ListToArray('Pedroem ail.com,Pedro_CLaudioemail
    ..com,pcsilvaemail.com'));
    </cfscript>
    <cfreturn query />
    </cffunction>
    </cfcomponent>

    Pedro Claudio Guest

  14. #14

    Default Re: Select Multiple Rows within CFGRID?

    I am not obtaining to visualize what it is describing.

    The example of remoting that I passed does not have relation with selection in
    the grid. Remoting used only fills grid.

    It can give more details


    Pedro Claudio Guest

  15. #15

    Default Re: Select Multiple Rows within CFGRID?

    I came across myself with one bug but it sees where I arrived.

    Now it was?



    I go to edit the codes that the forum corrupted, answers 4 and 6.
    OK?



    <cfform name="form1" format="flash" width="600" onload="loadAS();">
    <cfformitem type="script">
    function loadAS(){
    _root.grid.multipleSelection = true;
    _global.remoting = function(params:Object):Void{
    mx.managers.CursorManager.setBusyCursor();
    var conn:mx.remoting.Connection;
    var Proxy:mx.remoting.NetServiceProxy;
    var response:Object = {};
    var gateway ='http://localhost:8080/cfusion/flashservices/gateway/';
    conn = mx.remoting.NetServices.createGatewayConnection(ga teway);
    response.onStatus = function(stat:Object):Void {
    alert("Error: " + stat.description);
    _root.texto.text = "Error: " + stat.description;
    mx.managers.CursorManager.removeBusyCursor();
    };
    response.onResult = function(results):Void {
    params.onResult(results);
    mx.managers.CursorManager.removeBusyCursor();
    }
    Proxy = conn.getService(params.point, response);
    var _arguments:Object = (params.argument==null)?{}:params.argument;
    Proxy[params.method](_arguments);
    }
    }
    </cfformitem>
    <cfgrid name="grid" rowheaders="no">
    <cfgridcolumn name="nome" header="Nome" width="260" />
    <cfgridcolumn name="email" header="E-mail" />
    </cfgrid>
    <cfsavecontent variable="actionscript">
    if(_root.grid.dataProvider.length != null){
    var response={};
    var results ="";
    response.onResult = function(results:Boolean):Void {
    if(results){
    alert("success");
    }else{
    alert("error - loged");
    }
    };
    response.point = 'recs';
    response.argument={};
    response.argument.nome=[];
    response.argument.email=[];
    var i = 0;
    for(; i < _root.grid.getLength();i++){
    response.argument.nome.push(_root.grid.getItemAt(i ).nome);
    response.argument.email.push(_root.grid.getItemAt( i).email);
    }
    response.method = 'setData';
    _global.remoting(response);
    }else{
    alert('Nothing to be sent');
    }
    </cfsavecontent>
    <cfinput type="button" name="send" value="send" onClick="#actionscript#" />
    <cfsavecontent variable="actionscript">
    var response={};
    response.onResult = function(results:Object):Void {
    if(results){
    _root.grid.setDataProvider(results._items);
    }else{
    alert("error - loged");
    }
    };
    response.point = 'cfcomp';
    response.method = 'getData';
    _global.remoting(response);
    </cfsavecontent>
    <cfinput type="button" name="get" value="get" onClick="#actionscript#" />
    <cftextarea name="texto" />
    </cfform>



    <!--- recs.cfc --->
    <cfcomponent>
    <cffunction name="setData" access="remote">
    <cfargument name="nome" type="array" required="yes">
    <cfargument name="email" type="array" required="yes">
    <cftry>
    <cfloop index="i" from="1" to="#ArrayLen(arguments.email)#" >
    <!--- <cfquery datasource="dsn">
    insert into table (nome,email) values
    ('#arguments.nome[i]#','#arguments.email[i]#')
    </cfquery> --->
    </cfloop>
    <cfcatch type="database">
    <cfreturn false />
    </cfcatch>
    </cftry>
    <cfreturn true />
    </cffunction>
    </cfcomponent>


    <!--- cfcomp.cfc --->

    <cfcomponent>
    <cffunction name="getData" access="remote" returntype="query">
    <cfscript>
    var query = QueryNew('');
    QueryAddColumn(query,'nome',ListToArray('Pedro,Ped ro Claudio,pcsilva'));

    QueryAddColumn(query,'email',ListToArray('Pedroem ail.com,Pedro_CLaudioemail
    ..com,pcsilvaemail.com'));
    </cfscript>
    <cfreturn query />
    </cffunction>
    </cfcomponent>

    Pedro Claudio Guest

Similar Threads

  1. cfgrid Highlighted Rows
    By TheEngineer in forum Macromedia ColdFusion
    Replies: 1
    Last Post: March 1st, 09:14 PM
  2. CFGRID - SELECT ROW
    By ArtNirvana in forum Coldfusion Flash Integration
    Replies: 1
    Last Post: February 25th, 07:02 PM
  3. Replies: 0
    Last Post: September 24th, 03:24 AM
  4. Replies: 0
    Last Post: September 11th, 12:19 AM
  5. Select rows where other related rows don't exist
    By Dmand in forum Microsoft SQL / MS SQL Server
    Replies: 2
    Last Post: July 2nd, 06:23 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •