6 Replies Latest reply: Apr 27, 2012 10:03 AM by Mohammad Jabr RSS

    How can we bind Two Static Lists to a single Column.

    user9330447
      Hi All,

      My requirement is
      1) I have two different Static List's.
      2) These two static list's are saved to the same column in the database table.
      3) In the UI, I will be having different dropdown's. And each dropdown is bound to this column. Say if I have two dropdowns, in the first dropdown it has to show first static list values and in the second dropdown it hase to show second static list values.
      4) I can change the dropdowns and save(to the same column).

      I am totally stuck here. How can we implement this????
        • 1. Re: How can we bind Two Static Lists to a single Column.
          Mohammad Jabr
          do you want to show both LOV at the same time or you want to show only one of them at a time?
          are you using ADF BC (model driven LOV)?
          If you want to show only LOV at a time and you are using ADF BC, then check this video
          http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/ADF_Insider_Essentials/lov-switcher/lov-switcher.html
          • 2. Re: How can we bind Two Static Lists to a single Column.
            user9330447
            Hi,

            Thank you very much for your response. The link was not useful for me.

            The actual scenario here is,

            I have a table with columns say (Id, detailId,Type, Unit, Value). here id & detailId acts as composite primary key and it looks similar to this.

            Id     DetailId     Type     Unit     Value
            111     1111     A     Min     12
            111     1112     B     KBytes     13
            111     1113     C     MBytes     14

            So for this I had created two static list View objects (Say ST1 & ST2). The possible values for ST1 are {'sec','min','hours','days'} and the possible values for ST2 are {'Bytes','KBytes','MBytes','GBytes'}.
            And from above table you can observe that these two view objects are mapped to same attribute(Unit) of the table.

            So what I am trying here is, as my UI page contains, 3 different dropdowns(say af:SelectOneChoice) along with 3 textboxes. one textbox and one dropdown in the same line.
            These 3 are related to above 3 types, dropdowns should contain the Units and textboxes should contain the values, i.e based on the type we have to display that.

            I tried so many combinations, but I am not able to succeed in getting this. So your help is highly needed here.
            Please let me know if you are not understood any of the above conditions.

            Thanks & Regards,
            Ravi.
            • 3. Re: How can we bind Two Static Lists to a single Column.
              Mohammad Jabr
              You could build your own declarative component [url http://docs.oracle.com/cd/E17904_01/web.1111/b31973/af_reuse.htm#CACBFGFC] Using Declarative Components .
              • 4. Re: How can we bind Two Static Lists to a single Column.
                user9330447
                Hi Mohammad,

                As I am newbie, I didn;t understand this declarative components.
                Could you please elaborate further or is any other way os solving this issue.

                Ravi.
                • 5. Re: How can we bind Two Static Lists to a single Column.
                  Mohammad Jabr
                  beside the link to docs I have posted in the last message,check [url https://blogs.oracle.com/adffun/entry/fun_with_declarative_components]Fun with Declarative Components , it is similar to your use case.
                  • 6. Re: How can we bind Two Static Lists to a single Column.
                    user9330447
                    Hi Mohammad,


                    Thanks for your prompt reply. Thats not the usecase I am looiking out.

                    my UI may look like this

                    textbox1

                    checkbox1

                    textbox2 dropdown1

                    texbox3

                    textbox4

                    textbox5 dropdown2

                    checkbox2 textbox6

                    checkbox3 textbox7

                    textbox8 dropdown3

                    As I mentioned earlier I need to show static list object 1 in dropdown1 and static list object 2 in dropdown 2 and drop down3. Here all these dropdowns should map to the same attribute('Unit') in the databse table.


                    SO basically the issue here is mapping two different static list view objects to a same attribute...

                    For this I need your guidance.

                    Thanks,
                    Ravi.