Change background color in enter-query mode

Hi everyone,
I am trying to Change background color in enter-query mode in forms10g. I am using this
Set_Item_property('org.branch_code', BACKGROUND_COLOR, 'Green' );
Thanks

This is the code that allows to colorise items in enter_query mode, then de-colorize them after execute_query.
Assume that you have created a VA_QUERY visual atribute in your module.
-- Colorise in enter-query mode --
PROCEDURE Start_query IS
  LC$Block      Varchar2(30) := Name_in('system.trigger_block') ;
  LC$item       varchar2(60);
  LC$itemdeb    varchar2(60);
  LN$len        pls_integer ;
BEGIN
  lc$itemdeb := get_block_property(LC$BLOCK, FIRST_ITEM) ;
  lc$item := LC$BLOCK || '.' || lc$itemdeb ;
  while lc$itemdeb is not null Loop
    IF GET_ITEM_PROPERTY(LC$Item , ITEM_TYPE) NOT IN ('BUTTON','RADIO GROUP','DISPLAY ITEM') Then
      IF GET_ITEM_PROPERTY(LC$Item , QUERYABLE ) = 'TRUE' Then
        set_item_property(LC$item, CURRENT_RECORD_ATTRIBUTE, 'VA_QUERY');
      End if ;
    End if ;
    lc$itemdeb := get_item_property( lc$item, NEXT_NAVIGATION_ITEM );
    lc$item := LC$BLOCK || '.' || lc$itemdeb ;
  end loop ;
END;
-- Unclororize after execute_query --
PROCEDURE End_query IS
  LC$Block     Varchar2(30) := Name_in('system.trigger_block') ;
  LC$item     varchar2(60);
  LC$itemdeb     varchar2(60);
  LN$len          pls_integer ;
  LN$Multi  pls_integer ;
BEGIN
  lc$itemdeb := get_block_property(LC$BLOCK, FIRST_ITEM) ;
  lc$item := LC$BLOCK || '.' || lc$itemdeb ;
  LN$Multi := GET_BLOCK_PROPERTY(LC$Block , RECORDS_DISPLAYED ) ;
  while lc$itemdeb is not null Loop
    IF GET_ITEM_PROPERTY(LC$Item , ITEM_TYPE) NOT IN ('BUTTON','RADIO GROUP','DISPLAY ITEM') Then
      IF GET_ITEM_PROPERTY(LC$Item , QUERYABLE ) = 'TRUE' Then
         If LN$Multi > 1 Then
            set_item_property(LC$item, CURRENT_RECORD_ATTRIBUTE, 'VA_CURRENT_RECORD');
         Else
            set_item_property(LC$item, CURRENT_RECORD_ATTRIBUTE, '');
         End if ;
      End if ;
    End if ;
    lc$itemdeb := get_item_property( lc$item, NEXT_NAVIGATION_ITEM );
    lc$item := LC$BLOCK || '.' || lc$itemdeb ;
  end loop ;
END;Francois

