why Initial Value cleared by Clear_form(no_calidate); [message #156070] |
Fri, 20 January 2006 11:00 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
dude4084
Messages: 222 Registered: March 2005 Location: Mux
|
Senior Member |
|
|
Hi
I am stuck in following problem.
I have two forms. In one form I have set Initial value of an item to ZERO (o) as per requirement of my project. Now when i press add button on the form, i clear the form by using command clear_form(no_validate). This whole process works perfectly.
Now, in other form, the same method is not working fine. The initial value becomes NULL after the execution of the clear_form(no_validate) command. Which is against my requirement.
In order to resolve the problem, i have Copied the PERFECTLY working item from form no 1 to form no 2 And then adjusted it by changing its column name etc.
even then it didn't work.
Please help me by guiding me that where could be the discrepancy.
|
|
|
|
Re: why Initial Value cleared by Clear_form(no_calidate); [message #156321 is a reply to message #156070] |
Tue, 24 January 2006 12:49 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
dude4084
Messages: 222 Registered: March 2005 Location: Mux
|
Senior Member |
|
|
Thank u for ur reply
Somehow or the other, i have fixed the problem. I shifted the place of clear_form command and placed it after a procedure call. This procedure was used to change properties (navigable and updateable) of itemspresent on data block.
But at the same time could not figure out the reason of the problem.
It seems to me that
1) Clear_form() acts differnetly if ur control is not in the data block.
2) Similalry, i have change the properties of items in data block through a called procedure. The properties include navigable & updateable. This might be also causing the weired behavior.
Still could not learn from the solution of the problem but at least i am step ahead now in my project.
Some expert may explain the above situation.
|
|
|
|
Re: why Initial Value cleared by Clear_form(no_calidate); [message #156610 is a reply to message #156070] |
Thu, 26 January 2006 05:10 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
dude4084
Messages: 222 Registered: March 2005 Location: Mux
|
Senior Member |
|
|
Hi
I am presenting the the table structre and triggers where beleongs to my problem.
Table involved:
create table prod
(pcode number(3) primary key,
pname varchar2(30),
pack number(2),
ltr number(5,2),
cltr number(5,2),
lesstype varchar2(1),
drate number(7,2),
catID number(2) CONSTRAINT fk_PROD_CAt_catid REFERENCES CAT(catid),
ost number(3),
op number(7,2),
reqty number(3)
);
On Form when i Push ADD Button in order to add a new record in above table through form, then following
THREE things happen
Step-1) Following COde exeucted in when_button_pressed trigger
set_block_property('BLOCK1', insert_allowed, property_true);
clear_form(no_validate);
add_push;
:global.search_value:= NULL;
Select NVL(max(pcode),0)+1
into :block1.pcode
from prod;
go_item('BLOCK1.PCODE');
Step-2) The call to add_push procedure executed the following procedure
add_push
========
PROCEDURE ADD_PUSH IS
BEGIN
Myitem_ENABLE_DISABLE ('BLOCK1', property_true);
set_item_property('bnADD', enabled, property_false);
set_item_property('bnEDIT', enabled, property_false);
set_item_property('bnDEL', enabled, property_false);
set_item_property('bnSAVE', enabled, property_false);
set_item_property('bnCAN', enabled, property_true);
SET_item_property('bnCAN', navigable, property_true);
Step-3) The call to Myitem_ENABLE_DISABLE ('BLOCK1', property_true) executes the following procedure
PROCEDURE Myitem_ENABLE_DISABLE
===============================
PROCEDURE Myitem_ENABLE_DISABLE (blk_name IN char, item_on_off IN Number) IS
NXT_ITEMNAME VARCHAR2(70);
A VARCHAR2(70);
BEGIN
Go_block('Control');
go_item('BNEXIT');
NXT_ITEMNAME := blk_name||'.'||get_block_property(blk_name, first_item);
A:= NXT_ITEMNAME ;
loop
IF get_item_property(nxt_itemname, item_canvas) is not null AND
get_item_property(nxt_itemname, item_type)<> 'DISPLAY ITEM' then
set_item_property(nxt_itemname, ENABLED, item_on_off);
set_item_property(nxt_itemname, updateable, item_on_off);
set_item_property(nxt_itemname, navigable, item_on_off);
end if;
NXT_ITEMNAME := blk_name||'.'||get_item_property(NXT_ITEMNAME, next_navigation_item);
if (NXT_ITEMNAME= blk_name||'.ROWID') then
exit;
end if;
end loop;
END;
==============================
==============================
SO basically i aceived my objective by shifting clear_form(no_validate); after add_push; in step-1 i.e.
add_push;
clear_form(no_validate);
I hope that now you will be able to come some conclusion.
|
|
|
Re: why Initial Value cleared by Clear_form(no_calidate); [message #327561 is a reply to message #156070] |
Mon, 16 June 2008 22:36 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
white_phoenix
Messages: 19 Registered: November 2007
|
Junior Member |
|
|
Hi,
I have another issue regarding clear_form.
After I pressed a button, when the system.mode = 'NORMAL', it should do clear_form. However not all fields in the form will be cleared.
Fields that are not clear are non-database item.
Any help??
IF :System.Mode <> 'NORMAL' THEN
EXIT_FORM;
ELSE
CLEAR_FORM(NO_VALIDATE);
END IF;
I already debug the form, it's currently system.mode = 'NORMAL'
|
|
|
|
|
|