4 Replies Latest reply on Sep 12, 2013 12:01 PM by throat

    Pass values between different regions on the same page.

    throat

      Hi guys!

      I am trying to develop a simple application where we have list of students. For each student I am displaying information on a separate page. Do you have any idea how and if I can pass parameters between regions on the same page? I have a view showing student id, name etc. information, and I want to create another view, on the same page, which will take student's id and will return a list of his/her subscribed courses.

       

      Part of my database is something like this:

       

      -------------

      Students

      ------------

      Id (PK)

      ------------

      -----------------------

      Student_course

      -----------------------

      Id(PK)

      Student_id(FK)

      Course_id(FK)

      ----------------------

       

      ----------------

      Courses

      ----------------

      Id(PK)

       

      Have you got any clue how this can be done? I found information how to pass parameters between pages, but not on the same page.

      Thanks in advance!

       

      P.S. I am using Application Express (declarative progamming via web browser), using Application Builder.

        • 1. Re: Pass values between different regions on the same page.
          Howard (... in Training)

          Hi db71eb4b-29df-4eea-a3cc-1cebd2f47123,


          I see you're new.  Could we get you to change your db71eb4b-29df-4eea-a3cc-1cebd2f47123 to a name, nick name or handle?

           

          Multiple (the same or different) views -- in different regions -- can share (non-view) data.  So I suspect you do not need to pass anything.  Any values you want to pass are already on the page -- so they don't need to be passed.  But if you did (pass them), you would surely pass them as if to another page -- exactly the same way -- only branch back to the current page.


          The point of passing some value is to store it somewhere to be used.  So I think what you need is just to use a (possibly hidden?) Page Item.  Just be sure that its value is Saved in the Session State so you can work with it.


          If that doesn't do it, you need to given more detail as to what data is to be passed and how you are using it.


          Regards,

          Howard

          • 2. Re: Pass values between different regions on the same page.
            Pars

            for more clarification specify details:

             

            1.which apex version you are using?

            2.what is structure of your tables in details?

            3.what values are passed to which column?

             

            Pars.

            • 3. Re: Pass values between different regions on the same page.
              throat

              Sure, here are some details:

               

              Oracle apex version: Product Build:4.2.3.00.07

               

              Tables :

              STUDENTS - rows : student_id(PK), student_name ...

              COURSES - rows: course_id(PK), course_name, course_credit

              STUDENT_COURSE - rows: student_id(FK), course_id(FK), student_course_id(PK)

               

              I have a page where I show student's details. On this page I have access to student's id. The name of the field (on the page) is P9_STUDENT_ID. On the same page I want to have a table which is linked to an sql query that lists a student's courses, their credits, names etc.

               

              My sql query is the following:

               

              SELECT courses.course_id, courses.course_name, courses.course_credit

              FROM student_course INNER JOIN courses

                                  on courses.course_id = student_course.course_id

                                  WHERE student_course.student_id = 1


              Currently it displays all courses of student with Id = 1. I just want to replace this '1' with the actual student_id for the student we are currently displaying information for. Or, in this case P9_STUDENT_ID field's value. Don't know if this is the right way to do this, but still reading for options

              • 4. Re: Pass values between different regions on the same page.
                throat

                I found out what I really had to do. I just had to replace the '1' in my sql query with :P9_STUDENT_ID

                 

                Thanks for your help anyway!