LOV IN FORMS [message #273001] |
Mon, 08 October 2007 09:42 |
mnanias
Messages: 40 Registered: September 2007 Location: AMERICA
|
Member |
|
|
Hi,
Thank You for helping me in the previous topic of mine.
Now I have one more issue with the forms,I have created a form and I was asked to create an lov for a button.By using when-button-pressed trigger and show_lov I have done that but now I have to store the item of the lov which was selected.For example in the LOV there are 3 items X,Y,Z and I select X then that value should be saved and I should be able to use that in some other display item.Please help me in this.
Thank You in Advance.
Thank You,
Nagesh.
|
|
|
|
|
Re: LOV IN FORMS [message #273036 is a reply to message #273024] |
Mon, 08 October 2007 16:45 |
mnanias
Messages: 40 Registered: September 2007 Location: AMERICA
|
Member |
|
|
Hi,
Thanks for your help but there is nothing in button trigger its all blank and even when i try to execute i was not able to do that it says unable to formate,so can you please send me trigger code just send the trigger code I will look in to it
Thanks again.
Nagesh.
|
|
|
|
|
Re: LOV IN FORMS [message #273266 is a reply to message #273071] |
Tue, 09 October 2007 15:19 |
mnanias
Messages: 40 Registered: September 2007 Location: AMERICA
|
Member |
|
|
Hi,
Thank you for ur response.
I have 10g in my office so I was able to open your file in office and when i tried to run the code in my form its giving error saying there is no such LOV_VALUE_HERE so i am little bit confused wat value do i need to type in there please let me know and when i searched in help for name_in is says we should have varchar2 as parameters so wat exactly i should give,i think u got my point i am trying to save the item in lov and trying to display it in a display item as u showed in jpg file and i was not able to do
help me with this
Thank You
Nagesh
|
|
|
|
|
Re: LOV IN FORMS [message #273490 is a reply to message #273001] |
Wed, 10 October 2007 11:33 |
tiny_oracle
Messages: 20 Registered: October 2007 Location: Syria
|
Junior Member |
|
|
OK Nagesh , let's do the entire sample step by step , consider it as a small lesson ...
First open the Forms Builder 10g , connect to scott/tiger _I think you know that this account is built in in Oracle_
Create new Datablock as Control Block _NOT connected with the database_ and name it "LOV_BLOCK" for example ..
Create new Canvas and name it "LOV_CANVAS" then double click on it to open the Layout Editor
Add a display Item to the datablock and name it "LOV_VALUE_HERE" this display item will show us the value that you chosen from the LOV , and we will copy this value from it to save it later .
Add a button ti the datablock and name it "SHOW_LOV" this button will show the LOV when we Click it .
The Canvas will look like the IMAGE1.GIF in attached files ...
Now let us create the LOV it self :
Add new Record Group and name it "LOV_RECORD_GROUP" , the Query you must enter like the IMAGE2.GIF in attached Files ...
Now the record group will fetch the rows from the table dept , then we will create LOV to show them ...
Create new LOV by Wizard and name it "LOV_ITSELF" the wizard setps like that :
The record group is "LOV_RECORD_GROUP" like IMAGE3.GIF , this means that this LOV will take it values from that record group .
Press next and chose Modify existing Record Group , then Press next and You will get this window shown in IMAGE4.GIF , it's important one , here You can Check the Syntax of SQL query in the Record Group and Modify it if you want , leave it and press next ..
The Record Group returns one column in our sample , move the DNAME column from the left to the right , that means the LOV will return the values of this column ...
now another important window , this one shown in IMAGE5.GIF determines the Item that the LOV will appears in , click Look up return item button , and chose LOV_BLOCK.LOV_VALUE_HERE
now the value that you will chose will appears in the display item LOV_VALUE_HERE in the control block LOV_BLOCK ...
Press next and chose a title for the LOV , then click next to determine the number of the rows LOV will retrieve at a time , then press next and move the value LOV_BLOCK.LOV_VALUE_HERE from the left to the right then click next and finally Finish ...
Now you have LOV attached with Record Group , the Record Group retrieve the records from the database and the LOV show them , the Display Item now is assigned to the LOV so the value that you will chose from LOV will display in the display Item ...
Your items will seems like IMAGE6.GIF ...
Add WHEN-BUTTON-PRESSED trigger to the button and put in it this code :
declare
v_show_lov boolean ;
v_get_value varchar2(100);
begin
v_show_lov := show_lov('lov_itself');
v_get_value := name_in('LOV_VALUE_HERE');
message('The Department Is '||v_get_value);
end ;
to save this value in another table, replace the line Message('The De.........
with this line :
Insert into table_name Values
('Tiny_Oracle',v_get_value,......);
the Insert into clause you who should know it , if you need any help in it send to me the Table_name and it columns names and
columns types , what I want you to know that you use the name of the variable v_get_value directly in the values of insert into statement ...
keep me uptodate if you got any errors and send error detailes please , I'm in Service
Yours ... Tiny_Oracle
-
Attachment: IMAGES.zip
(Size: 65.93KB, Downloaded 1097 times)
[Updated on: Wed, 10 October 2007 11:36] Report message to a moderator
|
|
|
|