Conditional branching after page submit

Hi all
I have a page where I need to submit and process the page and items(insert and update database) then branch to a certain page depending on which button was pressed. I have 4 buttons and each button should go to a different page, each button also needs to submit the page and process data(using an Apex DML process and passing 'SAVE' request in each button). the problem I'm having is that no matter which button I press the 'app branches to the first branch. I have 4 branches set to run after the process. Each branch should go to a different page depending on the button pressed. In each branch I have made the branch conditional based on the button pressed.
APEX seems to ignore the button condition(in Debug) it says unconditional even though the button is definitely conditional.
I'm running Apex 4.2.2
It seems as though when I pass a Request of 'SAVE' Apex treats all buttons with this request in the same manner?Regardless of which button was pressed?
Any ideas or alternatives?
Thankyou
Andrew

Your problem is with setting the request of all the buttons to "SAVE", it will always fire the first branch for all those buttons.
If you edit the DML process you will see the following:
Valid Update Request Values:
SAVE, APPLY CHANGES, UPDATE, UPDATE ROW, CHANGE, APPLY, APPLY%CHANGES%, GET_NEXT%, GET_PREV%
This tells you the request values that will perform an Update DML.
You could have one button be "SAVE", another, "APPLY CHANGES", another "UPDATE", and another "CHANGE".  They will all do the update DML for you and then the branches will have different request values to trigger off of.
Another option is to set the request of each button like this:
Button 1 - APPLY_CHANGES_INV
Button 2 - APPLY_CHANGES_SALE
Button 3 - APPLY_CHANGES_DELIV
Button 4 - APPLY_CHANGES_INSTALL
These would satisfy the valid update request value of APPLY%CHANGES%

