How to Get DataGrid ItemRenderer Controls?

Dear, I want to get Controls (Radio Buttons) from DataGrid within itemRenderer on Item Click event.
Can you give me a sample code?
=====================================================
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%">
    <mx:Script>
        <![CDATA[
            import mx.events.*;
            import mx.controls.Alert;
            private function P4R_Y_change(e:Event):void
                Alert.show(e.toString());
            private function P4R_N_change(e:Event):void
                Alert.show(e.toString());
            private function onItemClick_gvPendingForReceipt(e:ListEvent):void
                // want to get radio buttons here
               Alert.show((e.target as DataGrid).columns[e.columnIndex].toString());
        ]]>
    </mx:Script>
    <mx:Panel title="Pending for Receipt (NGO only)">
        <mx:DataGrid id="gvPendingForReceipt" itemClick="onItemClick_gvPendingForReceipt(event)">
            <mx:dataProvider>
                <mx:Object Case_No="cn8385738" JS_Name="Peter Wong" Remarks="" >
                </mx:Object>
                <mx:Object Case_No="cn4428255" JS_Name="Mary Queen" Remarks="Referal from SWD Special team!!">
                </mx:Object>       
            </mx:dataProvider>   
            <mx:columns>
                <mx:DataGridColumn headerText="Case #" width="150" dataField="Case_No" >
                </mx:DataGridColumn>
                <mx:DataGridColumn headerText="Job Seeker Name" width="150" dataField="JS_Name" >
                </mx:DataGridColumn>       
                <mx:DataGridColumn headerText="Accept Case?" width="200" >
                    <mx:itemRenderer>
                        <mx:Component>
                            <mx:VBox>
                                <mx:RadioButton id="rdoP4R_Y" label="Yes" group="{IsAccepted}" >
                                </mx:RadioButton>
                                <mx:RadioButton id="rdoP4R_N" label="No" group="{IsAccepted}" >
                                </mx:RadioButton>       
                                <mx:RadioButtonGroup id="IsAccepted">
                                </mx:RadioButtonGroup>           
                            </mx:VBox>   
                        </mx:Component>
                    </mx:itemRenderer>
                </mx:DataGridColumn>
                <mx:DataGridColumn headerText="Remarks">
                    <mx:itemRenderer>
                        <mx:Component>
                            <mx:TextInput text="{data.Remarks}">
                            </mx:TextInput>
                        </mx:Component>
                    </mx:itemRenderer>
                </mx:DataGridColumn>                       
            </mx:columns>   
        </mx:DataGrid>
    </mx:Panel>
    <mx:Panel title="Pending for Intake (NGO only)">
    </mx:Panel>
    <mx:Panel title="Active Case List (NGO/ Case Management">
    </mx:Panel>
</mx:VBox>
Regards,
Man Pak Hong, Dave
[email protected]
Analyst Programmer.

