Set background color for conditional text fields by click of button.

Hi,
I am new to apex, the scenario is when i click on a button i.e. Save, it shoulld compare 2 fields P1 and P2 which are text fields.
If the value of P1 is greaterthan P2 then the whole P1 text field background color should change to "Red" otherwise in any other condition the P1 field should be "Green" color.
In which section the color function should be called on the Save button?
On the page in the HTML Header section i have added the below code but the background color is not getting set.
<script type="text/javascript">
function fncChangeColor()
var num1 = $v('P1');
var num2 = $v('P2');
if ( num1 > num2 ) {
document.getElementById("P1").style.background = "RED";
else {
document.getElementById("P1").style.background = "GREEN";
</script>
Can any one help me in moving ahead with this scenario with a detailed information.
Thanks,
Priyanka.

Hi,
Call function on button URL target
javascript:fncChangeColor()If button should submit page, then I think you do not need color field to green.
Just change to run submit function.
<script type="text/javascript">
function fncChangeColor(){
var num1 = $v('P1');
var num2 = $v('P2');
if ( num1 > num2 ) {
  $x("P1").style.background = "RED";
  return false;
apex.submit({request:"YOUR_REQUEST"});
</script>Regards,
Jari

Similar Messages

  • How can I change background color for a text field

    Hi I tried this
    style="BACKGROUND-COLOR:#00FFFF"
    working fine in IE
    but not working in Netscape.. any other way to set the background color?

    Netscape 4.x does not support this feature. Only Netscape 6.x does.

  • How to set the Background Color of a Text Field in a Tabular Report.

    Hello,
    I tried to set the Background Color of a Text Field in a Tabular Report.
    But I was not able to change this colur.
    In the report attributes --> column attributes
    I tried already:
    1. Column Formating -- >CSS Style (bgcolor: red)
    2. Tabular Form Element --> Element Attributes (bgcolor: red)
    but nothing worked.
    Can anybody help me?
    I Use Oracle Apex 2.2.1 on 10gR2
    thank you in advance.
    Oliver

    in "Report Attributes" select the column to move to the "Column Attributes" page. In the "Element Attributes" field under the "Tabular Form Element" region enter
    style="background-color:red;"
    I will also check if there is a way to do this via the template and post here again
    edit:
    in your template definition, above the template, enter the following:
    < STYLE TYPE="text/css" >
    .class INPUT {background-color:red;}
    < /STYLE >
    (remove the spaces after the < and before the >)
    change "class" to the class that the template is calling
    (I'm using theme 9, the table has: class="t9GCCReportsStyle1" so I would enter t9GCCReportsStyle1)
    A side-effect of using this second version is that ALL input types will have a red background color--checkboxes, input boxes, etc.
    Message was edited by:
    TheJosh

  • How to set background color for selected days in DateChooser

    How to set background color for selected days. I created
    checkbox for each day [Son,Mon,Tue,Wed,Thu,Fri,Sat] and a
    DateChooser, I want to change the background color for the selected
    day when i click on a button after selecting the desired checkboxs
    [ monthly wise/yearly wise]
    Thanks in advance

    There is no button involved in the following code, but it may
    be of use to you:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    private var origColor:uint;
    private function init():void {
    origColor = dc.getStyle("selectionColor");
    public function setBackGrdColors(newColor:uint):void {
    dc.setStyle("selectionColor", origColor);
    if(dc.selectedDate){
    var dayOfWeek:Number = dc.selectedDate.day;
    else{
    return;
    switch(dayOfWeek) {
    case 0:
    if(sun.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 1:
    if(mon.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 2:
    if(tue.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 3:
    if(wed.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 4:
    if(thu.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 5:
    if(fri.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 6:
    if(sat.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    default:
    break;
    ]]>
    </mx:Script>
    <mx:VBox horizontalAlign="center" verticalGap="20">
    <mx:DateChooser id="dc" textAlign="left"
    change="setBackGrdColors(cellColor.selectedColor)"/>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="sun" label="Sun"/>
    <mx:CheckBox id="mon" label="Mon"/>
    <mx:CheckBox id="tue" label="Tue"/>
    <mx:CheckBox id="wed" label="Wed"/>
    </mx:HBox>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="thu" label="Thu"/>
    <mx:CheckBox id="fri" label="Fri"/>
    <mx:CheckBox id="sat" label="Sat"/>
    </mx:HBox>
    <mx:HBox width="300" horizontalAlign="center">
    <mx:Label text="Background Color" />
    <mx:ColorPicker id="cellColor"
    selectedColor="#FF00FF"/>
    </mx:HBox>
    </mx:VBox>
    </mx:Application>

  • Set background color when condition applied

    hi,
    Can anybody tell me how to set background color when condition applied.
    My initial plan was to highlight a specify row(Change color) when the third column of this JTable consists of OK word.
    int rowCount = table.getRowCount();
    for(int i=0 ;i <rowCount ; i++)
    String word = table.getValueAt(i,3).toString();
    if(word.equals("Word")) {
    table.setSelectionBackground(Color.red);
    break;
    else {
    table.setBackground(getBackground());
    Thanks.

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    public class TableChanges
        public TableChanges()
            String[] headers = { "column 1", "column 2", "column 3", "column 4" };
            int rows = 18;
            int cols = 4;
            String[][] data = new String[rows][cols];
            for(int row = 0; row < rows; row++)
                for(int col = 0; col < cols; col++)
                    data[row][col] = "item " + (row * cols + col + 1);
            JTable table = new JTable(data, headers);
            // add custom cell renderer to each column
            TableColumnModel columnModel = table.getColumnModel();
            for(int j = 0; j < columnModel.getColumnCount(); j++)
                TableColumn col = columnModel.getColumn(j);
                col.setCellRenderer(new CellRenderer());
            // add table model listener to listen for cell edits
            // so we can detect our special selection edit value
            // which is "word"
            TableModel tableModel = table.getModel();
            tableModel.addTableModelListener(new ModelListener(table));
            JScrollPane scrollPane = new JScrollPane(table);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(scrollPane);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
            Dimension d = scrollPane.getViewport().getSize();
            table.setRowHeight(d.height/rows);
        public static void main(String[] args)
            new TableChanges();
    class ModelListener implements TableModelListener
        JTable table;
        public ModelListener(JTable table)
            this.table = table;
        public void tableChanged(TableModelEvent e)
            int firstRow = e.getFirstRow();
            int lastRow  = e.getLastRow();
            int colIndex = e.getColumn();
            if(e.getType() == TableModelEvent.UPDATE &&
                  firstRow != TableModelEvent.HEADER_ROW &&
                  colIndex != TableModelEvent.ALL_COLUMNS &&
                  colIndex == 2)                            // column 3 only
                String value = (String)table.getValueAt(firstRow, colIndex);
                // check for our special selection criteria
                if(value.equals("word"))
                    for(int j = 0; j < table.getColumnCount(); j++)
                        CellRenderer renderer =
                            (CellRenderer)table.getCellRenderer(firstRow, j);
                        renderer.setSpecialSelection(firstRow, j);
    class CellRenderer extends DefaultTableCellRenderer
        int specRow, specCol;
        public CellRenderer()
            specRow = -1;
            specCol = -1;
        public Component getTableCellRendererComponent(JTable table,
                                                       Object value,
                                                       boolean isSelected,
                                                       boolean hasFocus,
                                                       int row, int col)
            setHorizontalAlignment(JLabel.CENTER);
            Color color = Color.black;
            if(hasFocus)
                color = Color.blue;
            else if(isSelected)
                color = Color.green.darker();
            else if(row == specRow && col == specCol)
                color = color.red;
            setForeground(color);
            setText((String)value);
            return this;
        public void setSpecialSelection(int row, int col)
            specRow = row;
            specCol = col;
    }

  • Set Background color for headers in excel

    DECLARE
       v_fh     UTL_FILE.file_type;
       v_dir    VARCHAR2 (30)      := 'my dir';
       v_file   VARCHAR2 (30)      := 'test.xls';
       PROCEDURE run_query (p_sql IN VARCHAR2)
       IS
          v_v_val   VARCHAR2 (4000);
          v_n_val   NUMBER;
          v_d_val   DATE;
          v_ret     NUMBER;
          c         NUMBER;
          d         NUMBER;
          col_cnt   INTEGER;
          f         BOOLEAN;
          rec_tab   DBMS_SQL.desc_tab;
          col_num   NUMBER;
       BEGIN
          c := DBMS_SQL.open_cursor;
          -- parse the SQL statement
          DBMS_SQL.parse (c, p_sql, DBMS_SQL.native);
          -- start execution of the SQL statement
          d := DBMS_SQL.EXECUTE (c);
          -- get a description of the returned columns
          DBMS_SQL.describe_columns (c, col_cnt, rec_tab);
          -- bind variables to columns
          FOR j IN 1 .. col_cnt
          LOOP
             CASE rec_tab (j).col_type
                WHEN 1
                THEN
                   DBMS_SQL.define_column (c, j, v_v_val, 4000);
                WHEN 2
                THEN
                   DBMS_SQL.define_column (c, j, v_n_val);
                WHEN 12
                THEN
                   DBMS_SQL.define_column (c, j, v_d_val);
                ELSE
                   DBMS_SQL.define_column (c, j, v_v_val, 4000);
             END CASE;
          END LOOP;
          -- Output the column headers
          UTL_FILE.put_line (v_fh, '<ss:Row>');
          FOR j IN 1 .. col_cnt
          LOOP
             UTL_FILE.put_line (v_fh, '<ss:Cell>');
             UTL_FILE.put_line (v_fh,
                                   '<ss:Data ss:Type="String">'
                                || rec_tab (j).col_name
                                || '</ss:Data>'
             UTL_FILE.put_line (v_fh, '</ss:Cell>');
          END LOOP;
          UTL_FILE.put_line (v_fh, '</ss:Row>');
          -- Output the data
          LOOP
             v_ret := DBMS_SQL.fetch_rows (c);
             EXIT WHEN v_ret = 0;
             UTL_FILE.put_line (v_fh, '<ss:Row>');
             FOR j IN 1 .. col_cnt
             LOOP
                CASE rec_tab (j).col_type
                   WHEN 1
                   THEN
                      DBMS_SQL.COLUMN_VALUE (c, j, v_v_val);
                      UTL_FILE.put_line (v_fh, '<ss:Cell>');
                      UTL_FILE.put_line (v_fh,
                                            '<ss:Data ss:Type="String">'
                                         || v_v_val
                                         || '</ss:Data>'
                      UTL_FILE.put_line (v_fh, '</ss:Cell>');
                   WHEN 2
                   THEN
                      DBMS_SQL.COLUMN_VALUE (c, j, v_n_val);
                      UTL_FILE.put_line (v_fh, '<ss:Cell>');
                      UTL_FILE.put_line (v_fh,
                                            '<ss:Data ss:Type="Number">'
                                         || TO_CHAR (v_n_val)
                                         || '</ss:Data>'
                      UTL_FILE.put_line (v_fh, '</ss:Cell>');
                   WHEN 12
                   THEN
                      DBMS_SQL.COLUMN_VALUE (c, j, v_d_val);
                      UTL_FILE.put_line (v_fh,
                                         '<ss:Cell ss:StyleID="OracleDate">'
                      UTL_FILE.put_line (v_fh,
                                            '<ss:Data ss:Type="DateTime">'
                                         || TO_CHAR (v_d_val,
                                                     'YYYY-MM-DD"T"HH24:MI:SS'
                                         || '</ss:Data>'
                      UTL_FILE.put_line (v_fh, '</ss:Cell>');
                   ELSE
                      DBMS_SQL.COLUMN_VALUE (c, j, v_v_val);
                      UTL_FILE.put_line (v_fh, '<ss:Cell>');
                      UTL_FILE.put_line (v_fh,
                                            '<ss:Data ss:Type="String">'
                                         || v_v_val
                                         || '</ss:Data>'
                      UTL_FILE.put_line (v_fh, '</ss:Cell>');
                END CASE;
             END LOOP;
             UTL_FILE.put_line (v_fh, '</ss:Row>');
          END LOOP;
          DBMS_SQL.close_cursor (c);
       END;
       PROCEDURE start_workbook
       IS
       BEGIN
          UTL_FILE.put_line (v_fh, '<?xml version="1.0"?>');
          UTL_FILE.put_line
             (v_fh,
              '<ss:Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">'
       END;
       PROCEDURE end_workbook
       IS
       BEGIN
          UTL_FILE.put_line (v_fh, '</ss:Workbook>');
       END;
       PROCEDURE start_worksheet (p_sheetname IN VARCHAR2)
       IS
       BEGIN
          UTL_FILE.put_line (v_fh,
                             '<ss:Worksheet ss:Name="' || p_sheetname || '">'
          UTL_FILE.put_line (v_fh, '<ss:Table>');
       END;
       PROCEDURE end_worksheet
       IS
       BEGIN
          UTL_FILE.put_line (v_fh, '</ss:Table>');
          UTL_FILE.put_line (v_fh, '</ss:Worksheet>');
       END;
       PROCEDURE set_date_style
       IS
       BEGIN
          UTL_FILE.put_line (v_fh, '<ss:Styles>');
          UTL_FILE.put_line (v_fh, '<ss:Style ss:ID="OracleDate">');
          UTL_FILE.put_line
                           (v_fh,
                            '<ss:NumberFormat ss:Format="dd/mm/yyyy\ hh:mm:ss"/>'
          UTL_FILE.put_line (v_fh, '</ss:Style>');
          UTL_FILE.put_line (v_fh, '</ss:Styles>');
       END;
    BEGIN
       v_fh := UTL_FILE.fopen (v_dir, v_file, 'w', 32767);
       start_workbook;
       set_date_style;
       start_worksheet ('OM');
       run_query ('select PARTY_ID,PARTY_NAME from HZ_PARTIES
        where PARTY_ID<1080');
       end_worksheet;
       start_worksheet ('PO');
       run_query ('SELECT AGENT_ID,TYPE_LOOKUP_CODE FROM PO_HEADERS_ALL
            WHERE PO_HEADER_ID<20');
       end_worksheet;
       end_workbook;
       UTL_FILE.fclose (v_fh);
    END;
    Here i will get two outputs in same excel with different spread sheets,
    now i want to set background color for headers i
    ex:PARTY_ID,PARTY_NAME,AGENT_ID,TYPE_LOOKUP_CODE are the headers,in excel output i want background color as blue.
    Please do need full help,its urgent req.

    Hello,
    open the file in Excel and save it, just to ensure that Excel writes all the additional stuff it thinks is necessary.
    Now change the background colour of the header and save the file again but with a different name.
    Open both files in a text editor and look at the differences. That's what you need to change in your code.
    Alternatively you can use packages like xml_spreadsheet or ExcelDocumentType, both write the same file format that you use in your code and you don't have to reinvent the wheel.
    Regards
    Marcus

  • Hw do i set background color for ComboBox?

    If anyone knows how to set background color for disabeld (setEnabled(false)) of ComboBox in Windows Look and Feel. It will help me a lot.
    I don't know hoe to do it
    regards
    arun.

    At the start of your program add:
    UIManager.put("ComboBox.disabledBackground", Color.green);
    UIManager.put("ComboBox.disabledForeground", Color.blue);For a list of all the properties you can change with the UIManager see:
    http://www.discoverteenergy.com/files/ShowUIDefaults.java

  • Problem in Setting Background Color for JButton

    Hi,
    I am using Background color for JButton (color is selected from the customized JColorChooser created by us) where it contains the option of transparency. If we choose light color, then the background is set to JButton, but when we mouse-over the JButton, other components inside the container (JPanel) is getting displayed inside the button.
    Can anyone help to sort out this problem.
    Thanks in advance.

    Hi,
    Here is the code.
    DialogWrapper is JDialog and ColorEditorPane is JPanel.
    DialogWrapper     dlg         = new DialogWrapper();
    ColorEditorPane colorPanel = new ColorEditorPane();
    colorPanel.setValue( _data.getTransparentColor());
    dlg.showWrappedDialog( colorPanel, "color_help", "color_dialog" );
    if( dlg.isOK())
    Color chosenColor = (Color) colorPanel.getValue().getContent();
    _data.setTransparentColor( chosenColor );
    _transparentColorDisplay.setBackground( chosenColor );
    _transparentColorDisplay.setOpaque( true );
    this.repaint();
    this.doLayout();
    this.validate();
    }I've several components like JCheckBox, JRadioButton, JTextField in "this".

  • How to set fixed size for inputfile text field

    Hi all,
    I am using inputfile component to test file uploading so I created a simple upload page. When I finished upload the file, the input text field will "shrink" its size and change the size to adjust the file name. Is there any way to set a fix size for input text field?
    Here is some part of the code:
    <af:form id="f1" usesUpload="true">
    <af:panelHeader text="File Uploader" id="ph1">
    <af:inputFile label="File to upload" id="if1" autoSubmit="true" valueChangeListener="#{fileBean.fileUpdate}"
    value="#{fileBean.file}" partialTriggers="if1"
    columns="50"/>
    </af:panelHeader>
    <af:commandButton text="Save" id="cb1"/>
    FileBean:
    public void fileUpdate(ValueChangeEvent valueChangeEvent) {
    RichInputFile inputFileComponent = (RichInputFile)valueChangeEvent.getComponent();
    UploadedFile newFile = (UploadedFile)valueChangeEvent.getNewValue();
    UploadedFile oldFile = (UploadedFile)valueChangeEvent.getOldValue();
    Thanks,
    Jerry

    you can set columns attribute in af:inputfile. Please see highlighted area i have inserted to you code
    <af:form id="f1" usesUpload="true">
    <af:panelHeader text="File Uploader" id="ph1" columns = "34" >
    <af:inputFile label="File to upload" id="if1" autoSubmit="true" valueChangeListener="#{fileBean.fileUpdate}"
    value="#{fileBean.file}" partialTriggers="if1"
    columns="50"/>
    </af:panelHeader>
    <af:commandButton text="Save" id="cb1"/>

  • Background color of disabled text field?

    In my JClient app, the background color of text fields changes when they are disabled (which is good). But I can't seem to figure out where the color it's background is being set to comes from...not from the text field. Maybe somewhere in the look-and-feel? Anyone have any ideas?

    Found the fix for my problem (again, as usual):
    The problem is with the windowsXP look-and-feel. There is a patch, see winlaf:
    https://winlaf.dev.java.net/release_0.3.html

  • How to set background color for textarea

    Hi all,
    I have created an application in Apex 3.2.
    I am now able to disable the text fields, select lists and textarea.
    Ex:
    function disableDD()
      var v_ddays              = document.getElementById("P2_DELINQUENCY_DAYS");
      v_ddays.value            = "";
      v_ddays.disabled         = true;
      v_ddays.style.background = '#cccccc';
    }The background color thing is working for all the text fields, but the same is not working with the textarea.
    Any help please....

    There is no button involved in the following code, but it may
    be of use to you:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    private var origColor:uint;
    private function init():void {
    origColor = dc.getStyle("selectionColor");
    public function setBackGrdColors(newColor:uint):void {
    dc.setStyle("selectionColor", origColor);
    if(dc.selectedDate){
    var dayOfWeek:Number = dc.selectedDate.day;
    else{
    return;
    switch(dayOfWeek) {
    case 0:
    if(sun.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 1:
    if(mon.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 2:
    if(tue.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 3:
    if(wed.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 4:
    if(thu.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 5:
    if(fri.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 6:
    if(sat.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    default:
    break;
    ]]>
    </mx:Script>
    <mx:VBox horizontalAlign="center" verticalGap="20">
    <mx:DateChooser id="dc" textAlign="left"
    change="setBackGrdColors(cellColor.selectedColor)"/>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="sun" label="Sun"/>
    <mx:CheckBox id="mon" label="Mon"/>
    <mx:CheckBox id="tue" label="Tue"/>
    <mx:CheckBox id="wed" label="Wed"/>
    </mx:HBox>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="thu" label="Thu"/>
    <mx:CheckBox id="fri" label="Fri"/>
    <mx:CheckBox id="sat" label="Sat"/>
    </mx:HBox>
    <mx:HBox width="300" horizontalAlign="center">
    <mx:Label text="Background Color" />
    <mx:ColorPicker id="cellColor"
    selectedColor="#FF00FF"/>
    </mx:HBox>
    </mx:VBox>
    </mx:Application>

  • Problem to set background color for configTable cell

    Hi All,
    I've a configTable displays some status fields, and I need to set yellow color when the status is in processing and green when finished and red when cancelled. I've searched the forum and decided to use iterator with method RENDER_CELL_START. Here are the steps that I've done.
    Step 1: wrote a new class ZCL_ACTSTAT_ITERATOR implements interface IF_HTMLB_TABLEVIEW_ITERATOR.
        this class has a private attribute ORDERS containing the search result internal table data, in the CONSTRUCTOR method I pass the search result to the attribute using the statement ME->ORDERS = ORDERS. Then in the method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START I check the p_column_key for the status fields and then get the status value and set p_style accordingly using the following statement:
    CASE p_column_key.
        WHEN 'PREPAY_STATUS' OR 'DELVPLN_STATUS' OR 'DESIGN_STATUS'.
          READ TABLE me->orders INTO ls_order INDEX p_row_index.
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
          ASSIGN COMPONENT p_column_key OF STRUCTURE ls_order TO <col>.
          IF sy-subrc = 0.
            wf_text = <col>.
          ENDIF.
          IF wf_text = '00' OR wf_text = 'Initial'.
    *        concatenate '<font color=""red"">'
    *         WF_TEXT '</font>' into html_str.
    *        create object html_bee.
    *        html_bee->add( html = html_str ).
    *        p_replacement_bee = html_bee.        "not work either
            p_style = 'celldesign:STANDARD'.
          ELSEIF wf_text = '10' OR wf_text = 'InProcessing'.
            p_style = 'celldesign:GOODVALUE_MEDIUM'.
          ELSEIF wf_text = '20' OR wf_text = 'Finished'.
            p_style = 'celldesign:GOODVALUE_LIGHT'.
    *        p_style = 'background-color:#92D050'.
          ENDIF.
      ENDCASE.
    Step 2: In the component controller ZL_ZACT_MYO_ORDERS_IMPL, create a public attribute GV_ITERATOR type ref to the class created in step 1 (ZCL_ACTSTAT_ITERATOR), then in the controller's DO_PREPARE_OUTPUT method, get the combined context data and convert them into internal table LT_ORDERS, then create the iterator GV_ITERATOR passing LT_ORDERS, after this step, the result data can be transfered into iterator class and then be used in the RENDER_CELL_START method.
    The DO_PREPARE_OUTPUT method is like bellow:
    lr_pro ?= me->typed_context->order->collection_wrapper->get_first( ).
        WHILE lr_pro is BOUND.
          lr_pro->get_properties( IMPORTING es_attributes = ls_order ).
          if ls_order is not initial.
            append ls_order to lt_order.
          endif.
          lr_pro ?= me->typed_context->order->collection_wrapper->GET_next( ).
        ENDWHILE.
        CREATE OBJECT lc_iterator
          EXPORTING
            orders = lt_order.
        me->GV_iterator = lc_iterator.
    Step 3: in the .htm page, point iterator to controller's iterator
    <chtmlb:configTable  id                    = "Table1"
                        table                 = "//ORDER/Table"
                        iterator              = "<%= controller->GV_ITERATOR %>"
                         />
    Step 4: in the GET method of status attributes in context node ORDER, do the translation to change the status code into status description
    METHOD GET_PREPAY_STATUS
        DATA: OLD_VALUE TYPE ZACT_STATU,
              LS_STATUS TYPE ZACT_STATUS_S.
        OLD_VALUE = VALUE.
        READ TABLE GT_STATUS INTO LS_STATUS WITH KEY STATUS = OLD_VALUE.  
        "Get status description from field domain definition
        IF SY-SUBRC = 0.
          VALUE = LS_STATUS-NAME.           "Show status description
        ENDIF.
    ENDMETHOD.
    I thought I could see the status fields change their styles for different status code. But it still refuse to work, although I can debug to see that p_style really set as I expect, so I think there must have something wrong after RENDER_CELL_START, but what is it?
    Could anyone please help me sort it out or point out what's missing there or guide me the correct steps? Any post is greatly appreciated.
    Thank you!
    Jeff
    Edited by: liu jinghui on Feb 9, 2012 6:37 PM

    Hi, Jeff.
    Just don't want to cross post the same answer all over the forum. So I gave some inputs on the topic in this message: http://forums.sdn.sap.com/thread.jspa?messageID=11127647&#11127647
    Hope this will help you.

  • Can you no longer have a background color for the text box in the new version of hp photo creations

    just updated to the new version of HP Photo Creations, used to be able to have a colored background for the text box - is that no longer possible in this new (not better) version????!!!!! Uuuuuuuuuugh

    Hi Lainey.
    Thanks for asking. We're working on bringing back that feature. In the meantime, here's another way to add text backgrounds: Add a placeable graphic and then click the Arrange button to send it to the back, behind the text.
    That approach also gives you more interesting shapes. The new alignment guides make it a snap to align a graphic with a text box. In the example below (it may take a day for the image to show up here), I also used the new Premium Editing Features to change the color of the graphic.
    P.S. — Applying a thick border to an empty text box (also using the Premium Editing Features) is another way to create a background shape. That has the advantage of letting you pick any color for the box. You'll also find several new text styles at the bottom of the new text menu.
    Let us know if we can help further,
    RocketLife 
    RocketLife, developer of HP Photo Creations
    » Visit the HP Photo Creations Facebook page — news, tips, and inspiration
    » See the HP Photo Creations video tours — cool tips in under 2 minutes
    » Contact Customer Support — get answers from the experts

  • How to set background color for a JFrame

    Hi,
    i am new to swing programming. I have created a JFrame called framehelp and i placed some labels in the frame.
    I have set the background color as yellow for the frame ie by setBackground(new java.awt.Color(255, 255, 204));
    But after compiling the program i am still getting the background color of frame as gray.
    How can i change the background color of frame as lightish yellow.
    I have used NETBEANS to generate this code and i am posting the code..
    Kindly help me
    Thanks in adavance
    public class framehelp extends javax.swing.JFrame {
        /** Creates new form framehelp */
        public framehelp() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            jLabel4 = new javax.swing.JLabel();
            jLabel5 = new javax.swing.JLabel();
            jLabel6 = new javax.swing.JLabel();
            jLabel8 = new javax.swing.JLabel();
            jLabel9 = new javax.swing.JLabel();
            jLabel10 = new javax.swing.JLabel();
            jLabel11 = new javax.swing.JLabel();
            jLabel12 = new javax.swing.JLabel();
            jLabel13 = new javax.swing.JLabel();
            jLabel7 = new javax.swing.JLabel();
            jLabel14 = new javax.swing.JLabel();
            jLabel15 = new javax.swing.JLabel();
            jLabel16 = new javax.swing.JLabel();
            jLabel17 = new javax.swing.JLabel();
            jLabel18 = new javax.swing.JLabel();
            jLabel19 = new javax.swing.JLabel();
            jLabel20 = new javax.swing.JLabel();
            jLabel21 = new javax.swing.JLabel();
            jLabel22 = new javax.swing.JLabel();
            jLabel23 = new javax.swing.JLabel();
            jLabel24 = new javax.swing.JLabel();
            jLabel25 = new javax.swing.JLabel();
            jLabel26 = new javax.swing.JLabel();
            jLabel27 = new javax.swing.JLabel();
            jLabel28 = new javax.swing.JLabel();
            jLabel29 = new javax.swing.JLabel();
            jLabel30 = new javax.swing.JLabel();
            jLabel31 = new javax.swing.JLabel();
            jLabel32 = new javax.swing.JLabel();
            jLabel33 = new javax.swing.JLabel();
            getContentPane().setLayout(null);
            setBackground(new java.awt.Color(255, 255, 204));
            setForeground(new java.awt.Color(204, 204, 204));
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            jLabel1.setText("The CAME framework software measurement process evaluation is used to determine the Level of  measurement in the ITarea. This measurementprocess evaluation is ");
            getContentPane().add(jLabel1);
            jLabel1.setBounds(40, 50, 41, 16);
            jLabel2.setText("performed individually for software coomponents ie SoftwareProduct, SoftwareProcess and SoftwareResource.");
            getContentPane().add(jLabel2);
            jLabel2.setBounds(40, 70, 41, 16);
            jLabel3.setText("Below we describe the steps which will guide through the measurement process evaluation. There are two types of evaluation considerd here, General evaluation");
            getContentPane().add(jLabel3);
            jLabel3.setBounds(40, 100, 913, 16);
            jLabel4.setText("and Evaluation with respect to a standard. The measurement intensions considerd by varoius measurement standards will be used in our tool based method.  ");
            getContentPane().add(jLabel4);
            jLabel4.setBounds(40, 120, 893, 16);
            jLabel5.setText("Information about the measurement standards can be found at     www.iso.org ,    www.ieee.org.");
            getContentPane().add(jLabel5);
            jLabel5.setBounds(40, 140, 542, 16);
            jLabel6.setText("Steps to calculate the MetricsLevel");
            getContentPane().add(jLabel6);
            jLabel6.setBounds(40, 190, 199, 16);
            jLabel8.setText("2 )  The opened frame consists of several  metrics and measures, evaluation level buttons, result textfields and selection choice lists. To calculate");
            getContentPane().add(jLabel8);
            jLabel8.setBounds(70, 240, 41, 16);
            jLabel9.setText("general Metricslevel without any standard, select general from Measurement standard choice list. then select Both from scaleType choice list and finally select metrics ");
            getContentPane().add(jLabel9);
            jLabel9.setBounds(90, 260, 949, 16);
            jLabel10.setText(" and measures from the frame and press MetricsLevel Button. The metricslevel for the selected metrics will be displayed in textfield1.");
            getContentPane().add(jLabel10);
            jLabel10.setBounds(90, 280, 756, 16);
            jLabel11.setText("3 ) To determine MetricsLevel with respect to a standard select a standard from MeasurementStandard choice list, select Both from ScaleType choice list and finally ");
            getContentPane().add(jLabel11);
            jLabel11.setBounds(70, 300, 933, 16);
            jLabel12.setText("select darkened metrics and measures and press MetricsLevel Button. The Metrics Level for the selected Metrics and standard will be diplayed in textfield1.");
            getContentPane().add(jLabel12);
            jLabel12.setBounds(90, 320, 883, 16);
            jLabel13.setText("4 ) Repeat steps 1 2, 3  for ProcessMeasurementEvaluation and ResourceMeasurementEvaluation menu items from the select menu.");
            getContentPane().add(jLabel13);
            jLabel13.setBounds(70, 340, 751, 16);
            jLabel7.setText("1 ) Select ProductMeasurementEvaluation menu item from the select menu,a frame called CAME framework software product measurement evaluation will be opened. ");
            getContentPane().add(jLabel7);
            jLabel7.setBounds(70, 220, 946, 16);
            jLabel14.setText("Steps to calculate MeasurementLevel");
            getContentPane().add(jLabel14);
            jLabel14.setBounds(50, 390, 214, 16);
            jLabel15.setText("1 ) Select ProductMeasurementEvaluation menu item from the select menu,a frame called CAME framework software product measurement evaluation will be opened.");
            getContentPane().add(jLabel15);
            jLabel15.setBounds(80, 420, 943, 16);
            jLabel16.setText("2 ) The opened frame consists of several  metrics and measures, evaluation level buttons, result textfields and selection choice lists. To calculate");
            getContentPane().add(jLabel16);
            jLabel16.setBounds(80, 450, 822, 16);
            jLabel17.setText("general Measurementlevel without any standard, select general from Measurement standard choice list. then select Quantitative measures from scaleType choice list ");
            getContentPane().add(jLabel17);
            jLabel17.setBounds(100, 470, 943, 16);
            jLabel18.setText("and finally select metrics and measures from the frame and press MeasurementLevel Button. The MeasurementLevel for the selected metrics will be displayed in textfield2.");
            getContentPane().add(jLabel18);
            jLabel18.setBounds(100, 490, 973, 20);
            jLabel19.setText("3 ) To determine MeasurementLevel with respect to a standard select a standard from MeasurementStandard choice list, select Quantitative measures from ScaleType choice list");
            getContentPane().add(jLabel19);
            jLabel19.setBounds(80, 510, 1009, 16);
            jLabel20.setText("and finally select darkened metrics and measures and press MeasurementLevel Button. The MeasurementLevel  will be diplayed in textfield2.");
            getContentPane().add(jLabel20);
            jLabel20.setBounds(100, 530, 799, 16);
            jLabel21.setText("4 )Repeat steps 1 2, 3  for ProcessMeasurementEvaluation and ResourceMeasurementEvaluation menu items from the select menu.");
            getContentPane().add(jLabel21);
            jLabel21.setBounds(80, 550, 748, 16);
            jLabel22.setText("Steps to calculate MeasurementProcessLevel");
            getContentPane().add(jLabel22);
            jLabel22.setBounds(50, 600, 262, 16);
            jLabel23.setText("1 ) Select ProductMeasurementEvaluation menu item from the select menu,a frame called CAME framework software product measurement evaluation will be opened.");
            getContentPane().add(jLabel23);
            jLabel23.setBounds(80, 630, 943, 16);
            jLabel24.setText("2 )The opened frame consists of several  metrics and measures, evaluation level buttons, result textfields and selection choice lists. To calculate");
            getContentPane().add(jLabel24);
            jLabel24.setBounds(80, 650, 819, 16);
            jLabel25.setText("general MeasurementProcesslevel without any standard, select general from Measurement standard choice list. then select Quantitative measures from scaleType ");
            getContentPane().add(jLabel25);
            jLabel25.setBounds(100, 670, 930, 16);
            jLabel26.setText("choice list, enter migrated metrics if any in textfield  below migrated metrics label and finally select metrics measures from the frame and press ");
            getContentPane().add(jLabel26);
            jLabel26.setBounds(100, 690, 818, 16);
            jLabel27.setText("MeasurementProcessLevel Button. The MeasurementProcessLevel for the selected metrics will be displayed in textfield3.");
            getContentPane().add(jLabel27);
            jLabel27.setBounds(100, 710, 691, 16);
            jLabel28.setText("3 ) To determine MeasurementProcessLevel with respect to a standard select a standard from MeasurementStandard choice list, select Quantitative measures from ");
            getContentPane().add(jLabel28);
            jLabel28.setBounds(80, 740, 937, 16);
            jLabel29.setText("from ScaleType choice list, enter migrated metrics if any in textfield below migrated metrics and finally select darkened metrics and measures and press  ");
            getContentPane().add(jLabel29);
            jLabel29.setBounds(100, 760, 873, 16);
            jLabel30.setText("MeasurementProcessLevel Button. The MeasurementprocessLevel for the selected metrics will be displayed in textfield3");
            getContentPane().add(jLabel30);
            jLabel30.setBounds(100, 780, 687, 16);
            jLabel31.setText("4 ) Repeat steps 1,2,3 for ProcessMeasurementEvaluation and ResourceMeasurementEvaluation menuitems.");
            getContentPane().add(jLabel31);
            jLabel31.setBounds(80, 800, 618, 16);
            jLabel32.setText("Steps to calculate MeasuredSoftwareProcessLevl");
            getContentPane().add(jLabel32);
            jLabel32.setBounds(60, 830, 285, 16);
            jLabel33.setText("1 ) Follow the same steps as MetricsLevel calcualtion but select metrics and measures covered by CAME Tools only.");
            getContentPane().add(jLabel33);
            jLabel33.setBounds(90, 860, 657, 16);
            java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-1100)/2, (screenSize.height-940)/2, 1100, 940);
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            new framehelp().show();
        // Variables declaration - do not modify
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel10;
        private javax.swing.JLabel jLabel11;
        private javax.swing.JLabel jLabel12;
        private javax.swing.JLabel jLabel13;
        private javax.swing.JLabel jLabel14;
        private javax.swing.JLabel jLabel15;
        private javax.swing.JLabel jLabel16;
        private javax.swing.JLabel jLabel17;
        private javax.swing.JLabel jLabel18;
        private javax.swing.JLabel jLabel19;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel20;
        private javax.swing.JLabel jLabel21;
        private javax.swing.JLabel jLabel22;
        private javax.swing.JLabel jLabel23;
        private javax.swing.JLabel jLabel24;
        private javax.swing.JLabel jLabel25;
        private javax.swing.JLabel jLabel26;
        private javax.swing.JLabel jLabel27;
        private javax.swing.JLabel jLabel28;
        private javax.swing.JLabel jLabel29;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabel30;
        private javax.swing.JLabel jLabel31;
        private javax.swing.JLabel jLabel32;
        private javax.swing.JLabel jLabel33;
        private javax.swing.JLabel jLabel4;
        private javax.swing.JLabel jLabel5;
        private javax.swing.JLabel jLabel6;
        private javax.swing.JLabel jLabel7;
        private javax.swing.JLabel jLabel8;
        private javax.swing.JLabel jLabel9;
        // End of variables declaration
    }

    1. When you post code, post a minimal example. Did we have to scroll through
    all those bloody labels.
    2. Can't say much for the quality of code NetBeans generates.
    3. To answer your question (sorry, I don't have an autographed copy of the photo):
    import java.awt.*;
    import java.net.*;
    import javax.swing.*;
    public class Example {
        public static void main(String[] args) throws MalformedURLException {
            final JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            Container cp = f.getContentPane();
            cp.setBackground(new Color(0xff, 0xff, 0xee));
            cp.add(new JLabel("set the color on the content pane, not the frame"), BorderLayout.SOUTH);
            URL url = new URL("http://today.java.net/jag/bio/JagHeadshot-small.jpg");
            cp.add(new JLabel(new ImageIcon(url)));
            f.pack();
            SwingUtilities.invokeLater(new Runnable(){
                public void run() {
                    f.setLocationRelativeTo(null);
                    f.setVisible(true);
    }

  • Set Background color for JTextField

    Dear all,
    How can I set the background color of a JTextField? I have tried the method setBackground(Color). But seems not working.
    Thanks.

    Try this;
    text = new JTextField();
    your_color =  Color.red ;
    text.setBackground(your_color);

Maybe you are looking for

  • Issue in custom delegate control

    hi   am  creating a custom delegate control with controlid ="AdditionalPageHead" . i deployed and activated as a  site collection feature. but i am not sure how to see the activated control/  how to see this control in action. below is my code: using

  • Cant we open two .cp documents in one Captivate window ?

    Hi When I am working on a captivate document and, when I am trying to open a new document in  the same window, the current running document is getting closed and new document is getting opened. Why does that happens? Are they the default settings fro

  • DVD to Monitor

    How do I connect a DVD player to my VGA monitor? Thanks, -Ian B.

  • Where do i find driver software?

    I got a new laptop and I downloaded the new version of iTunes. When i try to plug in my ipod (30 GB video 5th gen.) it says it can't find the driver software. How do i get this?

  • Utl_file.write_error

    I am using utl_file package in my pl/sql procedure to write to a .csv file on the network. I have set my utL_file_dir in init.ora file. When I execute the procedure, I am getting a write_error exception. I have checked the permissions and I have full