Similar Messages

  • Conditional branch, after authentication

    We have recently implemented a list of passwords that users are not allowed to use. Basic stuff like 1234, abcd etc.
    I currently use a custom authentication, so i can quite easily stop a user from changing their password to a dissallowed one. But my issue is that i want to force current users to changer their current password if it breaks the new rules.
    I think that i should allow them to authenticate themselves using their current password, and then do a check to see if they should be branched to a specific screen to change their password.
    Basically i want to do a conditional branch after authentication.
    anybody implemented something similar? or anyone have any ideas?

    Create an application process - On Load: Before Header ....
    using a similar PL/SQL block like in my case:
    BEGIN
       IF NOT custom_authentication_pkg.password_valid (:app_user)
       THEN
          HTMLDB_APPLICATION.g_unrecoverable_error := TRUE;
          OWA_UTIL.redirect_url
                               ('f?p=&APP_ID.:102:&APP_SESSION.:PASSWORD_INVALID');
       END IF;
    END;and make this process conditional so it doesn't fire if the current page is in
    101 - login page
    102 - page for changing passwords
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • Date Picker null after page submit

    Hi,
    I have created an application with two regions. On one region a select statement displays the list of employees with their employee id's. On other region there is a select statement which shows the leave detail of every employee using range of date on where clause of select statement. Two date picker items are created on region one. when a name of employee is clicked on region one the employee id of that employee uses select statement in second region and its information should display. It is working well without date range. when I use dates in where clause it shows no data because date pickers goes null after page submit. Page is branchig to same page.
    I am not able to resolve why date pickers goes null.
    Oracle Database 11G
    Apex Version 3.0
    Sajjad

    In region one select statement retreives employee id's and there is also search item on region one searching employee names and it retain the value. but date pickers having same setup that you mentioned dos'nt retain values. If they retain values my problem will solve.
    When cliked on employee id select statement should execute using employee id and date picker values on another region on same page.

  • Page item value set in app process not maintained after page submit

    Hi -- I have a sequence of events that goes like this:
    1) Page 0 region REG_1 is rendered before footer
    - Region REG_1 uses javascript / AJAX to call App process PROC_1
    - PROC_1 sets Page1 item PAGE1_MESSAGE to X
    - After PROC_1 executes successfully, REG_1 does doSubmit()
    2) Page 0 region REG_2 is rendered before footer; this happens
    after the page submit done by REG_1. (Conditions ensure that
    REG_1 is not rendered again)
    - Region REG_2 displays PAGE1_MESSAGE (=X) in an alert.
    - Region REG_2 uses javascript / AJAX to call App process PROC_2
    - PROC_2 sets Page1 item PAGE1_MESSAGE to Y
    - PROC_2 sets Application item DEBUG to PAGE1_MESSAGE (this is for debugging)
    - PROC_2 sets Application item APP_MESSAGE to Y (this is also for debugging)
    - After PROC_2 executes successfully, REG_2 does doSubmit()
    3) After REG_2 submits the page, here's what I have:
    - Application item APP_MESSAGE = Y. Good. This is what it was set to in PROC_2.
    - Page 1 item PAGE1_MESSAGE = X. Bad. This is what it was set to in PROC_1.
    - Application item DEBUG = Y. Good. This at least shows that PAGE1_MESSAGE was
    set to Y within PROC_2... but for some reason that value is not being preserved
    after the app process is done executing.
    - There are several other application items set in PROC_2, and they're all correct.
    Any ideas as to why this is happening? It seems like this should be
    pretty straightforward: set the value, submit the page, the value should be what
    I set it to.
    Thanks,
    Carol

    Hi -- Thanks for the suggestions. First and 3rd (default value, or being overwritten by process or computation) aren't happening. The source for PAGE1_MESSAGE having is Always, Using app item PAGE1_MESSAGE... but I don't see what else could work here. Not sure if that's the problem.
    I've put an example on apex.oracle.com. Workspace is dew_mir_tor. Username is [email protected]. Password is Mir97Dew77!Tor. Application is 22679, RefreshAllTest.
    To reiterate the description in my original posting, but using the real application item/region/process names:
    0) Press Button REFRESH_ALL on Page 1. This branches back to Page 1.
    1) Page 0 region Refresh_All is rendered before footer
    - Region sends up an alert to show you it's working
    - Region Refresh_All uses javascript / AJAX to call App process REFRESH_CZAR (You'll see a "wait" window flash up briefly while the app process is running)
    - REFRESH_CZAR sets Page1 item P1_MESSAGE_1 to X (The text here indicates where
    the value is being set and when it should be displayed)
    - After REFRESH_CZAR executes successfully, region Refresh_All does doSubmit()
    2) Page 0 region Refresh_Non_Czar is rendered before footer; this happens
    after the page submit done by Refresh_Czar. (Conditions ensure that
    Refresh_Czar is not rendered again)
    - Region sends up an alert to show you it's working
    - Region Refresh_Non_Czar displays P1_MESSAGE_1 in an alert.
    - Region Refresh_Non_Czar uses javascript / AJAX to call App process REFRESH_NON_CZAR (You'll see a "wait" window flash up briefly while the app process is running)
    - REFRESH_NON_CZAR sets Page1 item P1_MESSAGE_1 to Y (The text here indicates where
    the value is being set and when it should be displayed
    - REFRESH_NON_CZAR sets Application item TEST_VALUE2 to P1_MESSAGE_1 (this just shows that P1_MESSAGE_1 was indeed set to Y in this process...)
    - After process REFRESH_NON_CZAR executes successfully, region Refresh_Non_Czar does doSubmit()
    3) After Refresh_Non_Czar submits the page, Page 0 region Display_Messages is rendered.
    It sends up an alert so you can see it's working, and then it displays the value in P1_MESSAGE_1.
    The value is still the one that was set in REFRESH_CZAR, not the one set in REFRESH_NON_CZAR.
    Note that Display_Messages sets P1_MESSAGE_1 back to null, so you won't see it in session state after it's displayed in the alert. But you can see that TEST_VALUE2 is set to the message from REFRESH_NON_CZAR.
    Hope this helps solve the problem!
    Thanks,
    Carol

  • Error-Message "Item not defined on current page" after Page submit - AJAX

    Hello,
    a lot of subpages (regions) are loaded over htmldb_get and displayed on a master page.
    The parts loaded over AJAX are reports. The report regions of these reports contain a hidden and protected field, which hold the page number (&APP_PAGE_ID.)
    This was necessary because I had to overwrite the standard pagination function $a_report on the master page. Otherwise the standard pagination function uses always the page number of the master page and not the page number of the loaded subpages. The overwritten function $a_report is placed in the master page header and searchs for the hidden + proteced field, containing the page number of the loaded subpage.
    This works already fine.
    But after submitting the master page with before loaded subpages over htmldb_get, I get following error message:
    Error Item ID (15348310159873659) is not an item defined on the current page .
    Setting the hidden + protected field on the subpage to never display, the error message disappear, but the pagination function doesn´t work any more.
    Where is the mistake I made?
    Greetings
    Michael

    Hello Ben,
    yesterday evening I read in short your answer, but today I can´t see your answer. Have you edited it again?
    My pagination function works fine and I would maintain it if possible.
    But now a new feature is requiered, which require a submit on the master page. The submit on the master page is not possible due to the hidden field on the loaded subpage, containing the page number for the pagination function.
    Using a normal text field (not saving state) works as long as the text field is visible (condiational view != never). But this information shouldn´t be visible to the user.
    I thought, perhaps a cleanworkaround exists.
    As dirty workaround I could place the information about the actual page number in the report themself (static invisible column). But as soon as the column is invisible (not shown), I have no access on this value
    With a normal hidden html-input-element (not a APEX-Item) in the report regions header of the subpage, holding the page number, I get a http 400 error on page submit.
    An I-Frame is not really a solution, because the master page contains several subpages, which should only be loaded and displayed on demand and not immediatly on page load.
    Greetings
    Michael
    Edited by: user6044915 on 31.03.2009 00:27

  • Conditional Branch after an service callout

    Hi All
    I am new to configuring services in OSB.What i want to do is first call a service and depending upon the returned value ,route to other services.But the result of the service callout is availabe in a variable ,say responseBody,and for conditional branch we need only xpath/xquery to test conditions.
    Please Help.
    Regards,
    Chinmay

    Hi All
    I am new to configuring services in OSB.What i want to do is first call a service and depending upon the returned value ,route to other services.But the result of the service callout is availabe in a variable ,say responseBody,and for conditional branch we need only xpath/xquery to test conditions.
    Please Help.
    Regards,
    Chinmay

  • Remember values in form after page submit

    Hi there,
    im absolutely new to APEX (as u can see it`s my first post ;)), i read the documentations i found on the oracle website and know at least the basics...
    So i started to create my first application and got already my first problem :D Maybe you can tell me if what i want to do is possible and how to do it.
    I have several pages with a form on the left side and a sql report on the right side.
    The form contains some fields which are list of values (fields which contain foreign keys so the user can just select a valid value). next to every list of value field i have a button. when the user clicks on the button i have a branch to the same page and the sql report gets updated. depending on which button next to the list of values with the foreign keys was pressed it shows the complete table the list of values references to (so the user can see what the foreign key he is selecting actually contains). after some work i finally made this work.
    But the problem is: When the user enters some values into the form and then clicks on a button to see what the foreign keys contain the values he already entered are gone. But i want the values he entered to stay in the form after he pressed the button. is there a easy way to do that? the only thing i could imagine is to create a variable for every form field, save the current values into the variable before the page gets submitted and write the values of the variables back into the form when the page reloads. but that sounds kind of stupid... i would have to do that for every page of this kind (which are a lot). so is there a better way?
    thx a lot :)

    Hi Fennek,
    If you created the Form using a wizard, it is possible that your page has a "reset page" process on it. If it has, either set a condition of Never for it or delete it. This process will clear the values for all items on the page.
    If you don't have this process, check the branches on the page. It could be that one of them has a Clear Cache setting that clears the values for the page - just remove the setting to stop that happening.
    Andy

  • How to keep up the session state values uncleared after page submit

    hi,
    i am using Application Express 4.0.2.00.07
    and 11g
    i have created a tabular form manually useing apex_items.
    select apex_item.checkbox(1,null) as "check",
           APEX_ITEM.DISPLAY_AND_SAVE(4,line_item_no) as "Line Item No",
           APEX_ITEM.DISPLAY_AND_SAVE(5,line_item) as "line item",
           APEX_ITEM.text(6,module) as "Modulle",
           rstag as "RS tag",
           *apex_item.text(2,null) as "FS Name"*,      --"fsname" and "fstag" are not columns of this table(pli)
           *apex_item.text(3,null) as "FS Tag"*
    from pli where pid = :P17_PID
    order by line_item_no deschere on submit, data gets inserted into the another table(fli),(whixh contains all these columns)
    after the page is submitted it returns to same page,
    i want the apex_items's text fields to retain the submitted values after returning to the same page
    can you tell me how to achieve this.
    thanks,
    Little Foot

    hi,
    can you help me to use this collections,
    i have created a collection processdeclare 
      la_cks wwv_flow_global.vc_arr2;
    begin
      htmldb_collection.create_or_truncate_collection('UPDATEE');
      htmldb_collection.create_or_truncate_collection('INSERTT');
      for i in 1..htmldb_application.g_f01.count
      loop
        if htmldb_application.g_f01(i) is not null then
          htmldb_collection.add_member(
              p_collection_name => 'UPDATEE',
              p_c001            => htmldb_application.g_f01(i),
              p_c002            => htmldb_application.g_f02(i),
              p_c003            => htmldb_application.g_f03(i),
              p_c004            => htmldb_application.g_f04(i),
              p_c005            => htmldb_application.g_f06(i),
              p_c006            => htmldb_application.g_f07(i),
              p_c007            => htmldb_application.g_f08(i),
              p_c008            => htmldb_application.g_f09(i));
        else
          htmldb_collection.add_member(
              p_collection_name => 'INSERTT',
              p_c001            => htmldb_application.g_f01(i),
              p_c002            => htmldb_application.g_f02(i),
              p_c003            => htmldb_application.g_f03(i),
              p_c004            => htmldb_application.g_f04(i),
              p_c005            => htmldb_application.g_f06(i),
              p_c006            => htmldb_application.g_f07(i),
              p_c007            => htmldb_application.g_f08(i),
              p_c008            => htmldb_application.g_f09(i));
        end if;
      end loop;
    end;            then when creating a report on collections i am unable to proceed,
    in sql report i used select apex_item.checkbox(1,null) as "check",
           APEX_ITEM.DISPLAY_AND_SAVE(4,line_item_no) as "Line Item No",
           APEX_ITEM.DISPLAY_AND_SAVE(5,line_item) as "line item",
           APEX_ITEM.text(6,module) as "Modulle",
           nvl(rstag,APEX_ITEM.text(7,null)) as "RS tag",
           apex_item.text(2,'klklk',null,null,' readonly="readonly" ') as "FS Name",
           apex_item.text(3,null) as "FS Tag"
          from htmldb_collections
    where collection_name = 'UPDATEE'says rstag invalid indentifier...,
    can you tell me how to use this collections to achieve my purpose.
    i tried http://www.oracle.com/technetwork/developer-tools/apex/tabular-form-090805.html
    so i need to use collections in this way only...!
    can i make collections to just collect values from two columns and then put those values to the respective rows in their columns...!!!
    guide me to achieve my requirement.
    Thanks,
    Little Foot
    Edited by: Little Foot on May 10, 2011 5:00 AM

  • Close windows after page submit

    Hi,
    is it possible to close the windows after the page had been submited (thru a button)?
    Vincent

    Hi,
    I found that I can do it by branch to another popup page and include a on load procedure whcih close the pop up windows.
    vincent

  • After page submit, cursor is displaced :(

    Hi there developers!
    Probleb:
    I have a textfiled that always submits when "Enter" is pressed.(Redirects to the same page)
    But the problem is that when i press "Enter"(or "SUBMIT" button) and the page is submitted and redirected to the same page, my cursor(focus) goes to next textfield. I want it to stay on the first textfield. In any other languages and programming environments there are "TAB sequences". "Sequence" in APEX
    is only for display or process order.
    Is it possible to control that in APEX.
    Best Regards,
    Ruslan.

    Yes and No. there is no such parameter as tab-sequence (like in app developer ide's), but if you play around with item parameter "Sequence" - its not only the position in the window, it also works as tab operator. tab also tabs to other page objects like images, buttons and labels but if you put the form correctly - it works like a charm.
    take a large form page, tab through it: 1) it tabs items (text fields) 2) tabs buttons 3) tabs browser fields (addess bar) 4) tabs item labels. so its kinda working..
    try putting cursor on the first item that has to be filled with the script i pasted.

  • Shuttle Control: Keep selection after page submit

    Hi @all,
    I tried out Carl's shuttle control.. GREAT work!
    Now I have a question: Is it possible to recall the page (after hitting a button) and keep the control with the selections/moves made without writing them into the database?
    Thank you!
    Best regards
    Steven

    Hello All,
    After a long think, I've decided to separate this into a 2 applications.
    But still would have liked to hear from the community how I could have over come this.
    Maybe have 2 application, with one redirecting to the other after login?
    Thanks Jan

  • Error using conditional branch node in OSB

    Hi,
    We are using Oracle Service Bus in our project. I have created the following steps in the OSB Proxy Service:
    1) Assigning a value in a variable inside a request pipeline.
    2) I am using a Conditional Branch after the pipelined pair. The branching will happen according to the value of that variable, I assigned in the pipelined pair.
    Here we are getting an error in OSB test console:
    The invocation resulted in an error: Unknown error while processing message for service ProxyService MHEducation/CCAuthorization/CCAuthorizationProxyService.
    I am getting the following log in the console:
    <Nov 5, 2009 6:14:04 PM IST> <Error> <OSB Kernel> <BEA-382016> <Failed to instantiate router for service ProxyService MHEducation/CCAuthorization/CCAuthorizationProxyService: com.bea.wli.sb.management.BrokerManagementException: com.bea.wli.
    sb.stages.StageException: The xquery cannot have an unbound current node.com.bea.wli.sb.management.BrokerManagementException: com.bea.wli.sb.stages.StageException: The xquery cannot have an unbound current node.
    at com.bea.wli.sb.pipeline.BranchNode.<init>(BranchNode.java:89)
    at com.bea.wli.sb.pipeline.RouterCompiler.compileNode(RouterCompiler.java:129)
    at com.bea.wli.sb.pipeline.RouterCompiler.compileFlow(RouterCompiler.java:115)
    at com.bea.wli.sb.pipeline.Router.<init>(Router.java:135)
    at com.bea.wli.sb.pipeline.RouterCompiler.compileRouter(RouterCompiler.java:89)
    Truncated. see log file for complete stacktrace
    com.bea.wli.sb.stages.StageException: The xquery cannot have an unbound currentnode.
    at com.bea.wli.sb.stages.expressions.ExpressionHelper.validateXQuery(ExpressionHelper.java:481)
    at com.bea.wli.sb.stages.expressions.ExpressionHelper.validate(ExpressionHelper.java:59)
    at com.bea.wli.sb.stages.expressions.ExpressionHelper.getExecutor(ExpressionHelper.java:325)
    at com.bea.wli.sb.stages.expressions.ExpressionBuilderImpl.getExecutor(ExpressionBuilderImpl.java:151)
    at com.bea.wli.sb.stages.expressions.ExpressionBuilderImpl.getExecutor(ExpressionBuilderImpl.java:143)
    Truncated. see log file for complete stacktrace
    >
    Any suggestion why am I getting the error?
    Chandrachur.

    check if your conditional branch uses quotes around the compaired value
    so
    /body/myinput = 'myvalue' instead of
    /body/myinput = myvalue

  • Conditional Branching with quiz slides not working

    Attempting to use conditional branches with quiz slidescauses
    the other quiz slides in my presentation to not work correctly. I
    am attempting to create a 'test-out' pre-quiz for a segment of
    slides in the presentation. I followed the instructions to add
    conditional branching per page 46 of the Breeze Presenter User
    Guide to obviously no avail. Is there a simple straightfoward
    manner in which someone has successfully used conditional branches
    with their quiz slides in their presentation?

    Hi,
    I had the same issue.Apparently as of now PDF templates do not support conditional formatting for XML Publisher.
    See Tim Dexter's response to my query at the bottom of this thread...
    Re: Using the '%' operator in microsoft word template builder for XMLP
    I could get some conditional formatting to work on the pdf template but only for the form field font,size and styles using Javascript, but I don't think there is a way to display values for the form field based on an if condition...
    Lavina

  • Problem with page submit and opening a popup.

    Hello All,
    Apex 3.1.2
    I have a button that submits a page and opens a pop-up. I'm new to javascript so I'm really hacking my way through this, so syntax tips are very useful :)
    I'm using the code below on the button, my popup opens but then my main page seems to refresh and immediately covers up the popup. How do I get the popup to stay in front of the main page? Is there a problem with my main page submit?
    Here's my URL target for the button...
    javascript:doSubmit('ADD_TO_GROUP');javascript:popUp2('f?p=&APP_ID.:2:&SESSION.::::P2_OPPORTUNITY_NUMBER: &P6_OPPORTUNITY_NUMBER.');
    Thanks Much!
    p.s. ADD_TO_GROUP is my button name, am I using that correctly in doSubmit? It seems like I can put anything there and I still get the same behavior.
    Edited by: blue4speed on Mar 24, 2011 8:33 AM - added p.s.
    Edited by: blue4speed on Mar 24, 2011 9:34 AM

    ThomasL wrote:
    p.s. ADD_TO_GROUP is my button name, am I using that correctly in doSubmit? It seems like I can put anything there and I still get the same behavior.
    --> Are your on/after submit processes conditional?
    For the javascript, you could also try to put the javascript code into an html region of your page, with condition set to a REQUEST value, or the value of an item that you set on submit.It looks like what's happening is the page is branching back to itself and that's why my the popup is pushed to the background. I created a conditon on the branch that said request != "ADD_TO_GROUP" (my button request). This kept the focus on my popup but gave me the error that the page had no branch!
    How do I get my main page to submit and the popup to appear IN FRONT of the main page?
    Thanks!
    Edited by: blue4speed on Mar 24, 2011 10:16 AM

  • Delete from wwv_flow_files after auto submit

    Hi,
    I have a situation in a file upload page (based on the How TO Doc), where auto submitting is done when an item (select list with submit) is used. We stored the uploaded file in a custom file and normally it works. But when the select list item is used before the submit button is pressed, then the file is automatically upload. (see posted topic Re: File Upload Submit Woes
    In this previously posted topic, Scott Spadafore described a workaround using a computation where to delete files from wwv_flow_files. I implemented it and it works fine, when auto submit is done. But when doing this, my doSubmit Process is not executed properly, this means storing the uploading files in a custom table fails.
    I think computation (after Submit) is done before validation and processing (after submit).
    Anyone any idea how to solve the problem (to delete file from wwv_flow_files after auto submit is done and to insert uploaded file in in a custom file when submit button pressed)?
    Conditional computation does not have "When no button pressed" condition or something like this.
    I'm searching for a solution to implement a computation (with deleting auto-submitted files from wwv_flow_files), but only when no submit button was used.
    Thomas

    Thomas,
    When a button is used, or a doSubmit submits the page, the "request" value is set and is available for inspection by computations, processes, etc. In your case, you cannot use the declarative "when button pressed" controls, but you can use built-in condition types that evaluate the request or you can code pl/sql expression conditions like :REQUEST = 'button name'.
    Scott

Maybe you are looking for