This code may help.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
width="100%">
<mx:Script>
<![CDATA[
import mx.controls.DataGrid;
import mx.events.ListEvent;
[Bindable]
private var nameStr:String;
public function getName(event:ListEvent):void {
var dg:DataGrid = DataGrid(event.target);
nameStr = dg.selectedItem.cn;
]]>
</mx:Script>
<mx:ArrayCollection id="acEmaillist">
<mx:Object>
<mx:cn>Bob Smith</mx:cn>
<mx:mail>[email protected]</mx:mail>
</mx:Object>
<mx:Object>
<mx:cn>Ted Alan</mx:cn>
<mx:mail>[email protected]</mx:mail>
</mx:Object>
<mx:Object>
<mx:cn>Fred Tobs</mx:cn>
<mx:mail>[email protected]</mx:mail>
</mx:Object>
</mx:ArrayCollection>
<mx:DataGrid dataProvider="{acEmaillist}"
itemClick="getName(event)">
<mx:columns>
<mx:DataGridColumn headerText="Full Name" dataField="cn"
width="150"/>
<mx:DataGridColumn headerText="Email" dataField="mail"
width="150"/>
</mx:columns>
</mx:DataGrid>
<mx:Label text="{nameStr}"/>
</mx:Application>

Similar Messages

  • How to get AdvancedDataGrid ItemRenderer for hierarchal column to work

    I have an advanced datagrid with 5 columns one of which is a
    hierarchal (tree). This datagrid is populated by the following:
    MyAdvancedDataGrid.dataProvider = new
    HierarchicalData(MyXMLListCollection);
    The first column is the tree and im trying to do a item
    renderer on it in actionscript... I have the following code:
    MyTreeColumn.itemRenderer = new ClassFactory(MyRenderer);
    In order to get the icon and label to show up i need to
    extend AdvancedDataGridGroupItemRenderer as such:
    MyRenderer extends AdvancedDataGridGroupItemRenderer
    This has one problem... the updateDisplayList function only
    gets fired for the children not the root rows... So if you set the
    this.icon.visible = false... the icon will show up on the root rows
    but the most bottom children rows the icon will become invisible...
    Now ... if i extend the class with
    AdvancedDataGridItemRenderer then the tree functionality gets
    overwritten and it doesn't function the way that I need it to..
    Ultimately I'm trying to shift the default label over so I can add
    another icon to the right of the the default icon so the user can
    click on it... Any help from anyone would be greatly
    appreciated...

    var column:AdvancedDataGridColumn;
    column = new AdvancedDataGridColumn("HeaderName");
    column.width = 10;
    column.dataField = "@label";
    column.itemRenderer = new ClassFactory(MyItemRenderer);
    MyAdvancedDataGrid.columns = [column];
    code for MyItemRenderer:
    package {
    import mx.controls.dataGridClasses.DataGridListData;
    import mx.controls.listClasses.BaseListData;
    import mx.controls.listClasses.IDropInListItemRenderer;
    import mx.controls.listClasses.IListItemRenderer;
    import mx.core.UIComponent;
    public class MyItemRenderer extends UIComponent implements
    IDropInListItemRenderer, IListItemRenderer {
    //class variables
    private var _ListData:DataGridListData = null;
    private var _data:Object = null;
    public function PE_BaseRenderer() {
    super();
    public function get listData():BaseListData {
    return _ListData;
    public function set listData(value:BaseListData):void {
    _ListData = value as DataGridListData;
    public function get data():Object {
    return _data;
    public function set data(value:Object):void {
    _data = value;
    invalidateProperties ();
    override protected function createChildren():void {
    super.createChildren();
    //create you children here
    } //end of class declaration
    } //end of package declaration
    Within this renderer you can create whatever type of children
    you want for the datagrid column

  • How to get dateformat from Control Panel? Please help

    Hi,
    I need to get the date format as per displayed in the Control Panel's Regional Options tab.
    May i know how to achieve this in java?
    Please help.

    Thanks for the feedback, actually my code is like this:
    SimpleDateFormat sdf = (SimpleDateFormat) SimpleDateFormat.getDateInstance(DateFormat.SHORT);
    System.out.println(sdf.toPattern());
    If i open up my Control Panel and change the "Standards and Formats" to "English(United States), the "Short date" field is now showing "7/9/2010" which is "M/d/yy". This matches the format obtained using (SimpleDateFormat) SimpleDateFormat.getDateInstance(DateFormat.SHORT). However, it still returns me the format "M/d/yy" after i made the following changes:
    1. Click on the "Customize" button to open the "Customize Regional Options" dialog window.
    2. Select the "Date" tab, from the "Short Date format" drop-down list, choose "MM/dd/yy"
    How can I get the exact date format displayed at Regional Options now, which is "MM/dd/yy"? Please advice.

  • How to get Datagrid using Hebrew rtl

    Hi,
    I am trying to get Hebrew in the datagrid in the correct (rtl) direction.
    I managed get it done with a TLF textfield but not in the datagrid.
    Can TLF be used for the datagrid or is there another way to get the direction of the hebrew correct?
    Your help is greatly appreciated.

    This code may help.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="100%">
    <mx:Script>
    <![CDATA[
    import mx.controls.DataGrid;
    import mx.events.ListEvent;
    [Bindable]
    private var nameStr:String;
    public function getName(event:ListEvent):void {
    var dg:DataGrid = DataGrid(event.target);
    nameStr = dg.selectedItem.cn;
    ]]>
    </mx:Script>
    <mx:ArrayCollection id="acEmaillist">
    <mx:Object>
    <mx:cn>Bob Smith</mx:cn>
    <mx:mail>[email protected]</mx:mail>
    </mx:Object>
    <mx:Object>
    <mx:cn>Ted Alan</mx:cn>
    <mx:mail>[email protected]</mx:mail>
    </mx:Object>
    <mx:Object>
    <mx:cn>Fred Tobs</mx:cn>
    <mx:mail>[email protected]</mx:mail>
    </mx:Object>
    </mx:ArrayCollection>
    <mx:DataGrid dataProvider="{acEmaillist}"
    itemClick="getName(event)">
    <mx:columns>
    <mx:DataGridColumn headerText="Full Name" dataField="cn"
    width="150"/>
    <mx:DataGridColumn headerText="Email" dataField="mail"
    width="150"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:Label text="{nameStr}"/>
    </mx:Application>

  • Tables - How to get cell value? How to get/set UI controls properties?

    Hi,
    I want to get a the cell's value of row x and col y.
    The table is not bounded so I cannot use:
    Table1.Items(key).DataSourceRow.DataItem("ColID")
    Another question:
    How to I set the properties of a table column which contains UI elemtents that I create dynamically?
    for exmpale:
    c1 is a TableBodyCell
    tr is a tableRow
    c1 = New TableBodyCell(Table1, tr, 0)
    c1.TableCellContent = New InputField
    tr.Cells.Add(c1)
    How do I set/get the properties of the InputField?
    Thanks,
    Omri

    Thanks Reshef,
    My Table's scheme:
    Column 0 - TextView
    Column 1 - InputField
    I was able to get a cell value of type TextView by using what you suggested:
    Write(CType(Table1.Items(0).Cells(0).TableCellContent,TextView).Text)
    However, when I tried to do the exact thing to InputField I didn't get any value (nor error)
    Write(CType(Table1.Items(0).Cells(1).TableCellContent, InputField).Value)
    I fill the Input Field and then push "Execute" button which supposed to write the value.
    About my second question:
    By using the cast (CType) I can access the properties I need (like Width) so it kind of solve my problem.
    for example:
    CType(Table1.Items(1).Cells(1).TableCellContent, InputField).Width = "15px"

  • How to get the  bursting control file in xml publisher

    Hi All
    I am using oracle Apps r12 and Bi publisher 10g.
    I have followed these steps for Xml Bursting reports
    http://apps2fusion.com/apps/21-technical/251-xmlp-concurrent-program-revisited-with-bursting.
    I have created Data definition and now i need to attach the Bursting Control file.
    Whether the system will generate Burst control file after creating data definition or we need to create a control file.
    Thanks & Regards
    Srikkanth.M

    You need to create a control file and upload it.
    You can also refer this blog for detailed steps http://garethroberts.blogspot.com/2008/03/bi-publisher-ebs-bursting-101.html

  • How to get ATI catalyst control center.

    I'm using mac book pro with bootcamp as well. So i'm using every support software downloaded from windows by Bootcamp. However, i'm missing that ATI CCC which is crucial as i have an extended 2nd display monitor hooked up to my macbook pro. There is a slight gap between the borders and the displays when the highest possible resolution is configured for the 2nd display. I Know i can install ATI CCC on my windows as i've done it before but i've unfortunately formatted my windows without any backups. The recent display drivers from the AMD site doesnt work at all which is also why i use the support softwares from BOOTCAMP. Where can i get the ATI CCC package alone to maximize the resoultion of my 2nd display? or is there another solution to this.
    The highest possible resultion for my 2nd display now is 1920x1080 which leaves a gap betweent he borders.
    The resolution that fits well into my 2nd display is 1680x1050 which makes everything seems so blurry.
    Many thanks.

    Let me add. Already tried everything: battery is switched to High Performance, Windows XP service pack 3, T500

  • How to get ARD to control xserve osx server 10.5?

    can anyone tell me what you have to enable so you can control server with ARD?

    Hi
    On the Server go to System Preferences > Sharing > Remote Management. Untick Screen Sharing. If Remote Login (SSH) is ticked, untick it. Unless of course you are aware of the potential security risk inherent with this. If you are leave it on.
    Install ARD on another mac - the one you are using for example. Launch it, supply the serial number. Don't bother with a task server (this might be a step too far for you at this stage). Create an admin name and password (I suggest admin and admin - keeps it simple that way) and you should be looking at the ARD main window.
    By default and the first time it's launched it will scan the network using Bonjour. You can select this and change it to Local Network. Either one will do. Explore the interface to see what it does. There is a fairly useful online Help available as well. You could also consult the ARD Forum:
    http://discussions.apple.com/forum.jspa?forumID=1007
    By now you should 'see' your server or at the least its IP Address - which you should know? Select it and then select Control. You'll be prompted to enter the Server's admin account details (username and password). Once you supply these you should now be looking at the Server's Desktop. If your client mac is Leopard you don't even need to use ARD. You should be able to 'discover' the Server in the Shared part of the Finder's Sidebar. You should see an option to Share Screen. Clicking on this will present you with a login window. Again supply the server's admin name and password.
    Finally you can vnc to the Server using a web browser. Safari would do, but you can use any other browser if you wish. In the url key in vnc://IPaddressofyourserver. You'll know you've been successful when you see the login prompt. Again supply the server's admin name and password.
    Tony

  • In Table Control How to get only a single row .

    Hi
    In Table Control How to get only a single row .I am able to decrease it its height to 4 but then 2 rows is getting dsplayed .I want only one row to be display and 2nd row should be deactivated or not visible.
    regards
    Avik
    Edited by: Julius Bussche on Jan 30, 2009 1:10 PM
    Removed friendly greeting from the subject title

    Hi Avik
    use this code it will help you.
    MODULE passdata OUTPUT.
      READ TABLE it_revision INTO wa_rev INDEX tab_clc-current_line.
      IF sy-subrc = 0.
        LOOP AT SCREEN.
          IF screen-group1 = '111'.      " 111 IS THE GROUP NAME
            screen-input = 1.          " input mode
            screen-active = 1.         " input mode.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF screen-group1 = '111'.       "GROUP NAME
            screen-input = 0.           " display mode
            screen-active = 1.          " DISPLAY MODE.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDMODULE.                 " PASSDATA  OUTPUT
    Make sure in group tou are passing the field name that you want in input mode on the base of other field
    Hope it will help you.
    Thanks
    Arun Kayal.

  • How to get current row data in table control

    Hi , expert ,
       I am professional in oracle ,  but  now I am a new guy in SAP ABAP .
    I  have a question in UI
    How to get current row data and click pushbutton  in table control  to open next screen ?
    I want to get the current data and open next screen to carry out detail detail .
    Thansk for all your suggestion .

    GET CURSOR LINE SY-CUROW .
      READ TABLE internal_table index SY-CUROW.

  • How to get background color of controls ?

    Hello everyone.
    How to get background color of controls ?
    When we use AWT/Swing,
    we can get background color of component by using Component.getBackground()
    It is regret that I can not find any method for such a method in JavaFX.
    And how do we detect the change of background color of controls ?
    Best regards.

    Hi Tadashi,
    try this.
    @Override
    public void start(final Stage primaryStage) {
        primaryStage.setTitle("Test ChangeListener");
        Button btn = new Button();
        btn.setText("change background");
        btn.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                primaryStage.getScene().setFill(Color.rgb(
                        (int)(Math.random() * 255),
                        (int)(Math.random() * 255),
                        (int)(Math.random() * 255)));
        StackPane root = new StackPane();
        root.getChildren().add(btn);
        primaryStage.setScene(new Scene(root, 300, 250));
        primaryStage.getScene().fillProperty().addListener(new ChangeListener<Paint>() {
            @Override
            public void changed(ObservableValue<? extends Paint> arg0, Paint arg1, Paint arg2) {
                System.out.println(
                        "old color: " + arg1.toString()
                        + ", new color: " + arg2.toString());
        btn.getOnAction().handle(null);
        primaryStage.show();
    }Peter

  • How to get record control in sony ericsson p1i.

    How to get record control in sony ericsson p1i....
    does jsr234 helps??

    I'm not sure it is possible to get the PL/SQL record type through JDBC. Please try to access this procedure through JDBC to see if it is possible.
    You may need to convert the record type, to an object-type, i.e. wrap the procedure in another procedure that converts the record type. You could also just wrap the procedure in another that expands the record values into individual output parameters.

  • How to get reading list in my all my devices and computer (window 7). i have installed ios 6 on iphone and icloud control panel on both PC's (home and office) but i dont get updated reading list on all my devices.

    how to get reading list in my all my devices and computer (window 7). i have installed ios 6 on iphone and icloud control panel on both PC's (home and office) but i dont get updated reading list on all my devices.

    Hi bluegrandpanash,
    Thanks for visiting Apple Support Communities.
    If you backed up your iPhone to iCloud before updating the software, first try the steps under "Restore from an iCloud backup" in this article to recover your data:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    http://support.apple.com/kb/HT1766
    Best Regards,
    Jeremy

  • How to get request_ Id  in control file?

    Hi,
    I am using "fnd_global.conc_request_id" in control file to get request_Id
    but always getting request_id value as '-1' while running the SQL *Loader program.
    Any setup is missing here or is there any other way to get request_id in control file.
    Thanks & Regards,
    Sagarika

    Pl see your duplicate post here - How to capture SQL *Loader program parameter value in control file?
    Srini

  • How to get sum of quantity column in table control

    Hi, expert ,
    Someone can guide me how to get som of qty column in table control ?
    I created a screen with a table control  and has a  qty quantity field .
    I want to show total of qty  in a  field .
    my code like this ...
    PROCESS AFTER INPUT.
      LOOP AT I_tab.
        CHAIN.
           FIELD I_tab-COUNTQTY MODULE  caculate_total_qty .
        endchain.
        MODULE UPDATE_TOTAL_QTY  .
      ENDLOOP.
    but, when I Back to the previous screen
    It's caculate again so I always get wrong Total quantity .
    anyone can help me ...

    Hi , Dhina
    I have another question .
    I use internal table data in table control to update  database table .
    The data in the db will be change ,
    but each record I want to delete in table control , it's still exist in database .
    my code is
    WHEN 'SAVE'
         MODIFY YDSGBT53 FROM TABLE I_YDSGBT53 .
         COMMIT WORK .
      END CASE
    How  to fix my code and let it can change and delete data in database  ?
    or
    when I delete record  in table control I must to delete data in the database too .
    Edited by: TitusFang on Jun 16, 2011 3:21 AM

Maybe you are looking for