Changing Row backgroundColor according to some condition

I am using datatable and each row in table should have different color according to a value of one of the property of row.
Here it is
<h:dataTable value="#{form.list}" var="item" id="table">
<h:column>
<hutputText value="#{item.name}" />
</h:column>
<h:column>
<hutputText value="#{item.status}" />
</h:column>
</h:dataTable>
Each row should be of a color depending on 'status' value of that row.
Say, if it is pending - it should be red color, if it is approved - it should be green color......
Any advise is really appreciated.
Please help me out, Thanks

Meh. Why spend so much time on a problem when there are easy alternatives.
<table>
<tr><th>Name</th><th>Status</th></tr>
<ui:repeat value="#{form.list}" var="item">
<tr class="#{form.status}_rowclass"><td>#{item.name}</td><td>#{item.status}</td></tr>
</ui:repeat>
</table>

Similar Messages

  • Changing row color according to condition statement

    Hi,
    Is there a way that I can color a row or field in a report according to a condition? For example, can I color red all rows where an amount is over 1,000? Or can I just highlight the field that answers to the criteria?
    Thank you.
    Leah

    Hi,
    The row cannot be colored
    just the cell that match the criteria
    tamir

  • Droping tables according to some conditions

    I am new to Database side. i want to drop tables which are like 'C$%'.
    How should i achieve that ?
    What would be query ?

    MaheshGx wrote:
    Hi I ahve tried your commmand but it is giving following error.
    Error report:
    ORA-00942: table or view does not exist
    ORA-06512: at line 3
    00942. 00000 - "table or view does not exist"Then you're doing something wrong. In which case you need to instrument the code to give you step-by-step feedback. For example:
    begin
      for t in (select table_name from user_tables where table_name like 'C$%' ) loop
        begin
            dbms_output.put_line( 'Dropping table '||t.table_name );
            execute immediate 'drop table '||t.table_name;
            dbms_output.put_line( 'Table dropped' );
        exception when others then
            dbms_output.put_line( 'Table drop failed with '||SqlErrM(SqlCode) );
        end;
      end loop;
    end;If the table names are case sensitive or contains special characters, you need to wrap the table name in double quotes in the drop table statement.
    PS. Keep in mind that simply dropping tables like this is VERY unusual. Make sure you are doing the right thing and addressing the problem (which you neglected to mention), correctly. You could be digging a deep and dark hole for yourself by dropping tables, and the wrong ones, like this.

  • Grey out a particular row in ALV based on some condition.

    Hi All,
    How can we grey out the particular row in ALV based on some condition( I am using the function modules and not OOPS).
    Regards
    Ramesh.

    Hello Ramesh
    In this case you need to add a specific field to your structure:
    TYPES: BEGIN OF ty_s_outtab.
    INLCUDE TYPE <my table or structure>.
    TYPES: CELLTAB   TYPE lvc_t_styl.  " name is arbitrary but this one is most frequently used
    TYPES: END OF ty_s_outtab.
    DATA: gt_outtab  TYPE STANDARD TABLE OF ty_s_outtab
                                 WITH DEFAULT KEY.
    You can use the fieldcatalog to make an entire column non-editable (LVC_S_FCAT-EDIT = ' ' ).
    However, in case of rows you need to inactivate all cells of this row. For sample coding please refer to thread:
    How to conditionally set ALV field as hotspot
    Regards
      Uwe

  • Insert data in same table based on some condition

    Hi. I am new to this forum.
    I have to write a stored procedure to Insert Data into a table say MYTABLE ,having structure as:
    Col1 Col2 Col3 ................ TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data as it is in the same table(MYTABLE) except changing some fields on basis of some conditions:
    1. if PaidAmount>0 && CurrentInstallment<TotalInstallment then
    CurrentInstallment=CurrentInstallment+1
    2. In the MonthYear field I am having data in formate(month/year)ex. 01/2012, 11/2012 ....
    So I have to insert data by incrementing month and year. for example:
    if currentdata is 11/2012 then next data will be 12/2012
    But next will be 01/2013
    I have to select all the records which belongs to previous month(through MonthYear field ) and put checking & changes on each record of the selected data and then insert them into same table(MYTABLE).
    How to achive that?
    Thanks.

    978184 wrote:
    Every thing is working fine but some strange result as:
    when i run my Procedure TRANSFERDATATONEXTMONTH
    1. by Passing Value as : CUSTOMERID_var ='ABX101' and MONTHYEAR_var='12/2012' it insurts 5 rows
    which is correct , since I have 5 records where CUSTOMERID='ABX101' and MONTHYEAR='12/2012' and
    new 5 rows has CUSTOMERID='ABX101' and MONTHYEAR='01/2013' (all other values are as expected)
    2. now when i again run by passing values: CUSTOMERID='ABX101' and MONTHYEAR='01/2013' it inserts 10 records(just double )
    and new records has value CUSTOMERID='ABX101' and MONTHYEAR='02/2013' (while on the basis of condition CUSTOMERID='ABX101' and MONTHYEAR='01/2013' i have in my table only 5 records)
    and all records are duplicate. Some times it inserts three times , while on condition basis it should no. What is happening?Probably, meanwhile you were trying to Insert the First time and the second time, someone did run the procedure that Inserted 5 More records for 01/2013. And, hence your Second run inserted 10 records instead of 5.
    >
    Why it is inserting double of records while i have only 5 records on given condition? Am I missing some thing?Yes, you are. You are missing your Tables, Your Dummy/Sample Data, Working Procedure/Function that can be replicated.
    Without this, we cannot simply believe on assertions that Oracle is behaving incorrectly.
    In addition to this, the GetMonthYear function, should be scrapped. It is un-necessary, when the same logic can be achieved using Oracle ADD_MONTHS function (See my previous post). And you are storing the MonthYear in a Varchar field, which ideally should be a Date field. This eradicates the un-wanted need to cast from VARCHAR - DATE - VARCHAR.
    Please do make some time to read {message:id=9360002} and mentioned relevant details.
    And notice, the code difference in my previous post and in your code.
    Please use
    {noformat}
    (exactly as shown) above and below your code, that indents the code properly for better readability.
    {noformat}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to set colors on some condition in barchart

    Hi,
    I want to design a crystal report with a barchart. I should specify the color of the bar based on some conditions, this colornames are maintained in the database. I tried using chart expert -> color highlights,
    is there any other way to set the color of the bar?
    Regards,
    Deepa V

    Hi Deepa,
    In charts Color Highlight is the only way to conditionally change the color of the riser bars.
    You can use multiple conditions at a time in color highlight.
    To change the color directly you can right click the bar and select the Format Series Riser and change the color (but not conditionally)
    Regards,
    Aditya Joshi

  • How to dynamically add/remove a button from the ribbon based on some condition? (Ribbon XML)

    Hi,
    I have a ribbon (done using ribbon XML) with menu options. I need to remove few buttons from the menu dynamically based on some condition. Also, I want to change the label of another button. How to achieve this programmatically? (C#)
    Thanks in advance.
    Thanks Prasad

    Hello Prasad,
    Use callbacks for populating Ribbon controls such as menu, dropDown, gallery and etc. Then you can use the
    Invalidate or
    InvalidateControl methods of the
    IRibbonUI interface to get your callbacks invoked when required. Thus, you will be able to delete the required item(s).
    You will find the following articles in MSDN helpful:
    Chapter 11: Creating Dynamic Ribbon Customizations (1 of 2)
    Chapter 11: Creating Dynamic Ribbon Customizations (2 of 2)
    To change the label of your controls at runtime you need to use the getLabel callback and call the Invalidate or InvalidateControl methods of the IRibbonUI interface. The following series of articles describe the Fluent UI in depth:
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

  • Change PO currency accordingly to PR currency

    Hi expert,
    I got requirement to change PO currency accordingly to PR currency on Delivery/Invoice tab in ME21N once user enter PR number and PR item number. I am not sure whether this scenario can be done in ME21N. I've did some debugging on userexit MM06E005 and seems like this userexit can't cater this issue. Appreciate on your help. Thanks.
    Edited by: Mohd Fazli Zaini on Jun 16, 2010 4:43 AM

    HI,
    U have said the PO is held,when the PO is held it will give a message stating,for  what  reason the PO is being held.Pl post that
    message.In the PR find what is the status in item detail.
    murugan
    Edited by: Murugan mgl on Jul 23, 2009 12:11 PM

  • How to disable view buttons on some condition-webdynpro abap

    Hi ALL,
    i have a two buttons in my view ......initially one button must be enable,depending on some condition i want to disable one button on the same view .........in which i am displaying my alv data ........(in the same view).

    check the properties with property name Visible.
    Take one attribute with name as visibile and Type ( WDUI_VISIBILITY-Data Type for "visible" Properties)
    then bind this attribute with property visible.
    then in run time according to the condition pass value '01'-for no visibility and '02' for visible.
    Hope this helps you.
    Regards,
    sarath

  • Changed the variable from used in condition to changed gives error

    Hi,
         How to decide on which fields to be used in charecteristcs and which in used in condition. ?
    I have a code in fox which works for some tets data and fails for ceration other test data. wheni changed one field from used in condition to changed field the code is working. however now when i transport the same to quality it gives the error as   :
    " Variable Material Must Have a Type of a Field to be Changed.
    Kindly Help on this. From where should i changed the type of material ? currently i have just changed the tick of the check box from  " used in condition "  to " changed "
    Thanks And Regards,
    Vijay

    Hi Vijay,
    Please replace the code with the following one.. I think it will work now.. Apparently there is no problem with field to change option. However, please note that you are checking the help option (below fox editor) while providing the sequence for material and Plant. It might happen that system is looking for plant and material option and you are providing as material and plant option.
    Please check the code below:
    DATA CALMONTH TYPE 0FISCPER.
    DATA LO_CURR TYPE 0LOC_CURRCY.
    DATA LO_0CALQUAT TYPE 0CALQUARTER.
    DATA MATERIAL TYPE GPUMATL.
    DATA VENDOR TYPE 0VENDOR.
    DATA LO_VENDOR TYPE 0VENDOR.
    DATA PLANT TYPE GPUPLANT.
    DATA L_SPLIT TYPE F.
    DATA L_VOL TYPE F.
    DATA TOT_VOL TYPE F.
    DATA L_VOLUME TYPE F.
    DATA L_FISCQUAT TYPE GPUFSCQRT.
    BREAK-POINT.
    TOT_VOL = 0.
    *CALCULATE TOTAL VOLUME
    FOREACH MATERIAL, PLANT,VENDOR, LO_CURR,LO_0CALQUAT,L_FISCQUAT .
    L_VOL = {Z9APSHIP,LO_0CALQUAT,LO_CURR,VENDOR,L_FISCQUAT ,MATERIAL,PLANT}.
    TOT_VOL = TOT_VOL + L_VOL .
    *CALCULATE SPLIT % BASED ON TOTAL VOLUME
    L_SPLIT = {GPU_VSPER,LO_0CALQUAT,LO_CURR,VENDOR,L_FISCQUAT ,MATERIAL,PLANT}.
    L_VOLUME = PERP(TOT_VOL,L_SPLIT).
    {Z9APSHIP,LO_0CALQUAT,LO_CURR,VENDOR,L_FISCQUAT ,MATERIAL,PLANT} = L_VOLUME .
    ENDFOR.

  • Process message according to a condition

    Gentlemen,
    I created a process, which modifies a table column when a certain button is pressed.
    I want to modify the column in that case only, if the sysdate is later than the "begindate" column of the table. So I modified my process to be conditional.
    It works fine, however I want to notify the user, if the process is not executed because of the condition.
    I'd like to put a message something like: "The event has not started so far".
    I tried to put this message to the Process Error Message region, but it did not work. I think this is not an error, just the condition result was FALSE.
    What is the way to give the above message to the user, according to the condition ?
    Thanks, Attila v

    i'd probably do this: i'd use similar logic from your Condition to set some hidden item in your app that serves as a flag. set that flag up to get set just before your update process. next, i'd make your update process run based on a condition that checks the flag (so you don't have to check your table values twice). lastly, i'd have the next page of your app conditionally display a region with your "The event has not started so far" message if your flag item indicates as much.
    hope this helps,
    raj
    ps-if your update process is regular pl/sql, there's even more flexibility wrt how you set your flag and display your message. you could set your success/didnt_process message to an item within that process, for example, and refer to the item in your process success message using the &ITEM_NAME. syntax.

  • Calling two table controlls based on some conditions......

    I hav a requirement in which i have two table controlls, which i want to call based on some conditions. Like if condition is satisfied the first table controll shud fill up the screen and other wise the secondtable controll shud fill the screen....

    Hello,
    In the main screen where u need to vary with the 2 table controls , create a subscreen area .
    Now create two subscreens with the required table controls respectively.
    You can dynamically call the subscreens accordingly for  the conditions.
    Hope this may help you.
    Neeraj

  • How to get only the changed rows in h:dataTable

    Hi,
    I am very new in jsf technology.
    For our application, I need to process only the changed rows in the jsf datatable in managed bean.
    User may also enter new rows.We have to consider this also.
    Pls post ur suggession as soon as possible.This is urgent.This will be best if someone can post me some code snippets.
    Thanks
    -S

    As klejs said, set the valueChangeListener attribute to each of the input fields. Have a method in your backing bean which would
    1) get the index from the component id
    2) get the object and the above index from ArrayList
    3) check if the old Value is different from the new value. If yes, set some boolean flag in that object to true indicating that the row is modified.
    Sample code below. Please feel free to add checks if you need.
         public void updateDirtyFlag(ValueChangeEvent valueChangeEvent){
             if(valueChangeEvent.getOldValue()==null && valueChangeEvent.getNewValue()==null){
                     return;
             if(valueChangeEvent.getComponent().getId()==null){
                 return;
          //Extract the index from the component id in the getId method
             int idVal=getId(valueChangeEvent.getComponent().getClientId(FacesContext.getCurrentInstance()));
             ArrayList dataList=getData(); // data from session or request scope
              if((valueChangeEvent.getOldValue()==null && valueChangeEvent.getNewValue()!=null)        
                     || (valueChangeEvent.getOldValue()!=null && valueChangeEvent.getNewValue()==null)){
                 if(dataList!=null && idVal<dataList.size() && idVal>-1){
                     YourBaseValueObject pojo=(YourBaseValueObject)dataList.get(idVal);
                     pojo.setUpdateFlag(true);
             else if(valueChangeEvent.getOldValue()!=null && valueChangeEvent.getNewValue()!=null && !valueChangeEvent.getOldValue().equals(valueChangeEvent.getNewValue())){
                 if(dataList!=null && idVal<dataList.size() && idVal>-1){
                     YourBaseValueObject pojo=(YourBaseValueObject)dataList.get(idVal);
                     pojo.setUpdateFlag(true);
         }HTH.
    Karthik

  • Need to know the details on the change logs on the invoice output condition master records

    All,
    Recently, there seems to be a change made in VV32 transaction for Billingoutput types with regard to printer device names,
    I am unable to track down these changes. NACH provides information about created by & created on information, but i am not able to track the changes that were made against output condition records, is there any ways of identifying such changes using easier methods or even through CDHDR/ CDPOS tables.
    I tried executing CDPOS, but unable to proceed as i was not sure / do not know the ways of entries that i need to provide in CDHDR / CDPOS tables for my scenario.
    Can some one please help. Thanks in Advance.
    Regards
    Ilango

    Hi Ilango,
    if you don't activated the change logs, you just can find the chances made by identify the last two transports. So you need to go the way you started. Unfortunaly it could be, that you can't find the old settings anyway because there might be a * in...
    I know an easier way to find the old values.
    You can talk to your basis-guys if they got an older backup available and can backup it in an extra system. But that includes some extra work and the additional host.
    ~Florian

  • Issue regarding condition pricing date as system date for some condition types in sales order

    Hi
    I have already created a sales order on 30.04.2014. Today I am adding new line item to sales order in VA02 transaction. in this order new line items condition pricing date for conditions JEX2,JECX should show as 12.06.2014. But currently it is showing as 30.04.2014. I need condition pricing date as system date for above conditions.
    Regards
    prashant

    Hi
    When I am changing pricing date VBKD-PRSDT in sales order header . It is changing the condition pricing date for all. Sales order is created on 04.06.2014. I have added line item 150 on 14.06.2014.
    After adding line item 150 , there I have changed the pricing date as 14.06.2014. in sales A tab of item 150. But still it is taking from Sales order header date as 04.06.2014 for all conditions. But my requirement is for line item it should take as system date for some conditions like JEX2,JECX& JA1Y but for other conditions it will take as Order creation date. Please suggest. I have also attached screen shot below. please go through it.
    Regards
    PK
    Sales order header change mode VA02
    Here pricing date VBKD-PRSDT = 04.06.2016
    Item change mode
    I have added new line item 150 on 14.06.2014
    Changed the condition pricing date to 14.06.2014 & saved
    After saving I have gone to Va02 screen of line item 150
    & there I have gone to condition pricing date field from item condition tab
    for JEX2 condition type but still here condition pricing date is showing as
    04.06.2014 as below.
    Condition pricing date
    My requirement is like this
    For some particular conditions like JEX2  condition pricing date will take as system
    date instead sales order creation date when I will add a new item 150 on
    14.06.2014.but for other conditions it will show as order creation date for the
    same line item 150 .

Maybe you are looking for

  • Upgradation from 4.6C to ECC  6.0

    Dear All, I have worked on a upgrade project from 4.6C to ECC 6.0. I am in the process of maintaining documents for the project. I am just planning to maintain a repository for all the relevant documents. I feel that it will act as a useful document

  • Ipod Sounds Problem (Noise) OMG PLS HELP !!!

    Ok guys, I have a Ipod Classic 80G ... All the functions works fine, songs, sync, movies, pictures (yay) ! But i week ago my ipod start to make a noise sound when i play my musics/movies ! The noise sounds is similar when ur listening to a very bad q

  • Is it possible to replace nx1c's keyboard with x1c's?

    Just curious if that's technically possible? Solved! Go to Solution.

  • BPM count

    Scenario is N:1 (IDOC to FlatFile) using BPM. BPM receive step will receive IDOC. But it should terminate when the number of messages equals to 500. In which step I have to define this count in BPM?

  • Shuffling movies

    Does anyone know if it is possible to shuffle your movies? Say I created a playlist of short movies and I wanted to watch them all without manually starting each one every time the last one just ended. Is this possible? iMac   Mac OS X (10.4.6)