This discussion is archived
6 Replies Latest reply: May 4, 2013 10:13 AM by teefu.orasoft RSS

background color

teefu.orasoft Newbie
Currently Being Moderated
dear member

can i have the display of background rows in tabular form with alternate rows of colours of grey and white combination, the one which is appearing on this forum questions.

i m using db 10g r2 and developer 10g.



thanks.
  • 1. Re: background color
    Andreas Weiden Guru
    Currently Being Moderated
    Yes. create two visual attributes one with a grey background and one with a white background. Then, cate a POSt-QUERY-trigger on your block and set the visual attributes for all items in your block using DISPLAY_ITEM or SET_ITEM_INSTANCE_PROPERTY depending on :SYSTEM.TRIGGER_ITEM being even or odd.
  • 2. Re: background color
    teefu.orasoft Newbie
    Currently Being Moderated
    dear friend

    i wrote at block level post-query

    DECLARE cur_itm VARCHAR2(80);
         i number:=1;
         val number;
         cur_block VARCHAR2(80) := :System.Cursor_Block;
    BEGIN cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
         WHILE ( cur_itm IS NOT NULL ) LOOP
              val:=mod(i,2);
              cur_itm := cur_block||'.'||cur_itm;
              if val=0 then
              Set_Item_Instance_Property( cur_itm, CURRENT_RECORD, VISUAL_ATTRIBUTE,'VATT_ROW_FOCUSED');
    cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
              else
              Set_Item_Instance_Property( cur_itm, CURRENT_RECORD, VISUAL_ATTRIBUTE,'VATT_ROW_FOCUS');
    cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
              end if;
              i:=i+1;
         END LOOP;
    END;


    it applies the visual attribute to adjacent columns. ok
    now how can i apply it not columns wise but row wise, i mean record wise.


    teefu.

    Edited by: teefu.orasoft on May 4, 2013 9:48 PM
  • 3. Re: background color
    Andreas Weiden Guru
    Currently Being Moderated
    Simply set your variable i once to :SYSTEM.TRIGGER_RECORD and leave the rest as is.
  • 4. Re: background color
    teefu.orasoft Newbie
    Currently Being Moderated
    dear Andreas

    since layout style is tablular, it gives me a look of chess board.
    it works but looks odd to me.
    plz correct the coding. so that the look feels like the one we are watching in this forum queries.

    DECLARE cur_itm VARCHAR2(80);
         i number:=:SYSTEM.TRIGGER_RECORD;
         val number;
         cur_block VARCHAR2(80) := :System.Cursor_Block;
    BEGIN cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
         WHILE ( cur_itm IS NOT NULL ) LOOP
              val:=mod(i,2);
              cur_itm := cur_block||'.'||cur_itm;
              if val=0 then
              Set_Item_Instance_Property( cur_itm, CURRENT_RECORD, VISUAL_ATTRIBUTE,'VATT_ROW_FOCUSED');
              cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
              else
              Set_Item_Instance_Property( cur_itm, CURRENT_RECORD, VISUAL_ATTRIBUTE,'VATT_ROW_FOCUS');
              cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
              end if;
              i:=i+1;
         END LOOP;
    END;


    teefu.

    Edited by: teefu.orasoft on May 4, 2013 9:56 PM

    Edited by: teefu.orasoft on May 4, 2013 10:07 PM
  • 5. Re: background color
    Andreas Weiden Guru
    Currently Being Moderated
    Remove the i:=i+1;
  • 6. Re: background color
    teefu.orasoft Newbie
    Currently Being Moderated
    thanks Mr. Andreas

    now the look and feel like the same, which is applying on this forum queries.
    moreover i have learnt how to apply a chess board look too. jokes apart.
    thanks once again.


    teefu.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points