This discussion is archived
5 Replies Latest reply: Jul 18, 2007 9:02 AM by 586285 RSS

Tabular Form - Column Link needs to Submit Form first and then Redirect?

BillC Newbie
Currently Being Moderated
Hi,

I have a tabular form. One column has a Link with a redirect to another page, passing it the value of the row, column... like normal.

But if the user makes changes to the form and then hits the Link before Submitting the form all the changes are lost.

I've tried onClick="javascript:doSubmit('SUBMIT');" in the element option area .. no good.. look through the forum too...

Any help would be appreciated,
Bill
  • 1. Re: Tabular Form - Column Link needs to Submit Form first and then Redirect
    VANJ Journeyer
    Currently Being Moderated
    You are on the right track, the page has to be submitted for the tabular form changes to be saved. What happens when you put that doSubmit() in the Tabular Form Element Attributes? Try a simpler column "link" first like javascript:alert('Click') to make sure that the link is being triggered.
  • 2. Re: Tabular Form - Column Link needs to Submit Form first and then Redirect
    BillC Newbie
    Currently Being Moderated
    Thank you for the reply Vikas.
         I created a tabular form in my TEST application in my Oracle APEX environment.
         http://apex.oracle.com/pls/otn/f?p=21120:2
         DEV:
              http://apex.oracle.com/pls/otn/f?p=4550
              Wkspace LIFE
              guest/qwerty1
         I put the link on ORDER_ID_DISPLAY just to go to page 1
         I put the onClick="javascript:alert('Click');" in the "Element Option Attributes"
         It never hits the alert().
         I also put the onClick="javascript:alert('Click');" in the "Element Attributes".
         All it does is go to next page.
    Bill
  • 3. Re: Tabular Form - Column Link needs to Submit Form first and then Redirect
    VANJ Journeyer
    Currently Being Moderated
    Try it now.

    I moved the JS call from the Tabular Form element section and modified the Column Link section to use the javascript:... as a URL target (instead of a "page in this application" target).

    Modify as per your needs. doSubmit('SAVE') should submit the page, fire the MRU save process and then branch as per the branches you have defined on the page.

    If you need to branch to different pages depending on which row was clicked and/or pass in values from the row clicked, you need something a little more sophisticated like
    function SetValuesAndSubmit(p_value1,p_value2)
    {
    $x('P1_HIDDEN1').value = p_value1;
    $x('P1_HIDDEN2').value = p_value2;
    doSubmit('SAVE');
    }
    where P1_HIDDENn are hidden page items.

    And call the function in your column link using
    SetValuesAndSubmit('#COL1#','#COL2#');
    Hope this helps.
  • 4. Re: Tabular Form - Column Link needs to Submit Form first and then Redirect
    BillC Newbie
    Currently Being Moderated
    Awesome Vikas!

    Works great..

    Here is the detail in case anyone in the future needs it:
    1.) javascript:SetValuesAndSubmit('#RM_REQ_ID#','#MEET_ID#');
         in the URL Link of the MEET_ID_DISPLAY column of
    my tabular report.
    2.) Created 2 new Items P36_HIDDEN1, and P36_HIDDEN2
    3.) Added:
         <script type="text/javascript">
         function SetValuesAndSubmit(p_value1,p_value2){
         $x('P36_HIDDEN1').value = p_value1;
         $x('P36_HIDDEN2').value = p_value2;
         doSubmit('SAVEREDIRECT');}
         </script>
         to a Region Source area.
    4.) In the "ApplyMRU" Multi Row Update I changed the Condition to:
         Request Is Contained within Expression 1
         Expression 1
              SAVEREDIRECT,SUBMIT

    5.) Created a Branch to Page #1 with Condition Request = Expression 1
         Expression 1
              SAVEREDIRECT
         Set these items: P38_RM_REQ_ID,P38_MEET_ID,P38_RESRVN_ID
         With these values: &P36_HIDDEN1.,&P36_HIDDEN2.,&P36_RES_ID.

    Thanks again! Bill
  • 5. Re: Tabular Form - Column Link needs to Submit Form first and then Redirect
    586285 Newbie
    Currently Being Moderated
    Hi Bill,


    Do u have a work space where you implemented it and one more thing can we link from a tabular form with another tabular form instead of the form in the second page.

    Thanks