Master Detail grid with flash remoting

Ask a Question related to Coldfusion Flash Integration, Design and Development.

  1. #1

    Default Master Detail grid with flash remoting

    I've been trying to populate a detail grid based on selection from master grid
    I finally got the second grid (detail) to populate when I selected a record
    from the first grid(master), unfortunately I lost the text input fields for the
    master record that I was binding to from the Master grid. now I'm just getting
    the detail records.
    The two grids are populated by 2 different queries that reside in the same
    CFC.

    I first populate the Master grid (userGrid) then when a row is selected I pass
    the selected rows primary key to the function that calls the detail query in
    the cfc. This query selects only the records where the Master primary key = the
    foreign key in the detail table.

    This is a sample of the code that is in the script tag that deals with the
    grid:

    var responseHandler:Object = {};

    var userGrid:mx.controls.DataGrid = userGrid; (this is the master grid)
    var userIdGrid:mx.controls.DataGrid = userIdGrid; (this is the detail grid)

    responseHandler.onResult = function ( results: Object):Void
    {userGrid.dataProvider = results.item;
    _root.setMode('add');
    mx.managers.CursorManager.removeBusyCursor();
    }

    responseHandler.queryUserid_Result = function (results: Object):Void
    {userIdGrid.dataProvider = results.item;
    _root.setMode('add');
    mx.managers.CursorManager.removeBusyCursor();
    }

    On form load calls the getData() that populates the Mastergrid using the
    master query in the CFC - this works.
    the getData() looks like this:

    public function getData():Void
    {
    var qArgs:Object {};
    <cfoutput>
    qArgs.status = '#session.status#';
    </cfoutput>
    _global.listingService.queryAll(qArgs);
    _root.setMode('add');
    mx.managers.CursorManager.removeBusyCursor();
    }


    The master grid makes the call to populate the second grid (getUserid() in the
    onchange event, the PKNO column is the primary key:
    <cfgrid name="userGrid" ........
    onchange="userGridChanged();getUserid(userGrid.sel ectedItem.PKNO)">

    The getUserid () looks like this:

    public function getUserid(pkno:String):Void
    {
    var userArgs:Object {};
    <cfoutput>
    userArgs.pkno = pkno;
    </cfoutput>
    _global.listingService.queryUserid(userArgs);
    _root.setMode('add');
    mx.managers.CursorManager.removeBusyCursor();
    }

    This function is populating the detail grid with the correct data. When I
    select a row from the master userGrid.

    The right hand panel has textinput fields for the master record that are bound
    to the master grid- userGrid. Below these textinput fields I have the detail
    grid - userIdGrid that can contain 1 or more rows. I can only get one or the
    other to populate, not both.

    Is there a problem with the resultHandlers each specifing the .dataprovider?

    Any help would be greatly appreciated.

    Thanks in advanced for any help,
    Kim


    kimby24 Guest

  2. Similar Questions and Discussions

    1. master detail set php
      I am having problems with the mater detail sets. I create a master detail set and use data from 2 tables linked together with a where clause. But...
    2. Master/Detail in one grid
      I need master info in several columns in _one_ row for each record. Below each "master" record, I need a number of detail rows. Like this: ...
    3. Can I delete from the detail of a master/detail datagrid?
      Hi Mark, As for the delte certain items in the detailed grid items in MASTER/DETAIL grids. Here are my suggestions; The DataGrid, DataList or...
    4. master - detail
      Hello everyone, I'm new on this list and have been working for quite a while on a PHP app that will make an HTML frontend for a PostgreSQL dbms....
    5. Master Detail detail
      Dear gurus, I have got a scenario where I have a master table its detail table its detail table. How to implement this using Data Grid or is...
  3. #2

    Default Re: Master Detail grid with flash remoting

    You call setMode() a lot, perchance you are clearing the wrong data there when you don't expect it.
    Chuck1411 Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139