How to keep transaction control in a wizard of more than one page

How do I control a transaction across multiple pages with multiple row DML?
I have a complicated business process. I want to build a wizard in my application. For example, to apply for a loan from a bank. A sequence of pages to take the user through a series of steps in the process, click Next and Previous to navigate the pages, click Cancel to undo, click Ok on the final page to commit work.
I know there is a wizard widget in HTMLDB to generate pages 1 .. n in a wizard. But ...
My question is this? How do I control the transaction. How do I stop HTMLDB commiting the steps as I go along. Somehow I want HTMLDB to remember all the information. I want to save everyting or nothing at the end of the process.
I know this works if each page is a form with items. You can build a summary page. But what if a step requires multiple rows.
For example
Step 1 : A report to select Department to a form to Create/Update department
Step 2 : A report to Form to Create/Update/Delete all Employees for that department.
Step 3 : A report to Form to Create/Update/Delete some other thing for that department.
What if
I update department Sales, press Next, delete employee Rod, create employee Jane and Freddy, press Next. I have a change of heart to decide not to hire Jane and Freddy but keep Rod on to give him a second chance so I press Cancel on Step 3. HTMLDB has already saved the changes to the employees. How do I rollback to the original state of the world.
1 ) f_g memory structures? No. I know I can get at a data structure if I use a multiple row update tabular form. Using the htmldb_application.f_g0n index by tables in the database. But I do not think it is possible on page x to get at the arrays for both the current page and the previous page? I dont want to use a tabular form in any case.
2 ) Database Memory Structures ( in package x create type t is table of t%rowtype; ). No.
3 ) Global temporary table ( create global temporary table t .. on commit delete rows )? No.
2 + 3 is not an option because HTMLDB seems to me to use a connection pool. The session in the browser is constant. The session to the database USERENV('SESSIONID') may change every time you click something or refresh the page. In the web model every time you request an action you connect to the database with a new session.
3) My solution. Have a copy of all the relevant tables. Do dml on the copy using the htmldb session as a unique identifier. Then to move the data from the copy tables to the real tables at the end of the process. Hope I catch all the cancel events to delete data from the copy tables. Just in case run a batch job run in the night to clean out the copy tables assuming no one is using the process at the time.
My solution is ugly ! There must be a better way ?

Ahhh, sorry for the confusion. What you need are "Collections". If you click the "Review Demonstration Applications" link then install the "Collections Showcase", this should give you a good working sample.
Collections are comprised of an HTMLDB_COLLECTIONS package and an associated table. Use the package for creating a collection and adding members (rows) and use the table to query what's in your collection.
Essentially, here's what you need to do. Let's assume your multi-row form is on page one and you have a confirmation page on page 2:
- Create a process that fires on submit of page one that uses create_or_truncate to create your collection.
- In the same process, loop over your collection items and add them (as members) to the collection.
- Make sure your multi-row form queries from the collections view. This way if you go to page 2, then back to page 1, you will see your rows. When you go to page 2 again, you can just over-write the existing collection. There's another option, but I'll list that later.
- Create a process on page 2 to loop over the collection view and insert the rows into a table. Make this conditional based on the button you press, such as "Save".
- Extra credit: Either the collections package or the htmlb_utilities package as an md5 function. You can call this when querying the data out of the collections table, then call it again as you are looping over the data on submit. Basically, you are checksumming the row on the way out, then again when the page is submitted. If the 2 are equal, the data is unchanged. If they are not equal, the data has changed. Based on your needs, you can use this technique to insert / update records. I have an app that uses this technique because I have a before update trigger on the table that I only want to fire if the user actually updates a particular row.
Hope this helps,
Tyler

