To attach a library in a Form [message #111938] |
Mon, 21 March 2005 23:49 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
tsilav
Messages: 22 Registered: September 2004
|
Junior Member |
|
|
how to attach object library to form ?In other wise how reuse it because i don't understand forms Developer help of the way to reuse an library or a .olb or .pll.
please help me
|
|
|
Re: To attach a library in a Form [message #111965 is a reply to message #111938] |
Tue, 22 March 2005 02:05 ![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) |
![](/forum/images/custom_avatars/67693.png) |
saadatahmad
Messages: 452 Registered: March 2005 Location: Germany/Paderborn
|
Senior Member |
![saadatahmad](/forum/theme/orafaq/images/yahoo.png)
|
|
Well....
An object librariy means the library of objects (e.g: Data Blocks, Items, Canvases, Windows etc....).
A PlSql library means the library of the codes (e.g: Procedure, Functions, Packages etc....)
Now how to use them?
Create a new Form in Form Builder. Create a control Block and place some items on this block and change the properties of the block and items....e.g: change the background color, foreground color, fonts etc...of text items.
Change the properties of Canvas ...
Now you have a modified Block, modified items in the block, modified canvas, window, etc...
Now come to the node Object Libraries.
Create a new object library by clicking on the Create New Icon.
An Object Library will be created.
First of All, save this library. Then Open this library by double clicking on it.
Drag the objects from your form into this library(Drag from form and drop into the library.
(e.g: drag and drop data block, canvas, window)
Save the Object library.
Now close this form and create a new form.
Don't create anything in the new form.
Drag Datablock from the library and drop it in the newly created form. Here it will ask you "You want to copy the object or subclass"
I hope you know the meanings of copy and subclass.
You subclass the object. Do the same with Canvas.
You can see now that objects which you modified inherited the properties.
This is the use of Object Libraries and how you can attach it to the form. The benefit of these libraries is that we have the standard objects (Templates) and if we develop a new module, standards can be maitained.
Now PLSql library is the same as object library but the is that Object library contains objects and PlSql library contains only the coding.
To create a PlSql Library:
Click on PL/SQL Libraries node.
Click on Create Button.
Click on Program Units.
Create a function, procedure, or package.
Save the library.
Open any form module.
Click the node, Attched Libraries.
Click on the Create Button.
A dialogue Box will appear.
Give the path and attach the library.
Click on Attach.
A message will appear.
Click on Yes.
Now the library is attached.
Now say you have a Procedure in your library called proc_test.
You need to define a new trigger in your module to which you attached the library. And in your trigger, you need to call the procedure proc_test which is in your library.
You can just write in the trigger code
Trigger Code:
proc_test;
This will call your procedure in the attached library.
You saw that you have defined your code in the libray and you can freely use this code in your forms.
I hope that you'r clear now with the benefits and use of these Object and Pl/SQL libraries.
Cheers!
|
|
|
|
|
|
|
|