Execute two functions from one Save button

Hi,
I am using JDeveloper 10.1.3.0.4 and JHeadstart 10.1.3.0.91.
Can anybody help me for the following:
In one editable jspx page I have a save button.
I want to do the following:
If I click the Save button, it will save the record and also it will call another stored procedure. I know how to call a stored procedure by clicking a button. But I want to do it from a save button after saving.
I want my save button will do two things - 1) save the record, 2) call the stored procedure.
I would appreciate if anybody could help me.
Thanks
Syed Jabbar
University of Windsor
Windsor, ON, Canada

It would have been nice if JSF framework would have allowed us to chain the actionListner or specify multiple actionListner, but as of now, that not possible.
Another option would be to bind the save button to call an AM method.
By default the save button's ActionListener is bound to the Commit operation.
- You can create a custom method in your AMImpl.java say void myMethod()
Which basically first does a commit and then make a pl/sql call.
- Expose it to the clients via Edit Application module dialog box.
- Add a method bindings in your PageDef pointing to this.
- Set the actionListener of you button pointing to this new method binding.
it will be something like '#{bindings.myMethod.execute}'
regards - rutwik

Similar Messages

  • Two functions on one submit button??

    Is it possible to have a button perform 2 functions?
    I would like to have one single button that when clicked will submit the form as pdf to an email address and also print the form to the default printer.
    I have been able to have the button working for email OR print but not for the two.
    When I add the JS code to the submit button to print the form the code is ignored.
    The email dialog box shows and I can then send the email but the pdf is not printed.
    Any help is appreciated,
    FayeC

    use this in a button click event.<br />//capture present XML in a variable<br />var printXML = xfa.data.saveXML();<br />//do the following if you want to print part of the XML<br />var startAt = printXML.indexOf("<SendXML");<br />var endAt = printXML.indexOf("</SendXML");<br />printXML = ""+printXML.substring(startAt, endAt+11)<br />//11 is length of the XML tag may have to adjust this based on<br />//end results.<br /><br />var subj = "email with XML and PDF";<br />//following composes email with PDF attachment<br />event.target.submitForm({cURL:"mailto:[email protected]?&body=following is the final XML<BR>"+printXML+"<BR>&subject="+subj,cSubmitAs:"PDF",cCharset:"utf-8"});<br /><br />Good Luck,<br />Sekahr

  • One save button, multiple regions question

    Hi. I have a question dealing with multiple regions in APEX 2.2. I would like to have a page with two regions. The top displays account transactions for the current period. Due to the nature of the application, there are a fixed number of transactions per period and all fit in one page.
    The bottom regions displays the ROI value for the current period. It pulls from a table that has exactly one row per period. The period is always the same for the top and bottom region.
    The current generation of the page shows the account transactions. The region was generated using the wizard and has a type of "SQL Query (updateable report)." As it, it works nicely.
    When we added the new region for the ROI, we used the wizard, too. The ROI region has the same type ("SQL Query (updateable report)." We have just one SAVE button on the page and it does the submit.
    The problem is that when we save, we get an error:
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process.
    If we delete the bottom region then we don't get this error.
    The fields that it shows are always from the top region, even if we're only updating the ROI. From what I understand, APEX thinks that the cached values have been updated in the database. Since we're testing on a dedicated box, I know that no one else is making updates. I've also seen this error when we've accidentally rearranged the order of the fields in the report query. I think that's not the case here since deleting the new region makes the page work as expected.
    My question is how can we get the two regions to work together on the same page?
    Thanks
    Mike

    Hi,
    When working with report regions only one could be updateable report. You need to delete the region that's not updatable and recreate it as an non-updateable report.
    If need to update another table use a process (PLSQL) called when your save button is pressed.
    Hope could help you.

  • Booting two Macs from one external drive: 10.8 and App Store?

    I boot two Macs from one external harddrive. Does this mean that when 10.8 is sold exclusively via the App Store and thereby linked to a unique hardware identifier, I am going to have issues with activation/authentification each time I switch machines? I have avoided the App Store since I discovered that an app I bought there, and which I really needed to open automatically on log-in, had to be manually re-activated with my Apple ID after every switch (so that I eventually deleted it and reverted to an earlier, non-App Store version).

    Welcome to the forum!
      There are a couple of "solutions" to your problem.  The easiest, and possibly the best for you (although it is a bit slower) is to copy your catalog onto the external drive as well.
    Then when you plug in the drive, you will always have your latest catalog for access.
    The other way is to keep a local copy of your catalog, and copy it onto the local drive as a way to transfer it from one computer to the other.
    This has the problem of possibly not being in sync, that is, you forgot to copy it over once and did some editing.  Then you would end up with essentually two different catalogs, instead of one in two places.
      You can copy the catalog either with your OS, or you can "export as catalog" and specify the external drive as the destination.  Then, on your other computer, "import from catalog" and only take the meta-data settings (it's on the import dialog box).
    Personally, when I'm traveling, I have my catalog on my external drive as well.  It just makes life easier, and I don't have to worry about it being out of sync, or losing it (and not the images).
    So, I would go with the first method, at least to start.  To get your catalog over there, you can either export as catalog or copy it, either one will work.
    You can find the location of your catalog file (if you don't know where it is) in the catalog settings menu prompt.  Both the location and the name will be displayed.
    Cheers!

  • HT1347 How do I run two libraries from one computer?

    How do I run two libraries from one computer? One library is on the computer's hard drive, the second library is on an external hard drive. The computer that had the external hard drive crashed and I need to fix the iTunes library on it. How can I do this without corrupting the library on my internal hard drive?

    Launch iTunes with the Shift key held down and either create a new library or choose the one on the external drive. Any rented movies downloaded from another computer won't play.
    (81212)

  • Call two programs from one program.

    HI all,
    I have two BDC interface in seperate programs.
    I want to call that two programs from one program based on a condition.
    Is there any way.
    I tried with call transaction 'SE38'.
    set parameter ID but it is taking buffered value.
    Thanks,
    sri

    use submit program to call other program.
    SUBMIT prog|(field) [AND RETURN] [options].
    also if you want BDC prog, then probably you can call the BDC recording using PERFORM bdc_prog (in program name).
    PERFORM (<fsubr>)[IN PROGRAM (<fprog>)][USING   ... <pi>... ]
                                           [CHANGING... <pi>... ]
                                           [IF FOUND].
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9dd035c111d1829f0000e829fbfe/content.htm

  • What is the prerequisite for creating two hierarchies from one fact table i

    Hi,
    what is the prerequisite for creating two hierarchies from one a single fact table.
    Rgds,
    Amit

    create global temporary table t1 as select * from trn_ordbase on commit preserve rows;You CANNOT use this syntax.
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/sqcmd.htm
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/glob_tab.gif
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/cre_tabl.gif

  • My iPhone just loaded 1600  emails dating back over two years from one of my accounts. Is there a way to "mark all as read"?

    My iPhone just loaded 1600  emails dating back over two years from one of my accounts. Is there a way to "mark all as read"?

    Your Comcast accounts are POP (unless you enrolled in the Comcat Beta test of Imap) so they won't sync at all. Either enroll in the Beta test or don't use Comcast.
    Your iCloud account is Imap and should sync just fine, unless you have set it up incorrectly.

  • Control two functions on one button click

    Hello,
    first off, I am relatively new to actionscript 3.0. I was
    wondering if anyone knows how I can control two events on one (the
    same) button click. On click, the first function must jump the user
    to a particular frame label and at the same time trigger a second
    function which is a movie clip on that particular frame. I must
    note that the event listener is attached to an actual Button and
    not a movie clip.
    Any help would be greatly appreciated.

    Thanks for the quick response. I tried out your solution but
    I get the following error...
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at index_fla::MainTimeline/rev()
    at index_fla::MainTimeline/resources()
    I also tried to create another event listener on Mouse_UP
    ex:
    topNav1_btn.addEventListener(MouseEvent.CLICK, resources);
    topNav1_btn.addEventListener(MouseEvent.MOUSE_UP, rev);
    but I get another strange error...
    ## [Tweener] Error: [object MovieClip] raised an error while
    executing the 'onComplete'handler.
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at MethodInfo-218()
    at Function/
    http://adobe.com/AS3/2006/builtin::apply()
    at caurina.transitions::Tweener$/updateTweenByIndex()
    at caurina.transitions::Tweener$/updateTweens()
    at caurina.transitions::Tweener$/onEnterFrame()
    ## [Tweener] Error: [object MovieClip] raised an error while
    executing the 'onComplete'handler.
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at MethodInfo-241()
    at Function/
    http://adobe.com/AS3/2006/builtin::apply()
    at caurina.transitions::Tweener$/updateTweenByIndex()
    at caurina.transitions::Tweener$/updateTweens()
    at caurina.transitions::Tweener$/onEnterFrame()
    any other thoughts? Thanks in advance.

  • How can I open two windows from one submit?

    Is there a way to open two browser windows from one click of a button to submit a form? I have a button on a screen that does some processing of the data and then generates a PDF file with the output. I would also like it to run a report and show the output of that in a separate window. I realize that using regular HTML with a target of "_blank" on the form, you can have the results show in a new window, but how can I launch a second window from a single button click, if possible?
    Thanks!

    It can be possible using two different popUps instead windows. Onclick on the button just make vissible true of those two popup in the event method, before making visible true, do the business operation to show on the popups. So simple :)
    Note: Popup has modal=false attribute
    Edited by: man_ish on Jan 12, 2010 10:13 AM

  • How to execute commit operation from an ADF button?

    Hi,
    I am using Jdeveloper 11.1.1.3.0. I have an application and need to customize the application by adding a form. I added the Form and I need to do a commit when they press the SAVE button in that page. the action listener for that SAVE button invokes a method and I don't want to change that code because it handles lots of other stuffs. I need to add the commit to the SAVE button. Is it possible to call the ${bindings.commit.execute} in the javascript when they press the SAVE button or using any other listener to invoke a method in the backing bean.
    Thanks
    SR

    You can add the binding to the commit operation to your page and then call this from the backing bean where your current save logic exist.
    See: http://blogs.oracle.com/shay/2010/04/doing_two_declarative_operatio.html

  • Currency conversion issue in SPM. We are getting incorrect results with SPM conversion function from one of the document currency to USD.

    Currently we are using SPM 2.0 version and we have been facing currency conversion issues.
    Please help me in following aspects.
    1) Where actually currency conversion happens in SPM. Is it the global program which does the conversion or other way.
    2) We have conversion issue for one of the currency where conversion function is giving incorrect results when converting from one of the document currency to USD. here The respective document currency is considering the 1:1 ratio with Dollar which is actually incorrect.
    3) We have verified in both BI side(currency tables) and even ECC side.
    Please help me in understanding this issue and let me know if you need more information on this.
    Its an production issue and appreciated your immediate inputs.
    Thanks
    Kiran

    Hi Arun,
    The following information may be helpful to you.The SSA_HELPER_PROGRAM has options regarding currency settings.
    EXCH_RATE_TYPE: This flag governs the exchange rate type which will be used for currency conversion in data management. For example if RSXAADMIN contains an entry EXCH_RATE_TYPE = „ZSPM‟ then the conversion type used for currency conversion is ZSPM. The default value for the exchange rate type is „M‟. More details can be found in the note 1278988.
    CURRENCYCONVERSION: By default data management converts all the measures in transaction currency to reporting currency and copies over to the corresponding measure in reporting currency. If the measure in reporting currency is already available in source it might be desirable to disable the currency conversion. To disable the conversion you can make an entry CURRENCYCONVERSION = „ „ in the table RSXAADMIN. This can also be achieved by running the program SSA_HELPER_PROGRAM with the option DEACTIVATE_CURRENCYCONVERSION. The conversion can be reactivated by running the same program with option ACTIVATE_CURRENCYCONVERSION.
    UNITCONVERSION: Similar to above. To deactivate unit conversion you can use the program with option and DEACTIVATE_UNITCONVERSION and to reactivate ACTIVATE_UNITCONVERSION. By default both the conversions are switched on
    EXTERNAL_CURRENCIES: Normally most of the international currencies are stored with two decimal places however certain currencies do have 0 and 1 decimal place too. For example JPY has 0 decimal places. SAP internal format stores even these currencies with 2 decimal places and at the time of display it changes the value to right decimal places. In case a file from external source is loaded to SPM it might have the format with 0 decimal places in the file. To convert it to SAP standard format post processing needs to be done on this value. If that is the case you can set the flat EXTERNAL_CURRENCIES = „X‟ in the table which will enable the post processing for these values. This flag can also be set and reset using the helper program using the option TURNON_EXT_CURRENCY_FORMAT and TURNOFF_EXT_CURRENCY_FORMAT.
    Kind Regards,
    John Harris
    Senior Support Engineer, SAP Active Global Support

  • Connect two users from one Mac/PC to one Time Capsule.

    Hi all,
    after spending the last 1.5 hours on Google and this Community, I have found tons of possible solutions but none worked for me. Here's my setup:
    Time Capsule (2 months old) with FW 7.6.1
    TC is attached to router/modem box. As I'm using the DHCP server in my "internet" box, I have the TC connect in bridged mode.
    TC has file sharing active, secured with accounts.
    I'm using AirPort Utility 6.1 to set the TC up.
    I have two clients (for now) that I want to connect to the time, a MPB (OSX Lion) and a Windows 7 Desktop. Generally, connecting to the TC with MBP works without any problems:.
    The only problem I have with the Mac is that there doesn't seem to be a solution to connect to two accounts at the same time from one machine.
    Now here's my real problem. When trying to access TC with my Windows PC, I couldn't get it to work with just mounting a network drive. I installed Airport Utility for Windows and with this I can connect to TC, but only the account that is currently connected on the MBP.
    To summarize:
    Is there a way to connect multiple accounts at the same time, both on Windows and on OSX?
    Thanks in advance and let me know if more information is needed.
    Georg

    Waiting any Idea,
    CREATE USER data_history IDENTIFIED BY test;
    CREATE USER data_current IDENTIFIED BY test;
    CREATE USER middle_layer IDENTIFIED BY test;
    CREATE TABLE data_history.sales_order_head_h;
    CREATE TABLE data_current.sales_order_head;
    CREATE ROLE historical_data_reader;
    CREATE ROLE historical_data_loader;
    CREATE VIEW data_history.sales_order_head AS
    SELECT * FROM data_current.sales_order_head
    UNION ALL
    SELECT * FROM data_history.sales_order_head_h;
    GRANT SELECT ON data_history.sales_order_head
    TO historical_data_reader;
    GRANT INSERT, UPDATE, DELETE ON data_current.sales_order_head
    TO historical_data_loader;
    GRANT historical_data_reader TO middle_layer;
    GRANT historical_data_loader TO middle_layer;
    connect to middle_layer;
    sql> select * from sales_order_head;
    not working
    sql> insert into sales_order_head;
    not working too.
    hope you can help.
    regards,

  • Running two displays from one DVI port...time to put my ADC down

    Hi Guys,
    I have a G5 dual with a GeForce FX 5200 which has 1 each of DVI+ADC ports. Until recently the 17" Apple display has been my only monitor. As I have a recording/mix studio I need to move the G5 base unit far away from any recording as it makes quite a lot of noise. I have been unable to do this as I have been having trouble finding either a Dr Bott or Griffin ADC extension. I have been searching off and on for over a year with no success.
    Recently I purchased a cheap reconditioned NEC monitor which I am running from the DVI port and am thinking perhaps now is the time to get rid of my apple display due to the ADC connection troubles.
    Is it possible to run two monitors from the one DVI port? I need to run a mirrored image so that I have one monitor to my side so that I can do close editing work and then one further away behind my analogue mixing desk, they need to show exactly the same thing.
    Will splitting the DVI port degrade signal or is there a way around this. I also want to get some long cables 6m+ so that I can place the base unit outside of the control room, will this be a problem?
    I would really appreciate some help on this matter.
    Thanks,
    Iwan

    Thanks BSteely, Would you happen to know of a box to recommend? I guess something like this would be more suitable:
    http://www.amazon.co.uk/StarTech-com-Port-DVI-Video-Splitter/dp/B000MPL5ZC/ref=s r129?ie=UTF8&s=electronics&qid=1272121514&sr=1-29
    Than this:
    http://www.amazon.co.uk/Ex-Pro-Premium-Female-splitter-connections/dp/B003HE91CE /ref=sr140?ie=UTF8&s=electronics&qid=1272121514&sr=1-40
    Thanks,
    Iwan

  • Two objects from one table

    My current setup is two tables and two objects with a one to one relationship between them, Object and ObjectMD (metadata).
    Not sure why my predecessors set it up like this but...that's how it is.
    The problem is that my Object table (and thus ObjectMD also) has reached 40 million rows and large joins between Object and ObjectMD are taking forever and are completely unnecessary.
    I want to import the ObjectMD data into the Object table and go forward with a single table. The problem is that the ObjectMD table has it's own java surrounding it and that code is used in way too many places to weed it out. I need to leave the Java object structure in place.
    I think I should be able to create both these objects from a single table, but I can not figure out the descriptor. My set method needs to be getMetaData().setMethod, but of course TL's reflection doesn't like this. I suppose I could create new methods in Object to get/set all these fields and just forward them to the real methods.
    How can I define descriptors to create two objects from a single table?

    What I decided on for my last problem was to use a method to setBar, and inside that method, set the Foo of the Bar.
    Here are my files for future reference:
    --------------------------------------Foo.java-------------------------------------
    public class Foo {
         public int id;
         public String first;
         public Bar bar;
         public void setBar(Bar newBar){
              if(newBar != null){
                   newBar.foo = this;
              this.bar = newBar;
    --------------------------------------Bar.java-------------------------------------
    public class Bar {
         public Foo foo;
         public String second;
    --------------------------------------Descriptors.java-------------------------------------
    public class Descriptors {
         public static void addDescriptors(Project project) {
    project.addDescriptor(Descriptors.buildFooDescriptor());
    project.addDescriptor(Descriptors.buildBarDescriptor());
    private static Descriptor buildFooDescriptor() {
    Descriptor descriptor = new Descriptor();
    //     basic information
    descriptor.setJavaClass(Foo.class);
    descriptor.addTableName("FOO");
    descriptor.setPrimaryKeyFieldName("ID");
    //     mappings
    DirectToFieldMapping directToFieldMapping;
    AggregateObjectMapping aggregateObjectMapping;
    //     id mapping
    directToFieldMapping = new DirectToFieldMapping();
    directToFieldMapping.setAttributeName("id");
    directToFieldMapping.setFieldName("ID");
    descriptor.addMapping(directToFieldMapping);
    //     first mapping
    directToFieldMapping = new DirectToFieldMapping();
    directToFieldMapping.setAttributeName("first");
    directToFieldMapping.setFieldName("FIRST");
    descriptor.addMapping(directToFieldMapping);
    //     bar mapping
    aggregateObjectMapping = new AggregateObjectMapping();
    aggregateObjectMapping.setAttributeName("bar");
    aggregateObjectMapping.setReferenceClass(Bar.class);
    aggregateObjectMapping.setSetMethodName("setBar");
    aggregateObjectMapping.dontAllowNull();
    descriptor.addMapping(aggregateObjectMapping);
    return descriptor;
    private static Descriptor buildBarDescriptor() {
    Descriptor descriptor = new Descriptor();
    // basic information
    descriptor.descriptorIsAggregate();
    descriptor.setJavaClass(Bar.class);
    //     mappings
    DirectToFieldMapping directToFieldMapping;
    //     second mapping
    directToFieldMapping = new DirectToFieldMapping();
    directToFieldMapping.setAttributeName("second");
    directToFieldMapping.setFieldName("SECOND");
    descriptor.addMapping(directToFieldMapping);
    return descriptor;
    ----------------------------------------Go.java------------------------------------
    public class Go {
         public static void main(String[] args) {
              if(args.length != 0){
                   throw new RuntimeException("Arguments are not supported");
              Project project = new Project();
              project.setName("fooBarProject");
              DatabaseLogin login = new DatabaseLogin();
         login.usePlatform(new Oracle9Platform());
         login.setDriverClassName("oracle.jdbc.driver.OracleDriver");
         login.setConnectionString("jdbc:oracle:thin:@nnn.nnn.nnn.nnn:nnnn:SERVICE");
         project.setDatasourceLogin(login);
         Descriptors.addDescriptors(project);
         Server server = project.createServerSession(2, 2);
         server.setLogLevel(oracle.toplink.sessions.SessionLog.FINE);
         server.login("schema", "password");
         Session session = server.acquireClientSession();
         UnitOfWork uow = session.acquireUnitOfWork();
         Foo fooBar = (Foo) uow.newInstance(Foo.class);
         fooBar.id = (int) (Math.random() * 10000);
         fooBar.first = "abcd";
         uow.commit();
         ExpressionBuilder builder = new ExpressionBuilder();
         Foo fooBarLoad = (Foo) session.readObject(Foo.class, builder.get("id").equal(fooBar.id));
         System.out.println("ID:" + fooBarLoad.id + " FIRST:" + fooBarLoad.first + " SECOND:" + fooBarLoad.bar.second );
         session.release();
         server.logout();
    ------------------------------------------------------------------------------------------

Maybe you are looking for

  • How can i transfer my music from one account to another on a different computer?

    So i have an itunes account on dell laptop and i share that account with other famliy members. I recently bought a mac pro and wanted to create a new account that way i can use icloud, is there any possible way to transfer everything from my old libr

  • Issue Installing Adobe AIR

    Hi, I'm actually trying to install PhotoShop Element. I can't install it because Adobe AIR is not installed yet. But when I try to install AIR, nothing happened. I Have download the latest version on the adobe website, but when i start the exe, nothi

  • Changing

    Hi all. Planning to switch from an iBook G4 to a MacBook Pro. 2 Questions Is it easy to transfer files and how do you do it? Also, which is better? Glossy screen or non glossy? Thanks.

  • Question about table compression

    I administer several 10g databases, and have been asked to compress tables in several tablespaces. I am unfamiliar with using compression. I have read some Oracle documentation on the ALTER TABLE... MOVE COMPRESSION command, but still have several qu

  • Duplicate objects for gallery

    I have tried a couple of times to duplicate objects, in different ways, so I can later put image into the objects. The problem is that it works in Flash but when i try it out in my browser or my friends browser it wount work at all. So if there is on