Similar Messages

  • SMARTFORM: how to create 3 copy (each copy can print more than one page)

    SMARTFORM: how to create 3 copy (each copy can print more than one page)
    Hello everyone.
    my user want to have form that print 3 copy.
    such as 1 copy description = master,  2 copy description = copy 1 ,3 copy description = copy 2.
    so i create 3 page . I copy from page 1.
    and in each page there is main window which can have data more than 1 page.(such as have a lot of sale data ,it's take 2 page for show output .so it's take 2 page in each copy)
    please help me.
    how to set page and window in each page for print 3 copy and each page can have main window that print more than 1 page

    Hello Vinit.
    thank you very much for your help.
    could you help me more please.
    in below code
      DO NAST_ANZAL TIMES.
    l_counter = l_counter + 1.  " << pass this to FM and use for the TEXT to print
    CALL FUNCTION LF_FM_NAME
               EXPORTING
                         COUNTER = l_COUNTER   " USE this to derive the text into PRINTOUT
    enddo.
    Now i out of office .so i cannot test.
    where do i set NAST_ANZAL for 3 ?
    can i input ?
    NAST_ANZAL = 3.
      DO NAST_ANZAL TIMES.
    l_counter = l_counter + 1.  " << pass this to FM and use for the TEXT to print
    CALL FUNCTION LF_FM_NAME
               EXPORTING
                         COUNTER = l_COUNTER   " USE this to derive the text into PRINTOUT
    enddo.
    Edited by: dittaporn nanasilp on Mar 12, 2011 3:33 PM

  • How can i get my HP eney to scan more than one page into a single pdf?

    i want to scan mulitple pages into a single document

    Hello,
    Please click HERE to access the steps that should resolve the issue for Win 7.
    Please click HERE to access the steps that should resolve the issue Win 8.
    Go to section How to scan with HP software  >> How to scan multiple pages into a single file 
    Regards,
    Jabzi
    Give Kudos to say "thanks" by clicking on the "thumps Up icon" .
    Click "Accept as Solution" if it solved your problem, so others can find it.
    Although I am an HP employee, I am speaking for myself and not for HP.

  • How to use beans in more than one page

    hello members,
    can somebody tell me how to make beans availabe to more than one page ,i used scope variable as "application"
    in which i set the value of java bean and in that page it show all values of that bean even it modified
    but when redirect to another jsp page it does not show modifided value,it shows its default value
    what shld i use tell me
    following thing that i use in forwarded jsp page
    <jsp:useBean="same id in previous jsp page", class="same class", scope="application"/>
    and then i am using boolean variable which set false default ,but i set it manually though
    setfuction (assume) in original jsp page,but in redirected page it showing it value fasle
    i don't know why
    can somebody (Bean Bond) help me in this problem
    i will very thankfull to you
    plz..................

    My dear friend,
    your scope is wrong. Since you run a JSP page and you want it available everywhere, the only thing that all pages have common is session. So changing your bean scope to session will keep the bean variables and the rest you have on it.
    Try it and let me know.

  • How to export or delivery report for Excel for more than one sheet in OBIEE

    Hi Experts,
    How to export or delivery report for Excel for more than one sheet in OBIEE 11g? (Every time, I can only see one sheet.)
    Is it possibl to implement this requirement?
    Thanks.

    there are 2 oprions,
    One is have your tow report in a single compound layout of analysis and keep the report in dashboard and give report links.
    it will cath both your report.
    Suppose your analysis are different.
    Then you have the option of printing it to a PDF. on ritght top of Dashboard, Print - > Printable PDF.
    you ca export to PDF no to excel.
    mark if helps,
    fiaz

  • How do I set or get firefox to print more than one all pages the print using verizon emails is there a setting to change I have been told by verizon techs it is not my printer

    when opening an email using verizon emails I can only print one page. I have checked an I do not have a printer or computer problem because the printer prints more than one page with others such as gmail. We feel there is a print setting in firefox that needs to be changed. How do I change this??

    That is usually caused by a few different Bugs in Firefox, which seem to be fixed in the Firefox 4.0 betas.

  • How do I get the text to flow throughout more then one page.

    Hello,
    I am currently using LiveCycke Designer to create a scholarship for my company. I created fields for the form and I would like to insert a text to describe the scholarship. When I insert the text, it doesn't flow onto the next page. I've tried creating a subform and clicking "flowed" and "allow page breaks within content". I also clicked auto-fit for the height, but it just makes a line. For the text box, I've clicked "Expand to fit on the height". It is also a dynamic XML Form. Is there anything else I should be doing?
    I could always send the file to someone to see if they can figure it out.
    Thank you,
    Natalie

    Thank you so much !
    but the link doesn't seem to work. It says that the URL is not in the correct format for an Acrobat.com document link.
    Natalie
    Date: Wed, 12 May 2010 07:53:12 -0600
    From: [email protected]
    To: [email protected]
    Subject: How do I get the text to flow throughout more then one page.
    Here is the corrected form..Even you you set the Subform type to "Flowed" to the subform where the Text box resides, you did not set the Page1 to Flowed (which is the key)..But when I make the Page1 type to "Flowed", all your fields above the Scholrship text boxes' Subform will go one below another.. To fix this, first I have select all the fields and wrap them into a subform and then set the Page1 to Flowed..
    https://acrobat.com/#d=XQ1yfV8fCk85M7sRLD*-gg
    Thanks
    Srini
    >

  • I have an HP Photosmart C4180 all in one printer scanner and copier, I can't figure out how to scan more than one page at a time and then send as a PDF file via email

    I have an HP Photosmart C4180 all-in-one, printer, scanner and copier.  I can't figure out how to scan more than one page?  It will only let me do one page at a time and then I have difficulty sending pages 1, 2 and 3 as one docuement.  Any ideas??
    Thank you, Jetteski

    Hello Jetteski,
    Hello Jetteski, Thanks for the post.
    Since you are running a MAC, check the below links for some excellent information on scanning.  Good Luck!
    http://goo.gl/M8Cl2
    http://goo.gl/cufK6
    http://goo.gl/OTQoR
    I work for HP but my posts and replies are my own....Thank you!

  • How to use more than one page to design a form-like report???

    Hi
    I am designing a form-like report. and widening the repeating frame to contain all the page or the window like this page:
    Image: !http://up1.m5zn.com/photo/2008/12/21/07/e728mos12.jpg/jpg!
    Now there is no space at the window to complete designing the report!
    How to make the repeating frame to contain more than one page or one window to complete designing the report?

    change Vertical Panels per Page to 2 (or more as needed) for the Main Section of Layout Model.

  • How do you fax more than one page at a time?

    How do you fax more than one page using the phone?

    Hello @spirittoo, 
    I am not quite sure what you mean.
    Are you using a third party app to send faxes from a cell phone?
    In case you are having an actual fax issue, I have included the following links.
    Send a Fax from the Scanner Glass or the Automatic Document Feeder
    Fax Sending Fails Intermittently or Fails for Only One Recipient
    Aardvark1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!

  • How can I see if my program is for more than one user? We think we have bought in design for more users, but can not find out how to get in for more than one?

    How can I see if my program is for more than one user? We think we have bought in design for more users, but can not find out how to get in for more than one?

    If you bought a CC for team, you can log in at http://adobe.com and insert the e-mail that you gave at the moment at the purchase and than you can manage and see you product/plan/team.
    If I was not clear you can use the following link to help you solving your issue:
    Creative Cloud Help | Manage your Creative Cloud for teams membership
    If your not clear about this situation, contact with an agent of Adobe, by chat or phone. Use the following link to see the type of support you have on this matter:
    http://adobe.com/getsupport
    I think this will help you.
    Regards

  • How can I have more than one page open at a time?

    I would like to have more than one page open at a time- not tabs, but whole pages. How can I do this? I want to be able to have the pages side by side, instead of having to switch back and forth.

    Fox Splitter (formerly Split Browser): https://addons.mozilla.org/firefox/addon/4287

  • How to multiple/ parellal sets of books to generate more than one financial statement based on different (or the same) accounting principles.

    How to multiple/ parallel sets of books to generate more than one financial statement based on different (or the same) accounting principles.
    My Client needs Parallel Ledger in SAP B1 similar like SAP ECC. Is this functionality available ?

    Dear Mr. Nagrajan,
    Thank you for your response. I have already gone through documents but not able to understand. Is there any setup for this ? or its just work around i.e. using template and special field in JV i.e. Ref. 1 /2
    My doubts :
    I understand that Chart of Account structure is one and common for IFRS and other accounting method. We need to create only those account separately ( 2 times with prefix like IFRS revenue account, GAAP Revenue account).
    Now at time of entry, Assume some entries / adjustment are specifically for IFRS and not for other ledger. In this case, What need to do ?
    You have mentioned about DTW approach but do we need to insert all JV's again with other ledger ?
    Someone suggested that if any entry which are specific to IFRS Ledger, We need to user Ref.1 /2 column or Transcation code column and in which we can put IFRS
    Based on this, Need to create 2 seperate template for IFRS and other ledger for all report.
    This is my understanding of Solution in SAP B1. Please help me to clarify my though process
    Please do needful.If you have done implemenation and if you can share doucment, it would be great help.
    Email :[email protected]

  • How to handle form with more than one page in struts

    Hai,
    i have more than one page in my struts web apps. each page has a form & i have submit button @ last page. I navigate between these pages using titles. data has to exist when i come back from another page(i.e i am in page1 i have some fields called name & address as textfield, i move to page2 & then i go back to page1 @ that time i should have the name & addess values that i entered previous in the corresponding textfield) & finally when i submit need to get values form all these pages.
    Plz tell me how to do this.

    Hi prasadmca ,
    1.Try to store those value in session variable
    2. or else store those value in DB

  • CS3: Table on more than one page - How can I get the UIDRef's of the pages?

    Hi
    I have a table over more than one page. How can I get all UIDRef's of the pages who contain parts of the table?
    Thanks
    Hans

    Hi
    Thanks for the answer.
    - How can I get all page items of a table?
    - One other question: If I have a table over two pages (side by side) there is only one page item of the table. Right? How can I get the two pages (UIDRef) in that case?
    Thanks
    Hans

