Undo typing [message #178198] |
Tue, 20 June 2006 01:59 |
nirmalnarayan
Messages: 261 Registered: April 2005 Location: India
|
Senior Member |
|
|
I have a menu option Undo Typing
I have no idea how to implement the code for the same.
Anyone can please help.
Thanks
Nirmal
|
|
|
|
Re: Undo typing [message #178236 is a reply to message #178217] |
Tue, 20 June 2006 04:08 |
nirmalnarayan
Messages: 261 Registered: April 2005 Location: India
|
Senior Member |
|
|
The problem with CLEAR_ITEM is that it will clear anything in the current item. For eg., if there is already something present in the item, and the user types something in addition to it and clicks 'Undo Typing' , only the additionaly typed one should clear the old value should remain in the item.
But CLEAR_ITEM cannot distinct between the old value and new value and will clear out the whole thing.
Thanks and Regards,
Nirmal Narayanan.
|
|
|
|
|
Re: Undo typing [message #178397 is a reply to message #178246] |
Wed, 21 June 2006 00:47 |
nirmalnarayan
Messages: 261 Registered: April 2005 Location: India
|
Senior Member |
|
|
Your suggession is good one. The problem is i am having this 'Undo Typing' in a custom menu. To implement your idea, i need to code in every item of every form i am having.
There is any better way to do this in the menu item code itself?
Thanks
Nirmal
|
|
|
Re: Undo typing [message #178432 is a reply to message #178397] |
Wed, 21 June 2006 02:39 |
|
saadatahmad
Messages: 452 Registered: March 2005 Location: Germany/Paderborn
|
Senior Member |
|
|
You can use this code in your menu item as well. Instead of using this :
v_length := LENGTH(:EMP.ename);
v_value := :EMP.ename;
Use this:
v_length := LENGTH(:SYSTEM.trigger_item);
v_value := (:SYSTEM.trigger_item;
regards
[Updated on: Wed, 21 June 2006 02:41] Report message to a moderator
|
|
|
|
Re: Undo typing [message #178653 is a reply to message #178497] |
Thu, 22 June 2006 02:10 |
kbhujendra@rediffmail.com
Messages: 26 Registered: June 2006 Location: Hyderabad,India
|
Junior Member |
|
|
Hi,
Try This code,
PROCEDURE loop_first
IS
BEGIN
DECLARE
l_first_item VARCHAR2(100);
l_last_item VARCHAR2(100);
l_curr_item VARCHAR2(100);
l_curr_block VARCHAR2(100);
BEGIN
l_curr_block := :system.cursor_block;
l_first_item := l_curr_block || '.' || Get_block_property (:system.cursor_block,
first_item);
l_last_item := l_curr_block || '.' || Get_block_property(:system.cursor_block,
last_item);
Go_item(l_first_item);
l_curr_item := :system.cursor_item;
LOOP
IF l_curr_item <> l_last_item THEN
Copy(Get_item_property(l_curr_item,database_value)
,l_curr_item);
Go_item(Get_item_property(l_curr_item,
nextitem));
l_curr_item := :system.cursor_item;
END IF;
END LOOP;
Copy(Get_item_property(l_curr_item,database_value)
,l_curr_item);
l_curr_item := :system.cursor_item;
Set_record_property(:system.cursor_record,
l_curr_block,
status,
query_status);
Go_item(l_first_item);
END;
END;
Solve your problem,
waiting for feedback.
Thanks,
Bhujendra
|
|
|
Undo typing feature database and non-database blocks [message #178691 is a reply to message #178653] |
Thu, 22 June 2006 03:55 |
nirmalnarayan
Messages: 261 Registered: April 2005 Location: India
|
Senior Member |
|
|
Hi,
Thank you for your code, but it will work only once in a field or item.
The second time i type something in the same field and tries 'Undo Typing' it does'nt work. Also it will not work for non-database items. Intended functionality is for both database items and non-database items in a block.
So i modified your code code like the one below and is working as expected, for both database and non-database blocks
Declare
l_curr_item varchar2(100);
l_currval varchar2(100);
l_dbvalue varchar2(100);
Begin
/* get the cursor item */
l_curr_item := :system.cursor_item;
/* get the current cursor value */
l_currval := :system.cursor_value;
/* get the database value into l_dbvalue (applicable for both database and non-database items, non-database items will return the current value */
l_dbvalue := Get_item_Property(l_curr_item, database_value);
/* if both dbvalue and current value is identical it means the value is a non-database item value */
if l_dbvalue=l_currval then
/* set the old value into :global.oldval in the pre-text-item trigger of the non-database items in the form
copy this :global.oldval into current item */
copy(nvl(:global.oldval,''),l_curr_item);
end if;
/* Copy this value into back into the current item */
Copy(Get_item_Property(l_curr_item,database_value),l_curr_item);
End;
---------
Thanks
Nirmal
|
|
|
|
Re: Undo typing feature database and non-database blocks [message #178720 is a reply to message #178696] |
Thu, 22 June 2006 06:11 |
RJ.Zijlstra
Messages: 104 Registered: December 2005 Location: Netherlands - IJmuiden
|
Senior Member |
|
|
Please check out the following, it is shorter and is described in 'HELP'
----------------------------------------------------------------
win_api_shell.sendkeys(
hWnd => get_window_property( FORMS_MDI_WINDOW , WINDOW_HANDLE) ,
keys => '{Backspace}',
RaiseExceptions => TRUE
);
----------------------------------------------------------------
OR
----------------------------------------------------------------
win_api_shell.sendkeys(
hWnd => get_window_property( YOUR_WINDOW_NAME , WINDOW_HANDLE) ,
keys => '{Backspace}',
RaiseExceptions => TRUE
);
----------------------------------------------------------------
HTH,
Regards,
Rob Zijlstra
|
|
|
|
Re: Undo typing feature database and non-database blocks [message #178756 is a reply to message #178731] |
Thu, 22 June 2006 08:26 |
RJ.Zijlstra
Messages: 104 Registered: December 2005 Location: Netherlands - IJmuiden
|
Senior Member |
|
|
Hai,
As far as I know you CANNOT use it in Forms 10G:
http://www.oracle.com/technology/products/forms/htdocs/forms904faq.html
<snip>
2.9 Can I use the functions in the D2KWUTIL library when Forms is running on NT?
No. We don't support the use of D2KWUTIL in the middle tier. Many of the functions in the library require access to Window Handles, which will not work in the Web deployment scenario. While some functions, such as WIN_API_ENVIRONMENT.GET_COMPUTER_NAME(), do work, they return information about the application server machine, not the client. Some functions, such as the bitwise operations, continue to function without a problem.
However, Oracle have a provided a utility called WebUtil which will give you parity with the functionality of D2KWUTIL, and more! For more information on WebUtil, including a WebUtil FAQ, visit the WebUtil area on OTN.
<end snip>
But maybe the WEBUTIL FAQ can help you.
HTH, regards
Rob Zijlstra
|
|
|