Home » Developer & Programmer » Forms » ...List ITems.. and window Close Events
...List ITems.. and window Close Events [message #137854] Sat, 17 September 2005 13:10 Go to next message
orcl_dba
Messages: 84
Registered: March 2005
Member
HI..
I would be highly thankful to uyou if you can tell me that

I want that whenver user selects an item from a tlist that item is shown in the text box. and then i can run a qquery based of that item from the database.

I think that Get_list_item_label or get_list_item_value is useless

the reason is that how can i know which item is selectd..

is there anything like ..

x:=get_list_element_selected and then we can compare

if Mad = 'Lahore' then go to ...

else
....

i mean otherwise for 100 elements i have to write too many ifs. that

IF get_list_element_label/value = x then do thih s

if ...
iff

isnt it ..

Second question is that can i stop closing of window if user press x button on the right top corner..
whenever application run user should use exit to close it instead of using X window buton

hope to see replies..

thanx alot in advance. .to all ofyou
Re: ...List ITems.. and window Close Events [message #137921 is a reply to message #137854] Sun, 18 September 2005 21:22 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Instead of using a tlist, consider using an LOV on a normal text item. The LOV can contain two columns - one can be returned in the visible field and the corresponding 'branch' item can be returned to a hidden field which is then used for your branching operation.

You can set 'Close allowed' to 'off' in the property of your window. You can also 'trap' it in your 'key-exit' trigger. If the user has not 'done something correctly' then give them a message saying 'you must do .... before exiting' and then don't do the exit-form command.

David
Re: ...List ITems.. and window Close Events [message #137967 is a reply to message #137854] Mon, 19 September 2005 03:19 Go to previous messageGo to next message
orcl_dba
Messages: 84
Registered: March 2005
Member
....
well i cant use LOV reason being user will really feel unease seleting a city from the LOV

had the cities been listed in the Tlist.. user can easily view them and while selecting them to display any other information based on the cities.

LOV on the other hand looks odd as it pops up and then does not actually show all the citiies.
LOV is most likely the best when user knows the names of all cities and cna user LOV for search purpose... as well.
but in this case user is not totally aware of the number and names of cities that are in the datbaase ...

so we need him to have a good and clear look at the names before selecting ..

Am i right..
i mean i thin it is ..

hope to see some early replies on the matter..

why cant we obtain any value of selected item.. in Forms...

My little knowledge with Forms is the one that is disturbing you ppl

Sory for that as



bR

Re: ...List ITems.. and window Close Events [message #137972 is a reply to message #137854] Mon, 19 September 2005 03:50 Go to previous messageGo to next message
saadatahmad
Messages: 452
Registered: March 2005
Location: Germany/Paderborn
Senior Member

hi,
Quote:
Quote:


I want that whenver user selects an item from a tlist that item is shown in the text box. and then i can run a qquery based of that item from the database.


If you have a list item and in query mode if you select one element from your list and then query the database, only the records consisting of that element will be queried.

Now if you want to populate a text item when you select the list element, there's a trigger When-List-Changed.
Just in this trigger, assign the text item the value of the list.

When-List-Changed
:your_block_name.your_text_item_name := your_data_block.list_item_name;


Important Note:
You should describe your problem in a way which should be easy for others to follow. Provide as much details as you can when you ask a question.

Regards.
Re: ...List ITems.. and window Close Events [message #138076 is a reply to message #137967] Mon, 19 September 2005 19:03 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I do not understand why you think that a tlist will present a different list to an LOV. But hey, that's me.

David

[Updated on: Tue, 20 September 2005 18:15]

Report message to a moderator

Re: ...List ITems.. and window Close Events [message #138165 is a reply to message #137854] Tue, 20 September 2005 09:35 Go to previous messageGo to next message
orcl_dba
Messages: 84
Registered: March 2005
Member
either you or most probably i m not gettnig it

well u said .

ur blockname.list_item_name..

well sir. .i thats what i know that you have to assign the value of the selected item. but how do you know which element user has selected..

When list Changed trigger fine..

what shoudl isay ..

if list1.elementvalue = kfjjlasdf

then it means thati have to put 20 or more ifs if the number of elemets are 20 or more..

isnt there any way that we get a selected element..

like for .eq.

if list.selected element_label = A then :text1 = Hello

etc...


means user can click on any city and i want to retireve record for that city..

One way i have told you is that i need to put ifs.

so many

isnt there is any simple way ..

another way is LOV..

cuz then i can say that after selecting from LOV..
if :text1 = ABD then :text2= hello

but my managers are not fond of using LOv.. instead they like a list to be presented from where they ccan see and seleted..

Hope i m able to make u understand this time..


thanx alot for bearing for such a simple questions.. aagain and again ..

sorry
BR
Re: ...List ITems.. and window Close Events [message #138236 is a reply to message #138165] Tue, 20 September 2005 18:21 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Do you have a table which has the 'city' and the 'other data' that you now want to use? If no, as the 'tlist' only returns a single data element, then multiple 'if' statements is the only choice. An LOV with multiple return elements was my alternate solution. If you DO have a table with 'city associated data' then have a 'select' statment based on the 'city' field in your trigger and use it to populate your other fields.

If you currently don't have this table then consider creating it.

Hey, you could probably create a record group with 'city'/'other data' pairs and scan the record group for the returned city and populate your field using the 'other data'.

But this is called 'hard-coding data values' and is frowned upon in good programming circles. Consider adding another columns to your 'city' table.

David

[Updated on: Tue, 20 September 2005 18:22]

Report message to a moderator

Previous Topic: Object Libraries and grouping library tab objects
Next Topic: ;;;; Strange Problem.. arrow key on key board
Goto Forum:
  


Current Time: Fri Sep 20 05:51:16 CDT 2024