Maybe you are looking for

  • Open links to documents with Office Web Apps

    Hi, I am trying to configure SharePoint 2013 and Office Web Apps Server 2013 in a Multi Tenant environment for a client that has specific requirements when it comes to document handling. They have a number of document libraries where the majority of

  • DM 3.0.0.665: Disabled flag "Engineer To" is not saved

    Hi, I disabled the flag "Engineer To" for a table in the logical model in the Entity Properties and saved the changes. When I now engineer the logical to the relational model, the table is not taken into the relational model. But after closing and op

  • GetDefinitionByName not finding class in externally loaded SWF

    In my app, I have an external SWF that contains a bunch of movie clips that I want to instantiate in my main swf. I have checked the "Export for ActionScript" and the "Export in first frame" box in the movie clip in Flash. In my main SWF, I have acti

  • How to create an intro similar to the Mary Tyler Moore Show

    Hi Everyone,    This is literally my first attempt at working with After Effects. I was wondering how to create an intro similar to the text animation found in this Mary Tyler Moore Show intro video: http://www.youtube.com/watch?v=Z1GC6yXZ4e4    I ha

  • IPhone wired internet connection

    I would like to use the internet on my iPhone at work, but wifi is not allowed and cellular coverage is almost non-existent. Is there any way to connect my iPhone to the internet via my wired LAN connection? Or to set up a Bluetooth connection betwee