cancel
Showing results for 
Search instead for 
Did you mean: 

Query for Drop Down By key

Former Member
0 Kudos

Hi,

Explaining my problem with an example.

There is a hotel table where user enter hotel details

Like City, Dep Date, Arr Date, No of Days , rate etc and these in turn get saved to table say USER_HOTEL_DETAILS . When user comes to his plan/entered details again, previously saved data is shown to him.

For making a selection for City I have to give a dropdown to user with cities list that are maintained in other table say HOTEL_DATA which has city, rate, and currency fields and city is the key of table.

Now if I use drop down by key or index for city I need to fetch city values from table HOTEL_DATA and have to populate context of city field of USER_HOTEL_DETAILS.

For dropdown my value text is going to be city .For key if I try to give serial numbers say 1, 2, 3 as key for populating dropdown, the key will get stored in database table against city name. To avoid this while saving data I have to write additional code while saving and retrieving data that take value against selected key.

To avoid this one way is to use city name as both Key and Value. What is the other alternative I can use for? Please help

Regards,

Madhvika

Accepted Solutions (0)

Answers (1)

Answers (1)

Madhu2004
Active Contributor
0 Kudos

Hi ,

It is better to have citykey in HOTEL table and maintain a text table for the same.This is good approach.

Because tommorow if city needs to be displayed in other text also just adding the same in the text table would be suffice.

For city texts retrieve it from text table and bind to the node.

Regards,

Madhu