9 Replies Latest reply: Feb 4, 2013 2:47 AM by swesley_perth RSS

    Apex List Item Value and ID?

    665735
      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:

      workspace-apex_demo_bosu
      usernae-BORRASUBRAHMANYAM@YAHOO.COM
      password-seshubosu
      URL:http://apex.oracle.com/pls/apex/f?p=49934:1:

      Region-List Item Region.
      Item- Employee Id

      2. Apex version and others deatils:

      Product Build: 3.2.0.00.27
      Database Version Information: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 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.

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

          Scott
          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?
            665735
            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.

            Regards,
            Anoo..
            • 3. Re: Apex List Item Value and ID?
              swesley_perth
              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
                emp_info.deptno:=cc.deptno;
                -- use cc.ename to refer to employee detail
              END LOOP;
              Scott
              • 4. Re: Apex List Item Value and ID?
                665735
                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
                        emp_info.deptno:=cc.deptno;
                END LOOP;
                
                But here i am not able to get any idea how to pass the PI_ENAME, in above query.
                Regards,
                Anoo..
                • 5. Re: Apex List Item Value and ID?
                  swesley_perth
                  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.

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

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

                      http://lmgtfy.com/?q=javascript+display+value+select+list
                      • 8. Re: Apex List Item Value and ID?
                        665735
                        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.
                        javascript:passBackValues('#EMPNO#','#ENAME||JOB#')
                        Thanks,
                        Anoo..
                        • 9. Re: Apex List Item Value and ID?
                          swesley_perth
                          Without looking, I would guess you may need to use a variation of
                          javascript:passBackValues('#EMPNO#','#ENAME#+#JOB#')
                          But even then that doesn't feel right - just remember javascript has different concatentation operator: + vs ||
                          and consider string quotation.