Similar Messages

  • Changing visual attribute in Enter Query mode

    Hello, I want to change visual attribute of all items in the first record when the user presses button for Enter_Query. I want that the user sees that the form is in enter query mode and it "waits" for the input of criteria. My code (copied from Help and modified) in trigger WHEN_BUTTON_PRESSED:
    DECLARE
    cur_itm VARCHAR2(80);
    cur_block VARCHAR2(80);
    BEGIN
    ENTER_QUERY;
    cur_block := :System.Cursor_Block;
    cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
    WHILE ( cur_itm IS NOT NULL ) LOOP
    cur_itm := cur_block||'.'||cur_itm;
    Set_Item_Instance_Property( cur_itm, CURRENT_RECORD, VISUAL_ATTRIBUTE,'yellow');
    cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
    END LOOP;
    END;
    where yellow is the name of my visual attribute.
    The problem is that I need to press the button TWICE to color the record.
    Can anybody help me with this problem?
    Natasa

    (Wrong forum).
    The problem is that enter_query stops executing your procedure until
    another action ist started by the user.
    You must create a short-time timer before issuing enter_query and set
    your colour scheme in the when-timer-expired-trigger.

  • Change background color during text edit mode

    THis is a wacky problem...
    I have a presentation template. The slide master has white copy in the title and black copy in the body/bulleted list.
    When I try to use the template and edit the title copy, the background color for editing that line is white, just like the text, so I can't see what I'm typing. I can't figure out how to change the background color during text edit mode so that I can actually see what I'm typing. Is there a way to make this transparent?
    For some reason, the body copy edit works fine: black text edited in either a white or transparent background color.
    help!

    THis is a wacky problem...
    I have a presentation template. The slide master has white copy in the title and black copy in the body/bulleted list.
    When I try to use the template and edit the title copy, the background color for editing that line is white, just like the text, so I can't see what I'm typing. I can't figure out how to change the background color during text edit mode so that I can actually see what I'm typing. Is there a way to make this transparent?
    For some reason, the body copy edit works fine: black text edited in either a white or transparent background color.
    help!

  • Pages 5 can't change background color in fullscreen

    There's no option to change background color when in fullscreen mode anymore.
    Did I miss something or did apple just...get rid of it?????why???

    Hi, Mark,
    Under the Format menu select Advanced and the click on Make Master Objects Selectable. Now click on the red area. You'll notice little faint x's at the corners. In the Arrange menu click on Unlock. Now you can edit the color. (In this case a gradient.) When you finish, go back and Lock it again and deselect Make Master Object Selectable.
    Walt

  • Change Value of Veriables in Enter-Query mode

    hi all
    I have made a search utility on a table, there is reqirement that in the enter-query mode the user can enter any combination of character, in simple words there is requirement of %% at begining and at end of desired search field.
    as :system.last_query gives the value like
    SELECT ROWID,SEQ_NUM,TAG
    FROM sequel1.sequelsql WHERE ( UPPER(TAG) LIKE :1 and (TAG LIKE :2 or TAG LIKE :3)) order by TAG
    how to pad % sign in the veriables :1,:2 and :3 as need to search
    tag like ('%ASSESSMENT%')
    thanks in advance

    SELECT ROWID,SEQ_NUM,TAG
    FROM sequel1.sequelsql WHERE ( UPPER(TAG) LIKE :1 and (TAG LIKE :2 or TAG LIKE :3)) order by TAG
    1.
    have you tried to handle the items contents in a PRE-QUERY trigger ?
    If blk.item IS NOT NULL Then
       :blk.item := '%' || :blk.item || '%' ;
    End if ;2.
    You could change the WHERE clause (or the ONETIME_WHERE)
    in your KEY-EXEQRY trigger:
    Declare
       req   Varchar2(512) ;
    Begin
      req := '( UPPER(TAG) LIKE %' || :blk.item1 ||
    '% and (TAG LIKE %' || :blk.item1 || '% or TAG LIKE %' || :blk.item3 ||'%)) order by TAG ;
      Set_Block_Property( 'blk', DEFAULT_WHERE, req ) ;
      Execute_Query ;
    End ;Francois

  • Enter query - what was changed (entered) in enter query mode

    Hello,
    I need to know what criteria (values and items) an user entered (typed) when my form is in enter query mode.
    Thanks

    You can read about Pre-Query trigger in the Forms on-line help:
    About controlling queries with Pre-Query and Post-Query triggers
    The Pre-Query and Post-Query triggers allow control over query processing. They can be defined at the form or block level. Most often, attach them to specific blocks to control the query functionality of those blocks.
    The Pre-Query trigger fires just before Form Builder issues the SELECT statement to the database, after the operator has defined the example record by entering query criteria in Enter Query mode.
    Inside a Pre-Query trigger, the example record defined by the query criteria is the current record. This means that trigger code can read and set the values of items in the example record using standard :block_name.item_name syntax.
    A Pre-Query trigger can be used to disallow query conditions that might be invalid. When a form is in Enter Query mode, normal validation is suspended and no validation triggers fire as they do in Normal mode. The Pre-Query trigger thus allows you to verify that any values entered by the operator are valid query conditions.
    When invalid query conditions have been entered, you can abort the query by raising the FORM_TRIGGER_FAILURE built-in exception in the Pre-Query trigger.
    You can also call SET_BLOCK_PROPERTY to modify the block's WHERE and ORDER BY clauses from within the Pre-Query trigger, to further restrict or order the records the query will retrieve.
    I hope this will help you.
    Helena

  • [Solved] Problem with LOV and 'enter query' mode

    Hi all,
    I'm kind of new to Forms and I'm having some problems that I'm not being able to resolve. I already search it on the net, but nothing relevant came up. If anyone could help me I appreciated it.
    In my form I have some fields, and in one of them I have a LOV, and almost everything works fine. I inserted data, changed it, deleted it and all it's ok.
    But when I change to 'enter query' mode, when I try to search for data on the LOV field it ignores what I write.
    That is, for it, it's the same if I make F11 -> write 'aaaa' -> ctrl + F11 or if I make F11 -> '%' -> ctrl + F11.
    It behaves the same way, shows me all the records.
    Probably I'm missing something basic, but I'm not getting it...
    Thanks,
    Ana

    when you create a lov by wizard the lov and record group have always the same name..
    the problem is that the item is NOT based in the tabe.
    what kind of query do you execute if you choose something from a love which is not based on the db?
    i mean, this item has no influence on the query of the table, so whatever you choose it's like a "select * from table"
    i hope i was clear

  • Change background color of textbox based on non-visible value

    Hello,
    I have a 10g master - detail form. I was wondering how can I change background color of text box (NAME) based on non-visivle item (MODIFIED_BY) value.
    So far, I have created two visual attributes and have put following code on "WHEN_NEW_BLOCK_INSTANCE" trigger
    if( :main.MODIFIED_BY = 'COCO') then
         SET_ITEM_PROPERTY('main.NAME',VISUAL_ATTRIBUTE,'VA_BLUE');
    else
         SET_ITEM_PROPERTY('main.NAME',VISUAL_ATTRIBUTE,'VA_RED');
    end if;
         But, it always goes to "ELSE" part and make RED color for all records. Could you please help me with this?
    Thanks.

    Got it.
    Post Query trigger on block
         if (:main.MODIFIED_BY ='COCO') then
              set_item_instance_property('main.NAME',current_record,visual_attribute,'VA_BLUE');
         else
              set_item_instance_property('main.NAME',current_record,visual_attribute,'VA_RED');
         end if;Thanks

  • FRM-40200 and FRM-40501 in Enter-Query-Mode

    Some strange behaviour in Enter-Query-Mode:
    Although the help states
    About Designing Forms for Querying+
    +.. To make a "query-only" block, set Query Allowed to Yes and Delete Allowed, Insert Allowed, and Update Allowed to No. ..+
    I get FRM-40200: Field is protected against update.
    System.Mode says, we are currently in ENTER-QUERY.
    Setting insert- and update-allowed to TRUE, I get
    FRM-40501: ORACLE error: unable to reserve record for update or delete.
    The entered character flashes and is erased immediately.
    Any ideas?
    Forms 10gR2
    Items are base table, all transactional properties aund query_allowed are true, query_length is ok.
    2 Things that happen before the initiation of the enter-query-mode:
    . data-source is changed to another view; column names are ok.
    . all block-items are disabled and not navigable at start-up of form and re-enabled and made navigable before entering the block.
    The values of block and item-properties mentioned above are take at WHEN-NEW-ITEM-INSTANCE and no further trigger fire.

    I think you are not meaning just the KEY-ENTQRY-Trigger, that to easy
    IF INSTR(:SYSTEM.TRIGGER_BLOCK, '_DETAIL') = 0
    +               AND :SYSTEM.TRIGGER_BLOCK NOT IN ('VZG_KOPF','KONTROLL','BUTTONS','TEMP')+
    THEN
    +     ENTER_QUERY;+
    END IF;
    .. but the rest is a lil bit, let's call it bulky; including pll and db-packageges.
    I hoped to get a clue, if somebody has a similar expeience, in what direction to search. It's strange.
    And, as I noticed today, it's not a problem of all forms of the app. Not even of all the forms called from the same "environment" (same globals, same menu-form from which they are opened). To me it looks like Enter-Query does not work in the forms where I switch the block-data-source from a view to a globally temporary table. That (this switching) is not a new feature and Enter-Query worked in the past. Althoug we had some changes in the temp tables in the last weeks there are no problems in querying the data in the forms. Recompilation of pll and fmb, no improvement. And either Enter-Query woks in a form or it does not.

  • [ Forms10g2 ] Default item value in Enter-Query mode

    Hello!
    How could I specify default value for an item in Enter-Query mode? E.g. I press KEY-ENTQRY, and :L_YEAR item gots current year as a default search condition (though it may change). I've tried to implement it this way:
    <pre>
    Enter-Query;
    :l_year := extract(year from sysdate);
    </pre>
    This work in a rather awkward way. If I run this once (e.g. as a result of a hotkey press), it just enters Enter-Query mode, but if I run this twice (by pressing hotkey second time) it fills :year variable and does search with it as a search condition! Then, I've tried to go straight and wrote:
    <pre>
    Enter-Query;
    :l_year := extract(year from sysdate);
    Enter-Query;
    :l_year := extract(year from sysdate);
    </pre>
    Well, this didn't work. And SYNCRONIZE call before the second Enter-Query didn't help either. So, my questions are: 1) how can I achieve needed behaviour? 2) What's going on in my experiments? Why :L_YEAR gets assigned on second keypress (as in first experiment) but not on second subsequent call (as in second experiment)?
    Thanks in advance!

    I don't know why that won't work but I have something which might:
    when-new-record-instance trigger:
    if :system.mode = 'ENTER-QUERY' then
      :l_year := extract(year from sysdate);
    end if;It's always best to use both the block and item names...:block.l_year

  • EXIT_FORM in enter query mode

    Hi Guys,
    I have a button on my form to exit the form code is:
    EXIT_FORM(No_Validate);
    when my form is in enter query mode the button does not work. i have to cancel the query first and then the button works.
    How can i change my mode to exit form even if it is in enter query mode.
    Please help its urgent.
    thanks , Imran Baig

    HI Imran,
    That is quite normal. If you press CTRL/Q, it executes an implicite Key-EXIT trigger. If you are in Enter Query mode, this will close the query and does nothing else. When you execute it again, you leave the from without validation.
    My suggestion were: Place the exit_form(no_validate) twice in your trigger--the second would be absolute harmless, since the form will no longer be active, provided you came from Normal Mode. Otherwies, it will force leaving the form by first closing the query and then leaving.
    Regards, Miklos Herboly.

  • LOV button in enter query mode

    Hi
    How do I show LOV button(Forms 9.0.2) in enter query mode?As of now LOV button is displayed only in the create mode.
    Binod.

    Hi Andrew,
    Thanx for the reply. Actually I have not associated any trigger for this. Here Im refering the LOV button which comes inside the respective field(I mean we change the property lov_button to 'true in the regitry.dat). This button is not getting displayed in the enter query mode.
    I hope now you are clear with the query.
    Binod.

  • Calendar in Enter-Query Mode

    Dear All ,
    i hv posted my problems before.
    My. Calendar does not work in Enter-Query Mode.
    It says 'Function Key Not Allowed' It's Because of the Code(Go_Block) in Get Date procedure in the date package.
    Any Suggestion on this will be highly appreciated.

    You will have to change the calendar code to reside in a separate Form and use CALL_FORM to pop it up. This will be valid in Enter-Query mode - You'll then pass the selection back in a Global variable.

  • Non-Database items in enter-query mode

    I have a form with 2 base table blocks, typical master details situation. I wish to allow a field from the detail block to be queryable from the master block. I was considering adding a non-database item to the master block (visible only when in Enter-Query mode). In a pre-query trigger I would amend the DEFAULT-WHERE property of the master block when the appropriate where clause using the non-database item value. My prototype/test version works fine except the non-database item is not enabled while the master block is in enter-query mode.
    I think basically forms will enable only field s if they are database items and queryable set to yes. There are no more database items I can use to set the non-database item column name property.
    Any suggestions would be appreciated.
    Ralph
    Oracle Developer - Unisys Australia

    Hi Ralph,
    we have several Forms using non-database items as query-items which works fine.
    What we did is following:
    1) create non-database item xy in master-data-block
    2) set property database item to no
    3) set property query allowed to yes
    4) create a pre-query trigger on master-data-block where we change the where-clause (this is forms6i, in 9i we would use the one-time-where-clause)
    Peter

  • How to Cancel The ‘Enter Query ’ mode?

    Please help me to Cancel the �Enter Query� mode.

    Have a look at the Exit_Form Built In help.
    Description
    Provides a means to exit a form, confirming commits and specifying rollback action.
    n     In most contexts, EXIT_FORM navigates �outside� the form. If there are changes in the current form that have not been posted or committed, Form Builder prompts the operator to commit before continuing EXIT_FORM processing.
    n     If the operator is in Enter Query mode, EXIT_FORM navigates out of Enter Query mode, not out of the form.
    n     During a CALL_INPUT, EXIT_FORM terminates the CALL_INPUT function.
    Syntax
    PROCEDURE EXIT_FORM;
    PROCEDURE EXIT_FORM
    (commit_mode NUMBER);
    PROCEDURE EXIT_FORM
    (commit_mode NUMBER,
    rollback_mode NUMBER);
    Built-in Type restricted procedure
    Enter Query Mode yes
    -- Shailender Mehta --

Maybe you are looking for