Home » Developer & Programmer » Forms » go_item dynamic
go_item dynamic [message #622265] Sat, 23 August 2014 23:38 Go to next message
hahaie
Messages: 194
Registered: May 2014
Senior Member
hello,
my procedure is:
PROCEDURE GO_NEXT_ITEM_PRC (NUM NUMBER)IS
BEGIN
    GO_ITEM('CONTROL_SEARCH_STKS.ITEM_CH_'||NUM+1);
END;

and call procedure:
GO_NEXT_ITEM_PRC(2);

DESCRIPTION:
name of items on CONTROL_SEARCH_STKS(BLOCK)is:ITEM_CH_1,ITEM_CH_2,ITEM_CH_3,ITEM_CH_4,...
but procedure have a error,why?What is the solution?
Re: go_item dynamic [message #622266 is a reply to message #622265] Sun, 24 August 2014 00:12 Go to previous messageGo to next message
hahaie
Messages: 194
Registered: May 2014
Senior Member
solution:
GO_ITEM(GET_ITEM_PROPERTY('CONTROL_SEARCH_STKS.ITEM_CH_'||TO_CHAR(NUM+1),ITEM_NAME));

Re: go_item dynamic [message #622355 is a reply to message #622266] Mon, 25 August 2014 11:58 Go to previous message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
I'm really not sure I understand why you would need to write your own navigation procedure. The NEXT_ITEM(); built-in should be sufficient. In fact, based on the hierachical nature of Oracle Forms - the only time I've needed to over-ride the NEXT_ITEM functionality is when I have items in a canvas that are from different datablocks. When this occurs, you can simply code a Key-Next-Item to force navigation to the item you want.

With respects to your question, what is the compilation error? Without the error number/message - all we can do is guess why your procedure won't compile. Here is my best guess...the error is because the GO_ITEM() built-in can't process the concatenation of the next_item name. I suggest you store the full name of the Item in a variable and then use the variable in your GO_ITEM call rather than use a concatenation of the item name in the call. EG:
PROCEDURE GO_NEXT_ITEM_PRC (NUM NUMBER)IS
  v_next_item  VARCHAR2(65);
BEGIN
    v_next_item := 'CONTROL_SEARCH_STKS.ITEM_CH_'||NUM+1;
    GO_ITEM(v_next_item);
END;


Again, this is just a WAG - we need the compile error number/message!

Quote:
DESCRIPTION:
name of items on CONTROL_SEARCH_STKS(BLOCK)is:ITEM_CH_1,ITEM_CH_2,ITEM_CH_3,ITEM_CH_4,...

If your items are sequential and follow each other in the correct order in the Object Navigator, then just use the NEXT_ITEM() built-in.

Craig...
Previous Topic: problem in KEY-ENTER
Next Topic: Is this is a bug of Oracle?!!!
Goto Forum:
  


Current Time: Thu Mar 28 10:58:26 CDT 2024