Different flex components based on AdvancedDataGrid column value

I have the following code snippet, here I am able to change the label of the button based on the Data Grid's Column value. I am unable to think of a way where I can add two completely different buttons, based on Data Grid's value. Any help will be greatly appreciated.
_SM
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()" >
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.collections.ArrayCollection;
import flash.utils.Dictionary;
import mx.core.Application;
import mx.controls.Alert;
import mx.events.ItemClickEvent;
[Bindable]
     public var seatingChart:ArrayCollection = new ArrayCollection();
     public function init():void {
var airCraftSeating:Object = new Object();
airCraftSeating["fname"] = "foo";
airCraftSeating["lname"] = "bar";
airCraftSeating["iflag"] = true;
seatingChart.addItem(airCraftSeating);
airCraftSeating = new Object();
airCraftSeating["fname"] = "dude";
airCraftSeating["lname"] = "buddy";
airCraftSeating["iflag"] = false;
seatingChart.addItem(airCraftSeating);
airCraftSeating = new Object();
airCraftSeating["fname"] = "playstation";
airCraftSeating["lname"] = "three";
airCraftSeating["iflag"] = true;
seatingChart.addItem(airCraftSeating);
airCraftSeating = new Object();
airCraftSeating["fname"] = "dudeeye";
airCraftSeating["lname"] = "buooosldk";
airCraftSeating["iflag"] = false;
seatingChart.addItem(airCraftSeating);
]]>
</mx:Script>
<mx:Canvas id="baseColor" height="100%" width="100%">
<mx:Form left="5" right="8" width="100%" height="100%" borderThickness="2" id="classForm" >
    <mx:DataGrid  id="dgClassTypes" dataProvider="{seatingChart}" sortableColumns="false" wordWrap="true" variableRowHeight="true" horizontalGridLines="false" verticalGridLines="false" width="100%" height="100%" verticalAlign="top" >
    <mx:columns>
<mx:DataGridColumn dataField="fname" headerText="fname"  textAlign="left" visible="true"/>
<mx:DataGridColumn dataField="lname" textAlign="center" visible="false"/>
<mx:DataGridColumn textAlign="center">
<mx:itemRenderer>
<mx:Component>
<mx:Button  label="{data.iflag?'check':'delete'}" visible="true" />
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn dataField="lname" textAlign="center" visible="false"/>
    </mx:columns>        
</mx:DataGrid>
</mx:Form>
</mx:Canvas>
</mx:Application>

Put the buttons in the VBox inside the itemrenderer and set the visible property bindable to iflag value.
<mx:DataGridColumn textAlign="center">
<mx:itemRenderer>
<mx:Component>
<mx:Canvas>
    <mx:Button  label="check" visible="{data.iflag}" height="{data.iflag? 20:0}"/>       
    <mx:Button  label="delete" visible="{!(data.iflag)}" height="{data.iflag? 0:20}"/>   
</mx:Canvas>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
Thanks and Best regards,
Pooja Kuber | [email protected] | http://www.infocepts.comwww.infocepts.com

