Display value in data grid

08/29/2008 08:58:48 AM
Reply | Quote | Top | Bottom | Edit
hi all,
i have two classes.
class User
public String name;
public int age;
public Address address;
class Address
public String city;
I'm passing a List<Users> to the data provider of a
data grid . I can display the values of properties of Users i.e,
name and age.. My issue is how do i display the value of city which
is a propertyt of Address class in the datagrid column..
thanx in advance
Mark this message as the answer.
Print this message
Report this to a Moderator

Hi,
Try labelFunction property of the DataGridColumn.
labelFunction allow you to specify a function name, which will be
invoked when that data is rendered. You will get the Object (User
id your case) corresponding the row being rendered will be passed
as argument to the function. You can use the object and return the
value you want to be displayed.
Please find more details on labelFunction at the URL below
http://livedocs.adobe.com/flex/3/langref/mx/controls/dataGridClasses/DataGridColumn.html#l abelFunction
You can also try custom item renderer.
Hope this helps.

Similar Messages

  • Display image into Data Grid

    Hello,
    I have to display into a data grid, in Flex 2, 2 columns:
    first column ( "Images") must contain a picture with an object and
    second column (" quantity") must contain the amount of that object
    that I want to buy. The problem is that I must take the name of the
    image from an .xml file, specified like this:
    <mx:DataGrid id="obj" dataProvider="{ObjList}" > where
    ObjList is the .xml file with <name/>
    <picture_address/> etc.
    The second column must contain a textbox so I can input a
    number of items for each picture ( can be also a combobox where
    from I can select some value, from 1 to 20 for example).
    I've searched the Internet and I haven't found a solution
    yet. Please give me a link or a solution for this problem.
    Tudor

    use itemrenderes.... the example below shows how to add an
    image.... you can do the same thing with a text box or combo box
    <mx:DataGridColumn width="10" headerText="Image">
    <mx:itemRenderer>
    <mx:Component>
    <mx:Canvas width="100%" height="100%">
    <mx:Image verticalCenter="0" horizontalCenter="0"
    source="{data.picture_adress}""/>
    </mx:Canvas>
    </mx:Component>
    </mx:itemRenderer>

  • Value from data grid not showing in workspace

    Hi everyone.
    I've entered value in data grid that i maid in Planning for one member. It looks like there is no velue for that member. What needs to be done to recognize new source?
    Member is set on Store and is used in some formulas in Dynamic Calc members.
    Thx.

    Maybe it is an implied share, is it is an only child, set the member to "never share", refresh and try again.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Column formatting based on grouping data value- advanced data grid

    Hello Everyone,
    I am using advanced data grid to display hierarchial data nested upto depth 4. I have to color the leaf nodes conditionally based on  the grouped column value.
    Say for Eg.,
    If the data is something like
    Company
         Manager
              Jim          $4000
              John        $3000
         Accountant
              Smith     $2000
              Sam       $3000
    I have to color Jim and John based on they being a manager. In other words, how do I get Manager and Company information for the leaf rows. The data is serial to start with and I am grouping it before displaying.
    Please let me know how this could be done.
    Thanks
    Arun

    Once htmldb.oracle.com is available again, you may have a look in my demo application:
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    In the tab section I, you will find several examples on pop-up pages. There this conditional
    displaying is included as well.
    Denes Kubicek

  • Bug in 1.5.1 Deleting number value in data grid

    Hello,
    it is not possible to set a number in a column to NULL by simply deleting the value
    DROP TABLE tab_test;
    CREATE TABLE tab_test(
    dat DATE
    ,num NUMBER
    ,var VARCHAR2(2)
    INSERT INTO tab_test (dat,num,var)
    VALUES (TO_DATE('01.01.2009','dd.mm.yyyy'),4,'ff');
    COMMIT;Open the table in SQL Developer and select data tab.
    Deleting the date value and commiting is ok
    UPDATE "RVS_FE"."TAB_TEST" SET DAT = TO_DATE('', 'DD.MM.YYYY') WHERE ROWID = 'AAA6Q0AAGAABHUlAAA' AND ORA_ROWSCN = '10443975276'
    Commit Successful
    Deleting the number value and commiting raises an error
    UPDATE "RVS_FE"."TAB_TEST" SET NUM =  WHERE ROWID = 'AAA6Q0AAGAABHUlAAA' AND ORA_ROWSCN = '10443975285'
    One error saving changes to table "RVS_FE"."TAB_TEST":
    Row 1: ORA-00932: inconsistent datatypes: expected NUMBER got DATE
    Rollback Successful
    Deleting the char value and commiting is ok
    UPDATE "RVS_FE"."TAB_TEST" SET VAR =  WHERE ROWID = 'AAA6Q0AAGAABHUlAAA' AND ORA_ROWSCN = '10443975285'
    Commit Successful
    Regards
    Marcus
    Edited by: Marwim on 26.11.2008 08:59

    Jim, I could reproduce and see the error, no change columns order.
    You can use the Marwim script's and, on the data grid, select the column DATE, delete value and commit.
    On the data grid, select the column var, delete value and commit.
    On the data grid, select the column num, delete value and commit -> get error.

  • Multi-Select Box Not Displaying Values Passed From Grid?

    Coldfusion 8
    I inherited an application and am trying to maintain and improve it... hit a snag today.
    I have a multi-select box that is not displaying what I expect.  The values come from a ColdFusion grid which is based off a database query.
    Here is the code for the select - does not work - nothing is selected:
    <cfselect name="USER_IDS" multiple="true" queryposition="below" selected="USER_IDS" query="ActiveUsersPlus" disabled="#disabled#" value="G_USER_WORK_UNIT_SK" display="G_USER_ID" >
    </cfselect>
    Now if I change the multiselect to a single select like below - it takes the first item in the field list (from the grid) and selects it in the drop down.
    <cfselect name="USER_IDS" multiple="false" queryposition="below" selected="USER_IDS" query="ActiveUsersPlus" disabled="#disabled#" value="G_USER_WORK_UNIT_SK" display="G_USER_ID" >
    </cfselect>
    Or if I assign a variable like this and use the multi-select code it seems to work as well.
    testlist = "22,26";
    <cfselect name="USER_IDS" multiple="true" queryposition="below" selected="#testlist#" query="ActiveUsersPlus" disabled="#disabled#" value="G_USER_WORK_UNIT_SK" display="G_USER_ID" >
    </cfselect>
    I have displayed the value of "User_IDs" in the grid and in the data entry part of the screen to see values of:  22,26
    to make sure that wasn't my issue.
    Do grids and multiselects require something additional?  Any advice on how to resolve?

    Problem was related to some javascript for the select box.  There was a function for a single select box but not a multiple select box - this fixed it: 
    if(theForm.elements[i].type == "select-multiple"){
                        var selectBox = theForm.elements[i];
                        var sbname = selectBox.name;
                        cpvalue = String(eval('record.data.' + sbname));
                        var NotifyArray = cpvalue.split(',');
                        for (var j=0; j < selectBox.length; j++) {
                            selectBox[j].selected = false;
                        for (var j=0; j < selectBox.length; j++) {
                            sbvalue = selectBox[j].value;
                            for (var k=0; k < NotifyArray.length; k++){
                                if (sbvalue == NotifyArray[k]){
                                    selectBox[j].selected = true;

  • Problem in Data Grid

    Hi All,
    Account calculations are not displaying on the data grid. But the values are being picked up with a smart view report.
    I tried running a force calculate and a consolidate all, but that did not work.
    Please suggest in this regards.
    Thanks in advance....

    I tried to use your algorithm to modify my code but i am not able to do that. For this example i am not using any httpservice i am  using data services. I created a PHP file i just need to import it into data services planel and drag that services onto data grid it will automatically bring all the data into that data grid.  Can you tell me what i need to modify to achive my goal. am using following code
    protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
    getHorizontalCommentResult.token = horizontalCommentsService.getHorizontalComment();
    <mx:DataGrid x="159" y="123" id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{getHorizontalCommentResult.lastResult}" height="223" width="245">
    <mx:columns>
    <mx:DataGridColumn headerText="Comments" dataField="Comments"/>
    </mx:columns>
    PP file
    <?php
    class HorizontalCommentsService{
    public function getHorizontalComment() {
    $connection = mysqli_connect("localhost", "root", "root", "my_db", 8889) or die(mysqli_connect_error());
    $sql = "SELECT * FROM photo_comments ORDER BY Image_ID DESC";
    $result = mysqli_query($connection, $sql) or die('Query Failed: ' . mysql_error($connection));
    $rows = array();
    while($row = mysqli_fetch_object($result)) {
    $rows[ ] = $row;
    return $rows;
    ?>

  • SQL Dev 1.5.3 Data Grid showing incorrect data

    After upgrading to SQL Dev 1.5.3, I have seen instances of incorrect data displayed in the data grid (when displaying many records at a time), both in the Table Browser and in SQL Worksheet.
    For example, in the grid, it shows a value 1234 for a column. Now when I query just that row, the correct results are shown.
    Has anyone noticed this?
    Thanks,
    Manish

    Any updates on this? I am hitting this bug and it makes life very uncomfortable as I cannot trust the results.
    SQL Developer 1.5.3 + JDK 1.6.11 on Windows XP.

  • Need help with data grid...

    I have setup a profile card which displays information about individuals by pulling data from an XML database.
    I have multiple text fields and couple movie clips that display images but i need a datagrid to display stats for each individual.
    The stat information is set as attributes on a array of XML nodes each node is a year.
    Example XML
    <hockey>
         <profile>
              <name>Wayne Gretzky</name>
              <image>pic1</image>
              <dob>Jan 26, 1961</dob>
              <position>Centre</position>
              <height>6'0"</height>
              <weight>185lbs</weight>
              <history>"important information"</history>
              <medal_record>
                        <medal standing ="Silver" Event =" 1981 Canada Cup" sport="Ice Hockey"/>
                        <medal standing ="Gold" Event =" 1984 Canada Cup" sport="Ice Hockey"/>
                        <medal standing ="Gold" Event =" 1987 Canada Cup" sport="Ice Hockey"/>
                        <medal standing ="Gold" Event =" 1991 Canada Cup" sport="Ice Hockey"/>
                        <medal standing ="Silver" Event =" 1996 World Cup of Hockey" sport="Ice Hockey"/>
              </medal_record>
         </profile>
         <profile>
              <name>Wayne Gretzky2</name>
              <image>pic2</image>
              <dob>Jan 26, 1962</dob>
              <position>Right Wing</position>
              <height>6'1"</height>
              <weight>205lbs</weight>
              <history>"important information"</history>
              <medal_record>
                        <medal standing ="Gold" Event =" 1981 Canada Cup" sport="Ice Hockey"/>
                        <medal standing ="Bronze" Event =" 1984 Canada Cup" sport="Ice Hockey"/>
                        <medal standing ="Silver" Event =" 1987 Canada Cup" sport="Ice Hockey"/>
                        <medal standing ="Silver" Event =" 1991 Canada Cup" sport="Ice Hockey"/>
                        <medal standing ="Gold" Event =" 1996 World Cup of Hockey" sport="Ice Hockey"/>
              </medal_record>
         </profile>
    </hockey>
    The red information is what i need to get displayed by the Data Grid for each profile.
    Standing
    Event
    Sport
    Gold
    1981 Canada Cup
    Ice Hockey
    Bronze
    1984 Canada Cup
    Ice Hockey
    The swf has buttons to cycle through the profiles which loads the new information from the XML.
    If you have a good understanding of how the dataGRIDs work please let me know if you can help as this is the last problem holding me from finishing this.
    Thanks in advance.

    Update... I got the data pulling in but it doesnt change as the profile changes with the rest of the data.

  • User-Defined Type does not display values in Table Data grid

    I have a User defined Type that is a collection of one character VARCHAR2 values. In the Table Data grid it does not display the character values. I know on all our other Oracle development applications these values display. Is this a bug or is there a snippet to display these values?

    Version: 1.0.0.15
    DB: 10.2.0
    Workstation OS: Windows XP

  • Display value and description of one field in alv grid

    Hi Folks,
       I want to display value and description of one field as one column in alv grid.
    for example iam having Xfield = 01,02,03.
    and 01 iam having text value as xxx,
    01 xxx
    02 yyy
    03 zzz
    Im report display the values are displaying as 01,02,03..
    but i want to display it as 01 xxx,02 yyy, 03 zzz.
    Please do needful.
    Thx.

    Hi, swetha
    You can do this with "concatenate".
    example:
    In you code check where you final internal table is getting filled up before that do this concatenate and then append it.
    data t_text type string.
    t_text = textfield
    CONCATENATE 'Xfield'
                     t_text
                      INTO wa_workarea SEPARATED BY space.
    cheers,
    Bhavana

  • Display listbox key value in ALV GRID method

    Hi All,
    I have a program in which columns are generted dynamically based on number of fields. The column name is dynamic as it depends on its text while The value in Column's can be 1, 2, 3, 4, 5.
    I am trying to display this in a list box along with the text which are maintained as fixed values at domain level.
    space Walking
    1       Archery   
    2       Boxing
    3       Cycling
    4       Rowing
    Also I am displaying by using 'DD_DOMVALUEs_GET, looping through all the fixed values and concatenate
    domvalue_l   ddtext separated by cl_abap_char_utilities=>horizontal_tab. No tab space is coming between key and value.
    Also for the 1st value which is space it is not coming properly as space is condensed.
    The point is that after I am putting values in the grid. The system event data changed is called where the value selected is  1 Archery and it is going to bad cells, error protocol display . I want only the 1st character. How to modify the content in the grid before the system event gets called.
    Regards,
    DPM

    Hi,
    try follow code to setup fieldcat of that DROP DOWN field.
    FCAT-DOMNAME = ' '.
    FCAT-CHECKTABLE= '!'.

  • Data Grid Display child Class data

    Hi,
       I have  2 Action Script class binded to remote java class
    Class 1
    package hmil.setup.model
    import hmil.com.general.model.Employee;
    [Bindable]
    [RemoteClass(alias="hmil.setup.model.Area")]
    public class Area
    public function Area()
    public var ARMST_AREA_ID:int;
    public var ARMST_CMPN_NO:String;
    public var ARMST_CORP_NO:String;
    public var ARMST_SCTN_TYPE:String;
    public var ARMST_CRTE_USR_NO:String;
    public var ARMST_CRTE_TIME:Date;
    public var ARMST_UPDT_USR_NO:String
    public var ARMST_UPDT_TIME:Date;
    public var ARMST_DLR_LIST:ArrayCollection;
    public var ARMST_EMP:Employee;
    Class 2
    package hmil.com.general.model
    [Bindable]
    [RemoteClass(alias="hmil.com.general.model.Employee")]
    public class Employee
    public function Employee()
    public var EPMST_ID:Number;
    public var EPMST_CMPN_NO:String;
    public var EPMST_CORP_NO:String;
    public var EPMST_EMP_NO:String;
    public var EPMST_DLR_NO:String;
    public var EPMST_EMP_NAME:String;
    When the remote java method returns  a list of Area object through Blaze DS  this list can be assiged as data to the Data Grid
    The DataGridColumn   dataField can be mapped to the column name and it displays properly
    <mx:DataGridColumn  dataField="ARMST_AREA_ID" headerText="Id"/>
    But lets say I wanted to display the child value  (ARMST_EMP.EPMST_ID )   in the Data Grid 
    Since the sever returns the Parent Java Object  which contains the related Employee as inner Object.
    The Objetcs are deserialized to AS class objects.
    But how to display the  child columns in data grid.
    If i give the data field as ARMST_EMP  it is displayed as Object. but if i mention the datafield as ARMST_EMP.EPMST_ID, it does not display anything.
    please  let me know how to display the child object in datagrid
    Thanks

    Hi Mugunda, did you ever find out how to do this?

  • Coded UI: How to verify watermark displayed in the fields and Data grid?

    Hi,
    I've an requirement to verify watermark in the fields say username field displays "Username" water mark when no data is available in the field and water mark in data grid saying "No data available".
    Please observe the water mark displayed in screenshot below:
    So how to verify watermark?
    Thanks & Regards,
    Sunil
    Best Regards, Sunil Email: [email protected]

    Hello,
    Depending on what form technology you are using, you can try posting to one of the following forums:
    Windows Forms General
    Windows Presentation Foundation (WPF)
    ASP.Net forums
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Text in data grids doesn't display

    With the new 29 version of FireFox, data grids on our site don't seem to display the data in the grids any longer. When using Chrome or IE11, these still show just fine. Version 28 and earlier worked great. The menu system in our site doesn't work well any longer either using version 29.
    What we are seeing on this site was also seen with IE11 when it first came out but that was easily fixed by just using the "compatability" settings in IE11 and adding our site to the list of compatible sites. There isn't such a setting in FireFox so I wonder how we go about getting around this.

    Thanks for the offer but we no part of this site can be publicly accessed. The thought of a font causing the problem doesn't make much sense to me because it was working fine prior to version 29. Why would the font all of a sudden be causing the problem. Furthermore, it isn't just text in data grids but the menu system we use doesn't work properly either. You have to hold down on the left mouse button to use the menu and then when you are on the item you want to select, let off the left mouse button. Guess our only option is to start recommending Chrome or IE.

Maybe you are looking for

  • A lot of problem for an error: Cannot start Managed Server through NM

    Hi, all. Thank for coming here. My main problem is cannot start Manager server through Node Manager. I've configured with the same way on my friend's network and It's works but It's wrong with mine. my weblogic domain: Machine 1: Administration Serve

  • How to set a field inactive at selection screen?

    Hello,  here is the definition of my selection screen. SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001. SELECT-OPTIONS : s_typcmd  FOR  EKKO-BSART DEFAULT text-003,                        "Type de commande s_grpe FOR  EKPO-MATKL ,       

  • How do I get my picture back?

    I have deleted a picture and now I want it back I have backed my iPhone up to iCloud when the picture was still on how do I get the picture back?

  • [SOLVED] Escape sequences instead of colors in rxvt-unicode

    On a Git cheat sheet I found that I could add nice colors to Git's output, so I edited my ~/.gitconfig by adding: [color] ui = auto [color "branch"] current = yellow reverse local = yellow remote = green [color "diff"] meta = yellow bold frag = magen

  • Exam results for 1Z0-858

    Hi, Yesterday (4th May 2013) , I had appeared for the 1Z0-858 (OCPJWCD EE5) certitifcation exam at the NIIT,Residency Road,Bangalore test center, and that will get a mail regarding the results in 30 min after completing the test, but its been a whole