Home » Developer & Programmer » Forms » Copy/Paste by Trigger  () 1 Vote
Copy/Paste by Trigger [message #181606] Mon, 10 July 2006 15:51 Go to next message
itroome
Messages: 34
Registered: June 2005
Location: DUBAI, UAE
Member

Salam

I hope all the guroes are gappy and enjoying the knowledge.

I have one problem that need yours help

Problem:

1-I have a Formula Text Box.
2-Digits are available on Button Click
3-Operator are available on Buton press
4-List of Operand are available.
5-I want to make Formula with the combination of Operater , degits and Operand.
6-I want to do duble click on Operand and that should be paste , where the Keyboard cursor position exists in Formula Text Item.

Note:
I have used the Copy_Region, Paste_Region, but Copy Region always paste the the left conror of the text item.


Kindly slove my problem as soon as posible.

From
itroome@yahoo.com
Muhammad Aurangzaib

Re: Copy/Paste by Trigger [message #182371 is a reply to message #181606] Fri, 14 July 2006 08:29 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Don't paste into the visible item directly. Paste into an empty non-visible field and then concatenate that item to the visible item.

David
Re: Copy/Paste by Trigger [message #183666 is a reply to message #182371] Fri, 21 July 2006 17:19 Go to previous messageGo to next message
itroome
Messages: 34
Registered: June 2005
Location: DUBAI, UAE
Member

Salam

Thank for your answer,

but the problem is that how I get the Keyboard Cursor Position Character in the text item e.g. "abcdef" and my Keyboard Cursor Postion in the text box is on "c" character, now how concatenate as abc[concatenate]def in the text item by the "When-Mouse-DoubleClick" Trigger..
Re: Copy/Paste by Trigger [message #184560 is a reply to message #183666] Thu, 27 July 2006 01:21 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
If you have 'Keep Cursor Position' set to 'TRUE' for this field, pressing a button which navigates to another field (go_item), does a Copy_Region then does a go_item back to your original field, and finally does a Paste_Region, should place the copied data at the place where you had your cursor.

Please post the code associated with your button.

David

[Updated on: Thu, 27 July 2006 01:22]

Report message to a moderator

Re: Copy/Paste by Trigger [message #185060 is a reply to message #184560] Sun, 30 July 2006 16:08 Go to previous messageGo to next message
itroome
Messages: 34
Registered: June 2005
Location: DUBAI, UAE
Member

Salam
Great , Execellant, This is working...

Thanks a lot
Re: Copy/Paste by Trigger [message #193093 is a reply to message #185060] Thu, 14 September 2006 21:15 Go to previous messageGo to next message
raizen_underground
Messages: 28
Registered: September 2006
Location: Manila, Phillipines
Junior Member
Salam....

You solved your problem....can you u pls post your codings of how to paste a tabular records into a tabular block....please I need an imediate answer....tnx in advance....

raizen.......

[Updated on: Thu, 14 September 2006 23:24] by Moderator

Report message to a moderator

Re: Copy/Paste by Trigger [message #193868 is a reply to message #193093] Tue, 19 September 2006 14:29 Go to previous message
itroome
Messages: 34
Registered: June 2005
Location: DUBAI, UAE
Member

Salam

Here is example of Copy and Paste for the Mutiple Records


Copy


DECLARE
RecCopyGrpName varchar2(30) := 'CopyWAWERecGroup' ; --Record group name
RecCopyGrpId RecordGroup ; --Record Group Id.
GrpCopyColId GroupColumn ; --Group column id.
RowCounter number := 1 ;

C_Block Varchar2(100);
C_Record Number;
C_Item Varchar2(100);
BEGIN
if get_block_property('HrmPmsWaPayDef', update_allowed) = 'TRUE' then
----------
C_Block:= :System.Cursor_Block;
C_Record:=:System.Cursor_Record;
C_item:= :System.Cursor_Item;
RecCopyGrpId := find_group(RecCopyGrpName) ;
--
--If a record group with this name dosn't exist then create record.
--
if not id_null(RecCopyGrpId) then
delete_group('CopyWAWERecGroup') ;
end if ; --if not id_null(RecGrpId) then
--
RecCopyGrpId := create_group(RecCopyGrpName,global_scope) ;
GrpCopyColId := add_group_column(RecCopyGrpId,'WAWENO',CHAR_COLUMN,10) ; --DB
GrpCopyColId := add_group_column(RecCopyGrpId,'PWAGEELEMENT',NUMBER_COLUMN,10) ; --DB
GrpCopyColId := add_group_column(RecCopyGrpId,'WEID',CHAR_COLUMN,30) ; --Query
GrpCopyColId := add_group_column(RecCopyGrpId,'WENAME',CHAR_COLUMN,30) ; --Query
GrpCopyColId := add_group_column(RecCopyGrpId,'WEDESCR',CHAR_COLUMN,200) ; --Query
GrpCopyColId := add_group_column(RecCopyGrpId,'WETYPE',CHAR_COLUMN,30) ; --Query
GrpCopyColId := add_group_column(RecCopyGrpId,'VALMETHOD',CHAR_COLUMN,30) ; --Query
GrpCopyColId := add_group_column(RecCopyGrpId,'USERINPUT',NUMBER_COLUMN,30) ; --DB
GrpCopyColId := add_group_column(RecCopyGrpId,'PRFORMULA',NUMBER_COLUMN) ; --DB
GrpCopyColId := add_group_column(RecCopyGrpId,'OPFORMULA',CHAR_COLUMN,4000) ; --Query
GrpCopyColId := add_group_column(RecCopyGrpId,'WELEVEL',CHAR_COLUMN,1) ; --DB
GrpCopyColId := add_group_column(RecCopyGrpId,'STATUS',CHAR_COLUMN,1) ; --DB
--
go_block('HRMPMSWAWE') ;
first_record ;
--
loop
-- message('HrmOpsResponsibilities:'||:HrmOpsResponsibilities.selection) ;pause ;
Add_Group_Row(RecCopyGrpId,RowCounter) ;

Set_Group_Char_cell('CopyWAWERecGroup.WAWENO',RowCounter,:HrmPmsWAWE.WAWENO) ;
Set_Group_Number_cell('CopyWAWERecGroup.PWAGEELEMENT',RowCounter,:HrmPmsWAWE.PWAGEELEMENT) ;
Set_Group_Char_cell('CopyWAWERecGroup.WEID',RowCounter,:HrmPmsWAWE.WEID) ;
Set_Group_Char_cell('CopyWAWERecGroup.WENAME',RowCounter,:HrmPmsWAWE.WENAME) ;
Set_Group_Char_cell('CopyWAWERecGroup.WEDESCR',RowCounter,:HrmPmsWAWE.WEDESCR) ;
Set_Group_Char_cell('CopyWAWERecGroup.WETYPE',RowCounter,:HrmPmsWAWE.WETYPE) ;
Set_Group_Char_cell('CopyWAWERecGroup.VALMETHOD',RowCounter,:HrmPmsWAWE.VALMETHOD) ;
Set_Group_Number_cell('CopyWAWERecGroup.USERINPUT',RowCounter,:HrmPmsWAWE.USERINPUT) ;
Set_Group_Number_cell('CopyWAWERecGroup.PRFORMULA',RowCounter,:HrmPmsWAWE.PRFORMULA) ;
Set_Group_Char_cell('CopyWAWERecGroup.OPFORMULA',RowCounter,:HrmPmsWAWE.OPFORMULA) ;
Set_Group_Char_cell('CopyWAWERecGroup.WELEVEL',RowCounter,:HrmPmsWAWE.WELEVEL) ;
Set_Group_Char_cell('CopyWAWERecGroup.STATUS',RowCounter,:HrmPmsWAWE.STATUS) ;


RowCounter := RowCounter + 1 ;
--

exit when :system.last_record = 'TRUE' ;
next_record ;
end loop ;

--
Go_Block(C_Block);
Go_Record(C_Record);
Go_Item(C_Item);
--
:Parameter.Copy:='Yes'; -- Check that Data has been Copied.
else
message('Update is not Allowded') ;
end if ; --if get_block_property('HrmPmsWaPayDef', update_allowed) = 'FALSE'
exception
when others then
message(sqlcode||sqlerrm) ;
--


END;

---------------------------
--------------------------
Paste

DECLARE
RecCopyGrpName varchar2(30) := 'CopyWAWERecGroup' ; --Record group name
RecCopyGrpId RecordGroup ; --Record Group Id.
GrpCopyColId GroupColumn ; --Group column id.
RowCounter number := 1 ;

C_Block Varchar2(100);
C_Record Number;
C_Item Varchar2(100);
BEGIN
if get_block_property('HrmPmsWaPayDef', update_allowed) = 'TRUE' then
----------
C_Block:= :System.Cursor_Block;
C_Record:=:System.Cursor_Record;
C_item:= :System.Cursor_Item;
RecCopyGrpId := find_group(RecCopyGrpName) ;
--
--If a record group with this name dosn't exist then create record.
--
if not id_null(RecCopyGrpId) then
delete_group('CopyWAWERecGroup') ;
end if ; --if not id_null(RecGrpId) then
--
RecCopyGrpId := create_group(RecCopyGrpName,global_scope) ;
GrpCopyColId := add_group_column(RecCopyGrpId,'WAWENO',CHAR_COLUMN,10) ; --DB
GrpCopyColId := add_group_column(RecCopyGrpId,'PWAGEELEMENT',NUMBER_COLUMN,10) ; --DB
GrpCopyColId := add_group_column(RecCopyGrpId,'WEID',CHAR_COLUMN,30) ; --Query
GrpCopyColId := add_group_column(RecCopyGrpId,'WENAME',CHAR_COLUMN,30) ; --Query
GrpCopyColId := add_group_column(RecCopyGrpId,'WEDESCR',CHAR_COLUMN,200) ; --Query
GrpCopyColId := add_group_column(RecCopyGrpId,'WETYPE',CHAR_COLUMN,30) ; --Query
GrpCopyColId := add_group_column(RecCopyGrpId,'VALMETHOD',CHAR_COLUMN,30) ; --Query
GrpCopyColId := add_group_column(RecCopyGrpId,'USERINPUT',NUMBER_COLUMN,30) ; --DB
GrpCopyColId := add_group_column(RecCopyGrpId,'PRFORMULA',NUMBER_COLUMN) ; --DB
GrpCopyColId := add_group_column(RecCopyGrpId,'OPFORMULA',CHAR_COLUMN,4000) ; --Query
GrpCopyColId := add_group_column(RecCopyGrpId,'WELEVEL',CHAR_COLUMN,1) ; --DB
GrpCopyColId := add_group_column(RecCopyGrpId,'STATUS',CHAR_COLUMN,1) ; --DB
--
go_block('HRMPMSWAWE') ;
first_record ;
--
loop
-- message('HrmOpsResponsibilities:'||:HrmOpsResponsibilities.selection) ;pause ;
Add_Group_Row(RecCopyGrpId,RowCounter) ;

Set_Group_Char_cell('CopyWAWERecGroup.WAWENO',RowCounter,:HrmPmsWAWE.WAWENO) ;
Set_Group_Number_cell('CopyWAWERecGroup.PWAGEELEMENT',RowCounter,:HrmPmsWAWE.PWAGEELEMENT) ;
Set_Group_Char_cell('CopyWAWERecGroup.WEID',RowCounter,:HrmPmsWAWE.WEID) ;
Set_Group_Char_cell('CopyWAWERecGroup.WENAME',RowCounter,:HrmPmsWAWE.WENAME) ;
Set_Group_Char_cell('CopyWAWERecGroup.WEDESCR',RowCounter,:HrmPmsWAWE.WEDESCR) ;
Set_Group_Char_cell('CopyWAWERecGroup.WETYPE',RowCounter,:HrmPmsWAWE.WETYPE) ;
Set_Group_Char_cell('CopyWAWERecGroup.VALMETHOD',RowCounter,:HrmPmsWAWE.VALMETHOD) ;
Set_Group_Number_cell('CopyWAWERecGroup.USERINPUT',RowCounter,:HrmPmsWAWE.USERINPUT) ;
Set_Group_Number_cell('CopyWAWERecGroup.PRFORMULA',RowCounter,:HrmPmsWAWE.PRFORMULA) ;
Set_Group_Char_cell('CopyWAWERecGroup.OPFORMULA',RowCounter,:HrmPmsWAWE.OPFORMULA) ;
Set_Group_Char_cell('CopyWAWERecGroup.WELEVEL',RowCounter,:HrmPmsWAWE.WELEVEL) ;
Set_Group_Char_cell('CopyWAWERecGroup.STATUS',RowCounter,:HrmPmsWAWE.STATUS) ;


RowCounter := RowCounter + 1 ;
--

exit when :system.last_record = 'TRUE' ;
next_record ;
end loop ;

--
Go_Block(C_Block);
Go_Record(C_Record);
Go_Item(C_Item);
--
:Parameter.Copy:='Yes'; -- Check that Data has been Copied.
else
message('Update is not Allowded') ;
end if ; --if get_block_property('HrmPmsWaPayDef', update_allowed) = 'FALSE'
exception
when others then
message(sqlcode||sqlerrm) ;
--


END;
Previous Topic: in which trigger I should use this:
Next Topic: Changing FORMS_PATH
Goto Forum:
  


Current Time: Sat Dec 10 20:17:21 CST 2016

Total time taken to generate the page: 0.14347 seconds