Similar Messages

  • How to restrict a table with its set of data based on a column value in it?

    Hi,
    I have a scenario in which I have to show a set of data of a pivot table by restricting data based on a column value. I am creating BIP report whose source is from BIA ie.RPD. Based on a column value I want to restrict the data being displayed in the table. Since I also want the hidden data in the first table to be displayed in another table in the same report I cannot restrict the data at the query level i.e at RPD or at BIA. For this reason I used
    <?xdofx:if saw3_ = 1?>
    the pivot table
    <?end if?>
    But it does not restrict any data.
    Also I tried using the if condition inside the table before the row level looping happens. But no good show even then.
    How can I forgo this problem?
    Regards,
    The MM

    Hi,
    See : http://download.oracle.com/docs/cd/E12096_01/books/PubUser/T421739T481157.htm#4535373 regarding column and row.
    Regards,
    Colectionaru

  • Need to  color a Table row based on a Column value

    Dear Alll
    I have a requirement to color the rows of a table based on a column value in it. I have tried and surfed many useful materials over the net. but none of them solves my purpose. Please help me, I know that i can used OADataBoundValueViewObject and create a custom css file and apply color to a particular column of a table using a decode in the select statement of that VO.
    But all i need is to color a particular row with a particular color. Need your help with this ........
    Please do reply
    Best Regards
    Edited by: Antony Jayaraj on Mar 27, 2012 8:54 PM

    These posts might help you.
    How to change the row color based on Condition
    Can we colour the rows in the column of a table
    Regards,
    Peddi.

  • Filter a tableview based on a column value-Navigation Issues.

    Hi,
    I have a table view with total 99 values. The values are displayed in 10 tabs of the table view with 9 values in each tab.I go to the third tab and select a column value, which triggers an event and filters the result list from 99 to 12.
    I am simply removing the collection and filling it again with fresh values.
    My problem is-when i set the collection with new values, i want the end user to be navigated to the first tab.
    But the user is always navigated to the second tab which has the last three values.
    Is there any way to navigate the user to first tab of table view?
    I have already tried-visibleFirstRow and it is not working.
    Thanks and Regards,
    Rohit

    Hi Ashish,
    You can implement some code in DO_INIT_CONTEXT to filter your Items' BOL collection based on the condition quantity <> 0. I believe the Quantity field is available in the BOL structure.
    Here is a code snippet.
    DATA: lr_col TYPE REF TO if_bol_bo_col,
    DATA: lr_node TYPE REF TO if_bol_bo_property_access.
    lr_node = me->typed_context->CONTEXT NODE->collection_wrapper->get_first( ).
    WHILE lr_node IS BOUND.
    CALL METHOD lr_node->get_properties
    IMPORTING
    es_attributes = ls_struct.
    IF ls_struct-quantity = 0 .
      lr_col->remove( iv_bo = lr_node ).
    ENDIF.
      lr_node = lr_col->get_next( ).
    ENDWHILE.
    Regards,
    Masood Imrani S.

  • Workflow to grant access to each List item based on a column value

    Hi,
    I have 2 lists Risks and RisksLookup.
    In Risks, I have Title, Description, service impacted and status columns.
    In RisksLookup, I have service impacted, AD1, AD2, AD3, AD4 and AD5.
    I have a requirement where in I have to write a Workflow to provide access to each List item based on the value of service impacted. i.e. If service impacted in Risks List is Client A, I have to lookup what all AD groups are present for Client A in RisksLookup
    List and provide access to only those groups for that item.
    Regards, Shreyas R S

    Hi
    another approach
    create 5 more lists, dedicated to each impacted service. for  Each one these lists apply needeed right ( based onAD groups )Keep you main list where first level will add new items . Attach a workflow to this main list, which will start when an item
    is added and which will add specific item's value to his new list ( based on impacted service value )
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • Get a Column value based on other column value in a single query

    Hi All,
    I have a problem here -
    In Table XYZ I have columns by name A, B, C and COL_I. COL_I has a value A or B or C. Based on the value in COL_I, I need to get the value from the corresponding column in the table.
    For Ex: If the COL_I has the value as 'A' then I need to fetch the value from the column A. If it is 'B' then fetch from column B.
    This has to be done in a single query.
    Thanks,
    san_mah

    Hi You can use this query
    I have taken this simple case
    SQL> desc column_fetch
    Name Null? Type
    C_FIRST_NAME VARCHAR2(30)
    C_MIDDLE_NAME VARCHAR2(30)
    C_LAST_NAME VARCHAR2(30)
    C_GET_NAME VARCHAR2(30)
    based on C_GET_NAME find values in columns C_FIRST_NAME,C_MIDDLE_NAME,C_LAST_NAME
    Values in Table
    SQL> select * from column_fetch
    2 ;
    C_FIRST_NAME C_MIDDLE_NAME C_LAST_NAME C_GET_NAME
    A B C D
    A B C F
    A B C F
    A B C A
    A B C B
    A B C C
    CASE Statement:
    SELECT
    CASE WHEN c_first_name=c_get_name THEN c_first_name
    WHEN C_MIDDLE_NAME=C_GET_NAME THEN C_MIDDLE_NAME
    WHEN C_LAST_NAME=C_GET_NAME THEN C_LAST_NAME
    ELSE 'Nothing' END
    FROM column_fetch;

  • Formating the Row Based on one column value

    Hi Friends
    I am trying to format the Entire row based on the value of the first column in my Answers.
    Example if first column value in 'F' now i want the Entire row to be colored
    I can do conditional formating on one column but i want to do it on the entire row
    F     8.1 %     12.0 %
    E     5.2 %     3.5 %
    M     2.3 %     3.3 %
    If any one has done this or any suggestions please respond
    Thanks
    Sang

    Its a Pivot View
    F 8.1 % 12.0 %
    E 5.2 % 3.5 %
    M 2.3 % 3.3 %
    the column 1 --> F,E,M are the Product
    the column 2 --> 8.1% , 5.2% , 2.3% are the sales in year 2008
    the column 3 --> 12.0 % , 3.5 %, 3.3 % are the sales in year 2009
    So will i be able to apply the formating in pivot view based on one column to other column If yes please let me know how or
    suggest if this can be done using the BI Office , or BI publisher
    sing the BI Office i can do the formating in Excel but once i refresh the data all the formating is gone ... :(
    I am donno BI Publisher if we have to use BIP please suggest any solution its very very very urgent and important report formating they need here ....
    Thanks in advance David
    sango

  • Retrieve records based on a column value

    Hi,
    I want to retrieve all the records from a table where the first name column value is
    George but i don't know in which case the name is stored.. should i use the Upper or Lower function in the WHERE clause?
    Thank in advance for anyone who might reply.
    Arjun

    either of the two is ok.
    where upper(name) = 'GEORGE'

  • Conditional Text and Image based on Excel column values

    Hi,
       I have an excel file which contains data that needs to be imported/merged in an InDesign document. I have converted that file into a CSV... I'm unable to figure out how to create document using Data Merge after evaluating some conditions on data ... Example InDesing document layout is like below and will be repeated for say 200 data rows...
    Heading 1
    Text 1, Text 2
    Text 3
    Image
    Heading 1, Text 1 and Text 2 even Image value will be set after checking some condition like below
    if ( column 'A' == ' ' && column 'B' == '1')
      Set 'Heading 1' == column X
    if ( column 'C' == '0' && file.exist(column C & '.jpg'))
       Set 'Image' == column C & '.jpg'
    Can someone please guide me how to create document when CSV and Images are given based on this scenario? and even if Data Merge is the right solution for this.
    -- Thanks.

    Data merge can only reproduce one layout, so you can't merge 200 rows and then change things unless you do it in separate documents and then combine them. Of course anything you can do via scripting or manually on a regular document you can also do to a merged document after the merge is complete.
    It sounds like this is a multiple-records-per-page scenario. TO do that you set up ONE instance only of what you want to merge, in the upper left position on the page. ID then duplicates EVERYTHING that is on the page as many times as will fit using the spacing parameters you provide. This means you need to be careful with frame sizes so they don't extend beyond where they should, but it also means you can add a no-fill, no-stroke frame as a border or bounding box to make it easier to get a precise size to be used by each record. Frames in merged documents are not threaded from record to record (though there are methods for doing that after the merge, if desired), so deleting a record normally leaves a hole in the page.
    If you have master page items, it's probably best to us the "none" master before the merge, then apply the correct master page after.
    Peter

  • How to re-calculate a column value based on another column value in the same ADF Table row

    Hi,
    I'm using Jdeveloper 11.1.2.3.0.
    I have an adf table with 2 columns, columnA and columnB.
    When the value changed in ColumnA,
    1) i need to call a PLSQL and update the ColumnB value that is returned from PLSQL.
    2) Show a warning message if the existing value in ColumnB is different from the one that is returned from PLSQL.
    Can anybody suggest how can i accomplish this?
    Thanks,
    Vinod

    hi user,
    if you have inputtext means have a valuechangelistener
    in that call your pl/sql function supply input value to the appropriate function then grab the result of the function. then bind the column inputtext and compare with it. then raise your warning using FacesMessage classes.
    Sameh Nassar: Create PL/SQL Function And Call It From Your ADF Application

  • Logical (Business) Column based on physical column value

    Hello everyone,
    I'm new to here. I've been more of a reader than poster so far, but hopefully, I could offer some advice too.
    My question today is the following - let's say I have brought 2 columns to the physical layer (in the same table or in different, but joined - it doesn't really matter). 1 column is defining EXPENSE_TYPE (such as "Air Travel", "Car rental", "Hotel"...Another column is simply EXPENSE_AMT.
    I'd like to create 3 logical columns name AIR_TRAVEL_AMT, CAR_RENTAL_AMT, HOTEL_AMT in the busines layer based on the EXPENSE_AMT and EXPENSE_TYPE (AIR_TRAVEL_AMT= EXPENSE_AMT Where EXPENSE_TYPE="Air Travel")
    I know that best practices would make me create those columns in the fact table during in ETL process, however, I have no choice here now.
    My question is - how do I do it (I think it could be either variable/initialization block item - or possible I could write a CASE statement?).
    Is this method going to affect performance negatively?
    Thank you in advance.
    UPD: I think it's possible to do this using something like
    CASE WHEN Expense_Type = "AirType" THEN 1 else 0
    am I on correct path on figuring this one out?
    Message was edited by:
    wildmight

    Hi Wildmight,
    you´re right, you can do it with a CASE statement:
    For AIR_TRAVEL_AMT:
    CASE WHEN EXPENSE_TYPE="Air Travel" THEN EXPENSE_AMT ELSE 0 END
    Regards.

  • Render a column based on other column value in the same table

    JDev 11.1.1.6.0
    This may be a silly question but I am stuck
    I need to conditionally render a column say A. Condition is like if the value in the other column B of same table is equal to F. I should render column A only when this condition is satisfied. I have tried the following code:
    <af:column sortProperty="PhoneNumber1"
    sortable="false"
    headerText="#{bindings.A.hints.PhoneNumber1.label}"
    id="c146"
    rendered="#{row.PhoneNumber1ResponseFlag eq 'F'}">
    <af:outputText value="#{row.PhoneNumber1}"
    id="ot130"/>
    </af:column>
    <af:column sortProperty="PhoneNumber1ResponseFlag"
    sortable="false"
    headerText="#{bindings.B.hints.PhoneNumber1ResponseFlag.label}"
    id="c80" rendered="true">
    <af:outputText value="#{row.PhoneNumber1ResponseFlag}"
    id="ot129"/>
    </af:column>
    The data shown in the table for column  PhoneNumber1ResponseFlag is F. Still my condition is not working.

    Timo was saying that it is not possible to render the column in some situations and not in anothers, you will always have to render the column.
    The best way to do this is instead of showing a column with the text ' ', show something meaningfull to the user. This is a DataWarehouse advice to you and may be usefull since you're using ADF in a area that uses DataWarehouse..
    So the code could be something like this (based on Timo's code):
    <af:column sortProperty="PhoneNumber1"
    sortable="false"
    headerText="#{bindings.A.hints.PhoneNumber1.label}"
    id="c146">
    <af:outputText value="#{row.PhoneNumber1ResponseFlag eq 'False.' ? row.PhoneNumber1 : 'No value applied.'"
        id="ot130"/>
    </af:column>
    <af:column sortProperty="PhoneNumber1ResponseFlag"
    sortable="false"
    headerText="#{bindings.B.hints.PhoneNumber1ResponseFlag.label}"
    id="c80">
    <af:outputText value="#{row.PhoneNumber1ResponseFlag}"
        id="ot129"/>
    </af:column>
    Hope that helps,
    Frederico.

  • Manipulating report column based on another column value?

    Here is what I am trying to do.
    1.     I have a report region which has 2 columns.
    2.     Both the columns are setup as links to navigate to a different page. I am using <img src="#IMAGE_PREFIX#e2.gif" alt="Edit"> for link text report item attribute.
    3.     The value can be either in column 1 or 2 but not in both the columns at the same time.
    4.     If the value is existing in column1, the column 2 should display as null, which I have trouble with. I can see the images even though the value is null.
    Appreciate if you can let me know how to achieve this?
    Edited by: user552288 on Jul 15, 2009 7:45 AM

    Could you please post the current query which you are using?
    Instead of using the image display attribute in the report attributes column, can you include that part of the query.
    Something like:
    select
    (case when col1!=NULL then <img src="#IMAGE_PREFIX#e2.gif" alt="Edit">) else 'NULL' as Column1,
    (case when col2!=NULL then <img src="#IMAGE_PREFIX#e2.gif" alt="Edit"> ) else 'NULL' as Column2
    from table

  • How to retrieving latest row based on a column value

    Hi,
    Lets consider a scenario. I have a table which has a order number, count column which is our fact, a type column which contains types e.g. (A,B) with A has more priority then B. Now in our graph we are getting all rows i.e. if we have two rows in db for order #1 one for type A and one for type B, then it shows us data from both rows in graph.
    But I need only to show one row of type A in this case as A has higher priority than B. The row with type B should not contribute in construction of my graph if type A for same row also exists.
    I tried a solution, for which i created a new column at logical level which contain 1 for A and 0 for B. Now i put Max aggregation rule in it to get maximum value which will be row with Type A in our case. But it did not work.
    How we will can achieve it in OBIEE?
    Thanks.
    Aasim Khan.

    Hi Steve,
    I have a similar requirement... one of the columns in my table is a calculated value based on several xml fields,
    <?xdofx:(MATH01+MATH02+MATH03+MATH04+MATH05+AA+AA1)+((FNDCD01+FNDCD02+FNDCD03+FNDCD04+FNDCD05+MCHCD01+MCHCD02) div '8')?>
    if the resultant value above is less than 62, i do no want to display this entire row in the output. could you help me wout with this?
    thanks
    Domnic

  • Create multiple sheets in report based on distinct column values

    Hello all,
    We are using BOXI 3.1. I have a request from my users for which i cannot find a solution. The problem is i have a query and in a a column i have lets say 10 distinct values. For each of those values i need to generate a report within a report (a new sheet in report) that has data for only this value and schedule this to the users so they get excel file with many sheets.
    Is that even possible with BO? How can i approach this problem?
    My current solution is I generate 1 report and schedule it to excel file which gets delivered to users. Then i have a macro in excel that is on a network. The user then runs this VBA macro and it generates new sheets in excel. They are not satisfied with this solution :S .
    I know webi doesnt use VBA and deski is EOL. Is there any other solution?
    Regards, Martin

    Hi,
    From the first view this is not what i had in mind. But i will take a look at this too.
    Any other suggestions?
    tnx. M.

Maybe you are looking for