5 Replies Latest reply: May 1, 2013 2:32 AM by ck RSS

    conditional display of text or image

    ebenwalker
      Forms 6g

      trying to make the display on a form of an image or text conditional on the contents of a field or a calculation....

      very easy in a report but I don't see how to do on a form

      thanks
        • 1. Re: conditional display of text or image
          tony.g
          Use set_item_property() to change the enabled/displayable property of the item


          Tony
          • 2. Re: conditional display of text or image
            ebenwalker
            I have set up a button with the following code on the WHEN-BUTTON-PRESSED trigger

            DECLARE
                 ITEM_ID ITEM := FIND_ITEM('TEXT425'); -- THIS IS A TEXT ITEM ON THE CANVAS
            BEGIN
            set_item_property(ITEM_ID, DISPLAYED, PROPERTY_FALSE );
            END;

            Something is wrong with the FIND_ITEM. It compiles but at run time BUT fails on 'CANNOT FIND ITEM'.
            • 3. Re: conditional display of text or image
              Andreas Weiden
              If TEXT425 is a graphical object like a boilerplate-text you have no chance. You cannot access them at runtime. You might consider using a real display-item instead.
              • 4. Re: conditional display of text or image
                G.Y
                Hi
                I have set up a button with the following code on the WHEN-BUTTON-PRESSED trigger

                DECLARE
                     ITEM_ID ITEM := FIND_ITEM('TEXT425'); -- THIS IS A TEXT ITEM ON THE CANVAS
                BEGIN
                set_item_property(ITEM_ID, DISPLAYED, PROPERTY_FALSE );
                END;
                Please try this
                DECLARE
                ITEM_ID ITEM := FIND_ITEM('mention ur block.your item');  -- THIS IS A TEXT ITEM ON THE CANVAS
                BEGIN
                go_block('in which block your item is');
                
                set_item_property(ITEM_ID,  DISPLAYED,  PROPERTY_FALSE );
                --then move your cursor to some another item which should be navigable and visible and canvas =yes
                go_item('block name.item_name');
                END;
                thanks
                • 5. Re: conditional display of text or image
                  ck
                  you can use the same function like in your report.

                  create text_item as image ;


                  Put this in your POST-QUERY trigger; Be sure that you have patch 19 or higher please refer to Oracle Support.
                  begin
                  if then
                    read_image_file('c:\photo\no_photo.jpg', 'ANY', 'BCTRL.ITM_IMAGE');
                  elsif then
                    ---
                  end if;

                  end;