8 Replies Latest reply: May 17, 2013 8:42 AM by fac586 RSS

    Issue:  Branch To Page Based On A Condition

    991247
      Hi Friends,

      Recently i found this issue in my application.

      I wanted to brach to a different page only when a particular item e.g. :P1_X is not null.

      I defined a condition on the BRANCH:
      SQL Expression:
      :P1_X is not null

      But the issue is that this doesnt work. Even if the value of item :P1_X is not null, it redirects to the same page no. 1.

      I even tried having a condition like length(:P1_X) is not null, but it doesnt work.

      Please help me on this.

      What is that i am missing ?

      Thanking you once again,
      Srikumar S
        • 1. Re: Issue:  Branch To Page Based On A Condition
          fac586
          Srikumar S wrote:

          Recently i found this issue in my application.

          I wanted to brach to a different page only when a particular item e.g. :P1_X is not null.

          I defined a condition on the BRANCH:
          SQL Expression:
          :P1_X is not null

          But the issue is that this doesnt work. Even if the value of item :P1_X is not null, it redirects to the same page no. 1.

          I even tried having a condition like length(:P1_X) is not null, but it doesnt work.
          Use Debug mode to determine what is occurring during branch processing.
          • 2. Re: Issue:  Branch To Page Based On A Condition
            Jayson Hanes
            check to see if you have another branch already that is set to a lower number in sequence?
            • 3. Re: Issue:  Branch To Page Based On A Condition
              991247
              No.

              There is no other branch on the page.
              I have made a branch from page 1 to page 2 and i want that the branch should happen only if the item lets say :PX_1 is not null.

              But unfortunately when i press the next button, it refreshes the page and remains on the same page.
              • 4. Re: Issue:  Branch To Page Based On A Condition
                fac586
                Using Debug will show what is actually happening.
                • 5. Re: Issue:  Branch To Page Based On A Condition
                  991247
                  faq586 : although i havent tried what u told, but you can get error msg in the debug mode, when you have actually encountered an error..

                  But in my case i am not even getting any error...it just refreshes the page.

                  Anyways i will still see if i can use debug and get some info.

                  Thanks a bunch
                  • 6. Re: Issue:  Branch To Page Based On A Condition
                    vdsadhi
                    Hi

                    What is the branch point you used in the branch?? 'Next' button is submitting the page or redirecting the page?? Can you please set a sample application in 'apex.oracle.com'.
                    So that we can have a look for your issue.

                    Thanks,
                    Lakshmi
                    • 7. Re: Issue:  Branch To Page Based On A Condition
                      991247
                      Hi,

                      The next button is redirecting to a URL.

                      And the branch point is "On Submitting(AFter C, V, and P)" .

                      You can have the development credentials itself to find out what i am doing(Nothing Top Secret :)):

                      http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::

                      W: SRIKUMAR_TEST1
                      U: SRIKUMAR_SUNDARAM@SYNTELINC.COM
                      P: India@789

                      Please go to page number 18. I am trying to navigate tp page 19 only when the COPY_PASTE item is not null.

                      i.e the NEXT button process should only work when the COPY_PASTE item is not null.

                      I hope you got it.

                      Thanks,
                      Srikumar S
                      • 8. Re: Issue:  Branch To Page Based On A Condition
                        fac586
                        Srikumar S wrote:

                        The next button is redirecting to a URL.

                        Please go to page number 18. I am trying to navigate tp page 19 only when the COPY_PASTE item is not null.

                        i.e the NEXT button process should only work when the COPY_PASTE item is not null.
                        The "Next" button is a component in a wizard-generated Data Load Process. Unfortunately you didn't provide this information: it is important. It was also suggested that you use Debug to discover what was happening when the page was submitted. This shows the following:
                        0.01371     0.00010     A C C E P T: Request="NEXT"
                        ...
                        0.06076     0.00083     Session State: Save form items and p_arg_values     4     
                        0.06159     0.00022     ...Session State: Save "P18_IMPORT_FROM" - saving same value: "PASTE"     4     
                        0.06181     0.00022     ...Session State: Save "P18_FILE_NAME" - saving same value: ""     4     
                        0.06203     0.00023     ...Session State: Save "P18_SEPARATOR" - saving same value: ","     4     
                        0.06225     0.00022     ...Session State: Save "P18_ENCLOSED_BY" - saving same value: """     4     
                        0.06247     0.00023     ...Session State: Save "P18_FIRST_ROW" - saving same value: "Y"     4     
                        0.06270     0.00022     ...Session State: Save "P18_CHAR_SET" - saving same value: "UTF-8"     4     
                        0.06291     0.00024     ...Session State: Save "P18_COPY_PASTE" - saving same value: ""
                        ...
                        0.08456     0.00003     Branch point: After Processing     4     
                        0.08459     0.00016     ...Evaluating Branch: "AFTER_PROCESSING" Type: REDIRECT_URL Button: 14249794908202473743 Condition: :P18_COPY_PASTE is not null     4     
                        0.08476     0.00043     ...Execute Statement: select count(*) from sys.dual where :P18_COPY_PASTE is not null     4     
                        0.08518     0.00003     ......Result = FALSE     4     
                        0.08521     0.00028     ...No branch specified, redirect to current page
                        {code}
                        Notice that the session state value of P18_COPY_PASTE is +being set to null+, leading to the failure of the conditional branch.
                        
                        This strange situation is due to how the Data Load Process works. The P18_COPY_PASTE data is not in fact included when the page is submitted, but POSTed in a separate AJAX request to enable CLOB data in excess of 32K to be transferred. In this case checking that P18_COPY_PASTE is not null in the branch condition is not the correct condition, as it's +always+ null. The pasted data is not in the P18_COPY_PASTE item but the Data Load Process collection CLOB_CONTENT, so change the condition to *Exists (SQL query returns at least one row)* and check that there's CLOB content in the collection:
                        {code}
                        select
                            null
                        from
                            apex_collections
                        where
                            collection_name = 'CLOB_CONTENT'
                        and clob001 is not null
                        {code}
                        You can also provide a client-side validation using the *Value Required* setting on the P18_COPY_PASTE item.