9 Replies Latest reply: Sep 10, 2013 5:06 PM by n_shah18 RSS

    On load process returns null value but on refresh loads the values ??!!

    n_shah18

      HI all

      Using apex 4.1.1 Linux oc4j 11g

      I am building a functionality which would allow to register by email.

      Page 1

                The user enters an email address  ,First name&  last name,Insert statement is executed

      select count (*) into c_email  -- if 0 then the person doesn't exist and registration is permitted

        from sor_notification_person

        where sor_notification_person.EMAIL_ADDRESS =P_S_EMAIL_ADDRESS;

       

        if c_email=0 then

      -- Package.procedure send email and does the insert

        SOR_NOTIFICATIONS_PKG.signup_person (  P_S_EMAIL_ADDRESS => P_S_EMAIL_ADDRESS,

                                                P_S_FIRST_NAME => P_S_FIRST_NAME,

                                                P_S_LAST_NAME => P_S_LAST_NAME,

                                                P_S_CONFIRMED_EMAIL => P_S_CONFIRMED_EMAIL,

                                                P_S_SESSION => P_S_SESSION,

                                                P_S_APP_ID => P_S_APP_ID,                                     

                                                P_B_SUCCESS =>P_B_SUCCESS) ;

       

      Page 2

      On clicking or copying pasting URL received in email.I have on load process which checks the checksum value in DB and populates the data.

      declare

      ct number;

       

       

      P31_checksum varchar2(30);

      Email varchar2 (90);

      F_name varchar2 (40);

      l_name varchar2 (40);

      P31_TEST varchar2(40);

      begin

       

       

       

       

      :P31_TEST := null;

       

       

       

       

          SELECT count(*)  into ct

         FROM SOR_NOTIFICATION_PERSON

           where SOR_NOTIFICATION_PERSON.checksum=:C;

         

          

              dbms_output.put_line(ct);

          

        if ct > 0

           then

        

          SELECT SOR_NOTIFICATION_PERSON.email_address ,SOR_NOTIFICATION_PERSON.first_name, SOR_NOTIFICATION_PERSON.last_name  into  Email,F_name,l_name

         FROM SOR_NOTIFICATION_PERSON

           where SOR_NOTIFICATION_PERSON.checksum=:C;

        

           :P31_TEST := 'Y';

            :P31_EMAIL_ADDRESS:=Email;

            :P31_FIRST_NAME :=F_name;

            :P31_LAST_NAME:=l_name;

         else :P31_TEST := 'N';

      -- dbms_output.put_line(P31_TEST);

       

      end if ;

       

       

      end ;

       

      Problem When I display the hidden item I can see the checksum value  but the P31_test is always null on load.when I hit refresh page P31_test validates & displays the value .

      Both the items are set to only when value in session state is null.

       

      What could be the reason for it not load even the process is defined as Load before region /once per page visit..

       

      Thanks for your help.

        • 1. Re: On load process returns null value but on refresh loads the values ??!!
          Tom Petrus

          How did you define P31_TEST (source type, used when)? Is there a fetching process (the apex component)?

          • 2. Re: On load process returns null value but on refresh loads the values ??!!
            n_shah18

            Hi Tom

            Thanks for the prompt response

            :P31_test

             

            current valueinsession
            sourceattribute

             

             

            There is no fetch or any other process related to :P31_test only dynamic action

            If :P31_test=Y then do something else :P31_test=N then do something

            • 3. Re: On load process returns null value but on refresh loads the values ??!!
              Tom Petrus

              Oh - is this about firing a dynamic action which has a condition on it then (an actual condition, NOT a WHEN condition : 2 different things)?

              • 4. Re: On load process returns null value but on refresh loads the values ??!!
                n_shah18

                 

                 

                31. Registration address

                 

                 

                 

                When

                 

                Top

                 

                jQuery
                P31_testList of Values
                Y

                 

                 

                True Actions

                 

                Top

                 

                The following actions will be fired when the 'When' condition is met, or when it is 'No Condition'.

                EditSequenceActionFire On Page LoadSelection TypeAffected Elements
                Edit10ShowYesRegionSelect the type Of Search

                 

                Add True Action

                 

                 

                False Actions

                 

                Top

                 

                The following actions will be fired when the 'When' condition is not met.

                EditSequenceActionFire On Page LoadSelection TypeAffected Elements
                Edit10HideYesRegionSelect the type Of Search
                Edit20AlertYes

                 

                Add False Action

                 

                 

                Advanced

                 

                Top

                 

                 

                 

                 

                Condition

                 

                Top

                 


                substitutions

                 

                • 5. Re: On load process returns null value but on refresh loads the values ??!!
                  Tom Petrus

                  Okay At what processing point is your "onload code" set? (Eg after headers)

                  Or did you put this in a plsql block in a dynamic action which triggers on load?

                  • 6. Re: On load process returns null value but on refresh loads the values ??!!
                    n_shah18

                    At what processing point is your "onload code" set? (Eg after headers)

                    PROCESS POINT =ON LOAD-BEFORE REGIONS

                     

                    Or did you put this in a plsql block in a dynamic action which triggers on load?

                    Dynamic action is just to show or hide based on value of :p31_test If :p31_test='Y' then show regions on page else hide region and show alert.

                    • 7. Re: On load process returns null value but on refresh loads the values ??!!
                      Tom Petrus

                      Okay - not sure then. On a blank new page I can have process assign a value to the session state of the item, and the item will have that value when the page has rendered (at least with that source type). Dynamic actions work. As I'd expect. I'm not sure what is going 'wrong' then.

                      I'll only check back tomorrow but here are some pointers:

                      • create a workspace on apex.oracle.com and import your page there. Share developer credentials and the workspace name with us. That way we can inspect and don't need to do the back and forth until we hit something special we both lost sight of.
                      • when the page has loaded and you hit session from the developer toolbar, what is the state of P31_TEST? Does it have a value?
                      • try to run the page in debug and see if you can spot anything going on with the session state of P31_TEST - maybe you'll stumble on something
                      • 8. Re: On load process returns null value but on refresh loads the values ??!!
                        n_shah18

                        Tom I created work space on oracle.apex.com

                        URL http://apex.oracle.com/pls/apex/apex/f?p=71786:1:108146546999809::::: login

                        work space name sor                 username test /test

                        It is working there for me over here but not in app page.


                        I tried exporting my page to website oracle.apex but it wont let me install it as it comes from different app. Still trying let see how it goes

                        • 9. Re: On load process returns null value but on refresh loads the values ??!!
                          n_shah18

                          Hey Tom Thanks for your help finally figured out the problem and the solution Dynamic action fires on load and false out. Changed process to execute  Before Header It is working for me now. Thanks for your time and insight; it helped me in debugging . Cheers mate.