1 2 Previous Next 21 Replies Latest reply: Nov 27, 2012 2:54 PM by 921903 RSS

    problem passing special characters from one page to another, APEX 4.1

    921903
      I am passing values from one page to another. when I pass values with special characters, the value is messed up on the receiving page. Here's an example. Original value is "120030/2012-04" and value on the receiving page "120030%2F2012-04". How do I resolve this.
        • 1. Re: problem passing special characters from one page to another, APEX 4.1
          Bob37
          Enclose the string in backslashes

          pass it as \120030/2012-04\
          • 2. Re: problem passing special characters from one page to another, APEX 4.1
            921903
            Thans for your quick response. I am a newbie to APEX. I passed the values in the "Action when button clicked" section of the calling page using

            set these items (P37_DOCKET_NUM,P37_PO_NUM)
            with these values(&P37_DOCKET_NUM.,&P37_PO_NUM.)

            How do I do what you suggested in this case.
            • 3. Re: problem passing special characters from one page to another, APEX 4.1
              Bob37
              Try this
              set these items (P37_DOCKET_NUM,P37_PO_NUM)
              with these values(\&P37_DOCKET_NUM.\,\&P37_PO_NUM.\)
              It may not apply in this case for you, but it is good practice to pass as little information through URL's as possible. Meaning that if you can pass some key identifier that will allow you to do a query on the page you are redirecting to and look up the other information that you want on the new page, that is the preferred method.
              • 4. Re: problem passing special characters from one page to another, APEX 4.1
                trent
                Hi,

                I strongly suggest avoiding passing string values in the URL - i ran into issues in the past with trying to pass them in the URL but there were countless characters that ended up causing issues. Instead, why dont you have a page process that sets the page values accordingly. Either on the new page as before header, or on the original page as on submit.

                i.e.

                :P<new_page>ITEM := :P<oldpage>_ITEM;

                Or just have computations on the new page, based on page items, which are from the other page.
                • 5. Re: problem passing special characters from one page to another, APEX 4.1
                  921903
                  I have tried both methods mentioned above and neither works.
                  • 6. Re: problem passing special characters from one page to another, APEX 4.1
                    Bob37
                    Sorry bout that. We do it all the time with links we build up; I thought it would work from the Set These Items With These Values area

                    Well, This method will work, and you can pass anything you want up to the size limits of the collection column sizes

                    On the current page, create an after submit PL/SQL procedure as the last procedure in the sequence right before branching. This will put your source item values into an Apex Collection.
                    DECLARE
                      l_collection_name CONSTANT VARCHAR2(255) := WWV_FLOW.G_INSTANCE;     -- WWV_FLOW.G_INSTANCE is your user session number and will keep the collections per user session
                    BEGIN
                      IF APEX_COLLECTION.COLLECTION_EXISTS(p_collection_name => l_collection_name) THEN
                        APEX_COLLECTION.DELETE_COLLECTION(p_collection_name => l_collection_name);
                      END IF;
                      APEX_COLLECTION.CREATE_COLLECTION(p_collection_name => l_collection_name);
                     
                      APEX_COLLECTION.ADD_MEMBER(
                        p_collection_name => l_collection_name,
                        p_c001 => :Page_Item1,                                                 
                        p_c002 => :Page_Item2
                         );
                    END;
                    On the Target Page, create a Before or After Header procedure to obtain the values you passed in the collection.
                    Select c001, c002 
                    INTO :Target_Page_Item1, :Target_Page_Item2
                    From APEX_COLLECTIONS
                    Where COLLECTION_NAME = WWV_FLOW.G_INSTANCE
                    AND SEQ_ID = 1
                    Too bad we can't just put it in the branch setup.

                    Edited by: Bob37 on Mar 19, 2012 8:31 AM
                    • 7. Re: problem passing special characters from one page to another, APEX 4.1
                      921903
                      Thanks. I will try that out. The pages are loaded on apex.oracle.com, if you want to take a look, the link is

                      http://apex.oracle.com/pls/apex/f?p=4000:1:206236428139401::NO:RP:FB_FLOW_ID,F4000_P1_FLOW:115927,115927
                      • 8. Re: problem passing special characters from one page to another, APEX 4.1
                        Bob37
                        Let me know if you have any trouble getting it to work, If so, I'll need a userid, workspace name, password, etc.

                        Collections are pretty easy once you've worked with them and the documentation is very good. http://www.oracle.com/pls/apx41/search?remark=quick_search&word=collections&partno=
                        • 9. Re: problem passing special characters from one page to another, APEX 4.1
                          921903
                          getting error receiving page. Here's the credentials

                          userid : hb82011@hotmail.com
                          password: crazy88s
                          Workspace: RPC_WKSPACE
                          • 10. Re: problem passing special characters from one page to another, APEX 4.1
                            Bob37
                            What are the source and target pages? I don't see any pages with the procedures on them.

                            Edited by: Bob37 on Mar 19, 2012 10:05 AM
                            • 11. Re: problem passing special characters from one page to another, APEX 4.1
                              921903
                              The source page P37
                              Target P6

                              I did it on my test server at home. sorry I didnt mention that. I am trying to pass DOCKET_NUM and PO_NUM from page 37 to page 6. Branching to page 6 using the Add_Jobs button
                              • 12. Re: problem passing special characters from one page to another, APEX 4.1
                                Bob37
                                One thing I noticed is on the Set These Items on the Add_Jobs button, you had \P6_PO_NUM\. The backslashes do not belong there, only on the With These Items. I removed those backslashes from around P6_PO_NUM. You might see if that works now. If so. Great. You're done?

                                Otherwise here is what you need to do to get the collection process to work

                                On Page 37 then:

                                -You would change the Add_Jobs to Submit the page, not redirect. Remove the redirect stuff as well.
                                -Create the after Submit Process which creates the collection record as described above. Substitute your Page Item Names
                                -Have a branch which fires on the Add_Jobs button and redirects to Page 6 without passing any values.

                                On Page 6:
                                Create an After Header PL/SQL process as described above, which is the Select c001, c002..... to pick up the values you are passing. Substitute your page item names in place of the "target_page_items".

                                What you're doing is using the Apex Collections, thinking of them as a temporary table, where you're writing the values you want to pass into standard table columns and then reading the temporary table to pick up the values on the other side (page 6), where Apex branching and URL building isn't going to have any affect on the data.
                                • 13. Re: problem passing special characters from one page to another, APEX 4.1
                                  Bob37
                                  By the way, I just tested this in my app, and it worked fine. I was assuming when you said it didn't work, it was something basic rather than your setup.
                                  set these items (P6_DOCKET_NUM,P6_PO_NUM)
                                  with these values(\&P37_DOCKET_NUM.\,\&P37_PO_NUM.\)
                                  So, I'm now assuming when you said it didn't work, it was because you had \'s around the P6_PO_NUM in the Set These Items.

                                  Try that again and see if that works for you based on your original setup without any backslashes in the Set These Items specifications
                                  • 14. Re: problem passing special characters from one page to another, APEX 4.1
                                    921903
                                    I am getting this error on page 6

                                    ORA-01722: invalid number




                                    Technical Info (only visible for developers)
                                    is_internal_error: false
                                    ora_sqlcode: -1722
                                    ora_sqlerrm: ORA-01722: invalid number
                                    component.type: APEX_APPLICATION_PAGE_PROCESS
                                    component.id: 29492528116933152
                                    component.name: get_p37_values
                                    error_backtrace:
                                    ORA-06512: at "SYS.WWV_DBMS_SQL", line 904
                                    ORA-06512: at "APEX_040100.WWV_FLOW_DYNAMIC_EXEC", line 618
                                    ORA-06512: at "APEX_040100.WWV_FLOW_PROCESS", line 128
                                    1 2 Previous Next