9 Replies Latest reply on Feb 4, 2013 8:47 AM by swesley_perth

    Apex List Item Value and ID?

      Hi All,

      I had created a region with corresponding Item (Which is of type select list), in that list we are showing display_value as well as return_value.
      In UI screen while displaying users we are showing display_value based on return_value.
      Along with i need to get the display_value also to pass in corresponding package.
      Could some one help me how to pass name in package.
      Please find the deatils below.

      1. I had created a sample example on apex.oracle.com and here are the credentails:


      Region-List Item Region.
      Item- Employee Id

      2. Apex version and others deatils:

      Product Build:
      Database Version Information: Oracle Database 10g Enterprise Edition Release - 64bi
      Interent Explorer version-6.0

      3. I had created a package in sql worshop and the name of package is PKG_UI
      In that i am passing ( PI_EMPID IN NUMBER) which gives a number, now similarly i need to pass another varibale to get the ename desciption.
      How do we get this and pass in the Main procedure in package.

      4. Had created also PL/SQL Anoyomous Block, where i am calling Main procedure.

      5. I had created a popup screen for that list item uisng javascript.

      Hoping to get the result for this.

        • 1. Re: Apex List Item Value and ID?
          Is it not acceptable in your situation to source this from the table within your PL/SQL package using emp_id?

          blog: [url grassroots-oracle.com]grassroots-oracle.com
          twitter: [url twitter.com/swesley_perth]@swesley_perth

          -- please mark any useful posts as helpful or correct, in the end it helps us all
          • 2. Re: Apex List Item Value and ID?
            Hi Scott,

            Sorry i have not got your point, you are trying to say we can not pass the another varibable to get the Ename?
            I am trying from my end to get the Ename from select list item.

            • 3. Re: Apex List Item Value and ID?
              No doubt you can obtain the description of the selected list item using jQuery, but instead of passing this as a parameter, your already querying the table that sources your select list in your PL/SQL, and you can get the name from there.
              For cc in (select * from emp where empno=PI_EMPID) LOOP
                -- use cc.ename to refer to employee detail
              END LOOP;
              • 4. Re: Apex List Item Value and ID?
                But the reason i am trying to pass the another varibale is to add another condition in select list as
                For cc in (select * from emp where 
                              empno=PI_EMPID and
                              ename=PI_ENAME) LOOP
                END LOOP;
                But here i am not able to get any idea how to pass the PI_ENAME, in above query.
                • 5. Re: Apex List Item Value and ID?
                  Why would you need that if emp_id is the primary key to the table?

                  If this example is not representative of the problem you are trying to solve - then you should state accordingly. Other solutions are often present that don't match your one's original presumption.

                  That being said, if you can source your LOV from one SQL, then you should be able to resolve the description from that loop also - not needing another parameter. It should be deterministic.

                  • 6. Re: Apex List Item Value and ID?
                    May be my explanation is not up to mark, can you help me using java script how to display value from select list.

                    • 7. Re: Apex List Item Value and ID?
                      That's easy

                      • 8. Re: Apex List Item Value and ID?
                        Thanks Scott,

                        I could able to work around and finally resolved the 80% problem.
                        But i was help up in popup LOV while implemntaing the scenerio.
                        I have updated in mine example with alert messages required.

                        Form popup Lov i am trying to conacat two columns into single to display that value in text, but syntax is the problme for me to pass the same.
                        Could you please look and correct me the syntax for me.
                        • 9. Re: Apex List Item Value and ID?
                          Without looking, I would guess you may need to use a variation of
                          But even then that doesn't feel right - just remember javascript has different concatentation operator: + vs ||
                          and consider string quotation.