Home » Developer & Programmer » Forms » LOV IN FORMS
LOV IN FORMS [message #273001] Mon, 08 October 2007 09:42 Go to next message
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 #273019 is a reply to message #273001] Mon, 08 October 2007 12:36 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Did you do the mapping between LoV items and form items? If not, you should.
Re: LOV IN FORMS [message #273024 is a reply to message #273001] Mon, 08 October 2007 13:55 Go to previous messageGo to next message
tiny_oracle
Messages: 20
Registered: October 2007
Location: Syria
Junior Member

Hi

This is an easy example about LOV , You can see the trigger in the button ...
I think you now these too easy information , but I try to help ...
The user is scottt , we will get data from DEPT table...

Yours , Tiny_Oracle
  • Attachment: LOV.fmb
    (Size: 48.00KB, Downloaded 245 times)
Re: LOV IN FORMS [message #273036 is a reply to message #273024] Mon, 08 October 2007 16:45 Go to previous messageGo to next message
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 #273071 is a reply to message #273001] Tue, 09 October 2007 00:48 Go to previous messageGo to next message
tiny_oracle
Messages: 20
Registered: October 2007
Location: Syria
Junior Member

Hi , I don't know why this sample has not run well , any way my software is Forms 10g and account scott/tiger
this is the code :

declare
v_show_lov boolean ;
v_get_value varchar2(100);
begin
v_show_lov := show_lov('lov_itself');

-- I thought that this code lower may work but it doesn't , any way let's
-- ### v_get_value := get_item_property('lov_itself',database_value); ###

-- but we will take the value from the display Item :
v_get_value := name_in('LOV_VALUE_HERE');
message('The Department Is '||v_get_value);
-- Now you can save the value any where
-- Finally , I'm sorry for bad English because it's not my mother language Wink

end ;

but I think you must run the project to see it components , I'll attach it again ...

Yours ...
  • Attachment: LOV.zip
    (Size: 29.13KB, Downloaded 196 times)

[Updated on: Tue, 09 October 2007 01:50]

Report message to a moderator

Re: LOV IN FORMS [message #273113 is a reply to message #273001] Tue, 09 October 2007 02:20 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Just use the Forms wizard for creating a 'record_group' and an 'LOV'. They should do all of the work for you.

Remember to search this forum for 'LOV'. Unfortunately, there will probably be many entries to scan.

David
Re: LOV IN FORMS [message #273266 is a reply to message #273071] Tue, 09 October 2007 15:19 Go to previous messageGo to next message
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 #273326 is a reply to message #273266] Wed, 10 October 2007 00:00 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
You need to store the name of the item (in the format 'blk.itm') into which you want the return from the LOV to be placed.

David
Re: LOV IN FORMS [message #273340 is a reply to message #273001] Wed, 10 October 2007 01:21 Go to previous messageGo to next message
chaudharyshamraiz
Messages: 4
Registered: May 2007
Location: Pakistan
Junior Member

Try it by using the where clause
Re: LOV IN FORMS [message #273490 is a reply to message #273001] Wed, 10 October 2007 11:33 Go to previous messageGo to next message
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 188 times)

[Updated on: Wed, 10 October 2007 11:36]

Report message to a moderator

Re: LOV IN FORMS [message #273506 is a reply to message #273490] Wed, 10 October 2007 13:27 Go to previous message
mnanias
Messages: 40
Registered: September 2007
Location: AMERICA
Member
Hi,
Thank You very much it worked.Sorry to bother you so much
Previous Topic: FORMS 6.0.5
Next Topic: name of current window
Goto Forum:
  


Current Time: Sun Dec 04 06:10:16 CST 2016

Total time taken to generate the page: 0.07001 seconds