This discussion is archived
4 Replies Latest reply: Jan 3, 2013 10:19 AM by Andreas Weiden RSS

Show  in the form layout dynamically in oracle forms

980086 Newbie
Currently Being Moderated
I have a table named country.It has a total number of 230 countries.
Now I need to create a page where user can select countries for which they want to see some data.Now for this I need to have all the 230 country name & check box beside each one.May be afterwards they can add some country to the country table.Then those countries also should be shown.
What I mean is form should show the layout dynamically from the country table.
I think to create layout with each country 230 times is not a good practice.

My country table have 3 columns - 1.country_name 2. country_code 3. status(default 0)

when user select any country that should update STATUS column of country table as 1.

Please help me with the code
Kindly help....
  • 1. Re: Show  in the form layout dynamically in oracle forms
    user346369 Expert
    Currently Being Moderated
    What I mean is form should show the layout dynamically from the country table.
    I think to create layout with each country 230 times is not a good practice.
    Do you want to show each selected country in a different column across the width of the form? If so, you need to limit the number of countries they can select.

    Or could you show each selected country and the data for that country in a new row in a block? That would be much easier.

    Please explain more what you need to display and how it should be displayed, for each selected country.
  • 2. Re: Show  in the form layout dynamically in oracle forms
    Andreas Weiden Guru
    Currently Being Moderated
    I would create a block based on your countries table, then you can show as much records as there are in teh table. Make the staus-column a checkbox with value 1 when checked and value 0 when unchecked. The you simple have to issue a COMMIT_FORm to save the changes.

    The only problem is... What if two users want to check different countries? Then updating the status-column won't work.
  • 3. Re: Show  in the form layout dynamically in oracle forms
    980086 Newbie
    Currently Being Moderated
    I have to show user all the 230 countries.They might select around 20 countries for which they want to see some data.
    So I have to show them all the countries in the layout.

    layout will be something like this-

    Country_Name Want_to_see
    _
    Australia |_| (Check box)
    Afghanistan |_| (Check box)
    Denmark |_| (Check box)
    Norway |_| (Check box)
    .
    .
    .
    .
    .
    UK |_| (Check box)
    USA |_| (Check box)
    .
    .
    Zambia |_| (Check box)


    How can I show this in a canvas from country table where all the country name are there.
    Please help
  • 4. Re: Show  in the form layout dynamically in oracle forms
    Andreas Weiden Guru
    Currently Being Moderated
    Do it as i described in my previous post. Build a tabular block based on your countries-table and issue an EXECUTE_QUERY. Make the itemtype of your status-column "Checkbox".

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points