Home » Developer & Programmer » Forms » Is there possible to find the next_item of block? (oracle 9i, forms6i)
Is there possible to find the next_item of block? [message #384489] Wed, 04 February 2009 01:42 Go to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

Hi,
We can find the first_item,last_item of the current block. The same way, can we find the next_item of current block?

please help me

kanish
Re: Is there possible to find the next_item of block? [message #384516 is a reply to message #384489] Wed, 04 February 2009 03:04 Go to previous messageGo to next message
Littlefoot
Messages: 20894
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
GET_BLOCK_PROPERTY built-in may return the first or the last item.

If you want the "next item", next to what, exactly? It can be "next" only to the current item. Information of the current item can be found by :SYSTEM.CURRENT_ITEM. NEXT_ITEM built-in will move you to the NEXT_ITEM, so - issue :SYSTEM.CURRENT_ITEM once again and you'll know it. Then return to the PREVIOUS_ITEM in order to remain at the same position you were in at the beginning.
Re: Is there possible to find the next_item of block? [message #384520 is a reply to message #384489] Wed, 04 February 2009 03:28 Go to previous messageGo to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

hi,

If i want to travel a block

 BlockA
         item1
         item2
         item3
         item4
    BlockB
         item5
         item6

   cur_blk := :System.Current_Block;
   f_item := Get_block_property(cur_blk,First_item);
   l_item := Get_block_property(cur_blk,Last_item);


By that code i can identify the BlockA first item is ITEM1
and Last Item is ITEM4. The same way i want to travel a Block to know item's name one by one.

Kanish


Re: Is there possible to find the next_item of block? [message #384530 is a reply to message #384489] Wed, 04 February 2009 04:04 Go to previous messageGo to next message
cookiemonster
Messages: 12404
Registered: September 2008
Location: Rainy Manchester
Senior Member
If you want the list of navigable items you should follow Littlefoots advice.
If you want the list of all items including display items - you can't. Oracle assumes that you know what items you have in your form.
Re: Is there possible to find the next_item of block? [message #384550 is a reply to message #384489] Wed, 04 February 2009 04:49 Go to previous messageGo to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

Tx littlefoot i got solution.

kanish
Re: Is there possible to find the next_item of block? [message #385331 is a reply to message #384550] Mon, 09 February 2009 02:40 Go to previous messageGo to next message
sasipalarivattom
Messages: 118
Registered: June 2007
Location: Cochin ( INDIA )
Senior Member

Hi all,

try this code,

DECLARE
  itm  VARCHAR2(100);
BEGIN
  itm := Get_block_property('Data block name in quotes',first_item);
  
  LOOP
    EXIT WHEN itm IS NULL;
    itm := blk||'.'||itm;
    Message('itm'||' is a '||Get_item_property(itm,item_type));
    itm := Get_item_property(itm,nextitem);
  END LOOP;
END; 



Regards,
Sasi.

[Updated on: Mon, 09 February 2009 02:42]

Report message to a moderator

Re: Is there possible to find the next_item of block? [message #385341 is a reply to message #384489] Mon, 09 February 2009 03:32 Go to previous message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

Nice presentation Sasi Tx.

kanish
Previous Topic: How to Set the form status.
Next Topic: Need to know how to move to Next Record and Previous Record
Goto Forum:
  


Current Time: Mon Dec 05 12:36:28 CST 2016

Total time taken to generate the page: 0.09304 seconds