Add code to a button?

Hi friends,
[Apps R12]
If I add a button to an OAF screen :
I have no idea of how :
- to add code when it's clicked... The idea would be to call a database procedure that receives,as parameters, certain values of that OAF screen and that returns, in an output parameter, a value to be posted in a screen field.
Any example would be appreciated
Thanks!
Jose L.

Hi
Please first go through with OADEVGUIDE,u can download the same form meta link (Note.730053.1). and haave practice seesion with labsolutions excercise . please find a sample code below for the problem
package oracle.apps.fnd.framework.toolbox.labsolutions.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.OABodyBean;
import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
import oracle.apps.fnd.framework.server.OADBTransaction;
import oracle.apps.fnd.framework.OAApplicationModule;
import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageLovInputBean;
import java.util.Enumeration;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
* Controller for ...
public class EmpSearchPGLayOutRNCO extends OAControllerImpl
public static final String RCS_ID="$Header$";
public static final boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
* Layout and page setup logic for a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
* Procedure to handle form submissions for form elements in
* a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
if (pageContext.getParameter("clearclearButton")!=null)
OADBTransaction txn = getDBTransaction();
CallableStatement cs =
txn.createCallableStatement("begin dbms_application_info.set_module(:1, :2);
end;");
try{
cs.setString(1, module);
cs.setString(2, action);
cs.execute();
cs.close();
catch (SQLException e)
try { cs.close } catch (Exception(e) {}
throw OAException.wrapperException(sqle); }
}

Similar Messages

  • Is it possible to add code to a button that would save the form as a jpeg file?

    Hi,
    I currently use pdf forms to create records for the work I do, these end up being 5-8MB large and not much smaller when 'flattened'. I currently use a 3rd party app to convert them to jpeg before uploading them to dropbox for the clients.  Is there a way to create code that i could add to  a button which would save the pdf as a jpeg file? 

    Hi,
    The PDF forms are large because they include a large diagram which I then elaborate on with the drawing tools.  I actually use acrobat to make and edit the form but PDF Expert on my iPad to edit them etc sorry probably should have clarified that. It is a single page however with form field and the diagram.  I also attach a picture to the file before opening it in an app to convert to jpeg and then sending it back to pdf expert. 
    The save as button only allows me to save it as a flattened or original document within PDF Experts guidelines hence why i was wondering if there was someway to curcumvent that and save it as a jpeg directly, somehow integrating the other app with the pdf expert programm t stop me having to switch between the two. 
    The more I write the more I see how impossible this might be apologies for my ignorance if so.

  • Add code to button to open in another browser window

    I'm a novice Flash developer (I'm using CS5). I want to add code to a button in my Flash movie - to open another web page on my site, but in another window. I've searched TouTube, Google and I can't figure it out. Is this enough info to help me? Or what else do you need to know in order me to get this working? Thank you!
    As of now, my code looks like this The line in red is the issue (I think):
    on (rollOver) {gotoAndPlay("s1");
    on (releaseOutside, rollOut) {gotoAndPlay("s2");
    on (release) {
    if (_root.link<>6) {
    _root["item"+_root.link].gotoAndPlay("s2");
    _root.link = 6;
    getURL("http://www.google.com, "_blank");
    Robert

    use:
    on (release) {
    if (_root.link<>6) {
    _root["item"+_root.link].gotoAndPlay("s2");
    _root.link = 6;
    getURL("http://www.google.com", "_blank");

  • How to add a custom PL/SQL code for a button event handler

    Hi All,
    I am a toddler in using Oracle Portal. So please forgive me for my ignorance.
    Q : How do I add a custom PL/SQL code for a button event handler?
    Basically, I would like to write MY PL/SQL function and call it. I could see that we can write "CUSTOM" code as "PL/SQL button event handler" in the form design window. But the question is that it expects only a "call" to procedure. But where do I define the procedure then? If I insert the procedure from the backend, it gets flushed the next time I compile my form.
    Hope I am able to explain my point.
    Thanks in advance,
    Abbas.

    Hi All,
    I am a toddler in using Oracle Portal. So please forgive me for my ignorance.
    Q : How do I add a custom PL/SQL code for a button event handler?
    Basically, I would like to write MY PL/SQL function and call it. I could see that we can write "CUSTOM" code as "PL/SQL button event handler" in the form design window. But the question is that it expects only a "call" to procedure. But where do I define the procedure then? If I insert the procedure from the backend, it gets flushed the next time I compile my form.
    Hope I am able to explain my point.
    Thanks in advance,
    Abbas.

  • How to add a google+ share button to a composition?

    I am working on a little app for which I want to add share buttons.
    I don't have problems adding Facebook share and Twitter buttons, However I cannot find a way to add a Google+ share button.
    For FB I create a rectangle and name it fbBtn. Then on click I add the foolowing code:
    FB.ui({
              method: 'feed',
              name: 'Win designer fashion jewelry from Baloka',
              link: ' http://www.mysite.com/',
              picture: 'http://www.mysite.com/external-xfbml/share-image.gif',
              caption: 'Win designer fashion jewelry from Baloka',
              description: 'Baloka is giving away 22 designer fashion jewelry by Maria Mizrahi. Check this out. Do you want to win? You could...',
              message: ''
    For Twitter I create a rectangle and name it twitterBTN. Then I add this code to document.compositionReady:
    var twitter = sym.$("twitterBTN");
    var c = '<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://baloka.com/content/socialApp/fb.html" data-text="Win cool trendy designer fashion jewelry - check this out" data-via="BalokaDesign" data-count="none" data-hashtags="BalokaSweepstakes">Tweet</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id =id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(docu ment,"script","twitter-wjs");</script>';
    twitter.html(c);
    For Google + I found two ways to add a share button:
    First:
    Adding this snipped to the html document (not in EA):
    div class="edgeLoad-EDGE-467457915"><a href="https://plus.google.com/share?url={http:baloka.com}" onclick="javascript:window.open(this.href,
      '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><img
      src="https://www.gstatic.com/images/icons/gplus-16.png" alt="Share on Google+"/></a></div>
    and adding this to the head:
    <!-- Add the following three tags inside head. -->
        <meta itemprop="name" content="Baloka Sweepstakes">
        <meta itemprop="description" content="Win designer fashion jewelry by Maria Mizrahi - Baloka.
        There are 22 prizes including earrings, bracelets, necklaces and a couple of $100 gift certificates.
        Please share with your friends.">
        <meta itemprop="image" content="http://cdn2.bigcommerce.com/server2100/a154e/products/102/images/243/LittleTotemEarrings__ 55527.1355162788.1280.1280.jpg">
    This works as expected, but I am having a hard time position the button in the right place on my page. I can see the button in EA, but the position I set it in there is not maintained once the file is published.
    Thus, I would like to know how to include the code directly in EA as I am doing with the Twitter and facebook buttons.
    Second:
    Adding this to the html document (not in EA):
    <div id="gplus1" data-action="share" data-annotation="bubble" class="edgeLoad-EDGE-467457915"></div>
    <!-- Place this tag after the last share tag. -->
    <script type="text/javascript">
          (function() {
                    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
                    po.src = 'https://apis.google.com/js/plusone.js';
                    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
      </script>
    Again, this works, although with this code I don't know  how to customize the name, description and image for the info I am sharing.
    In this case I was able to include the code on EA adding the following to document.compositionReady:
    var googleplus = sym.$('googleplus');
    var click = "javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');";
    var g = '<a href="https://plus.google.com/share?url={http://baloka.com/content/socialApp/fb.html}" onclick="click";return false;"><img src="https://www.gstatic.com/images/icons/gplus-16.png" alt="Share on Google+"/></a>';
    googleplus.html(g);
    The problem here is that instead of opening a window, it replaces the page with the one supposed to be on a different window, which I don't like.
    So, in short, I need some help figuring out how to include the code directly in EA for the first method for Google+.

    I don't have an answer for you, but I do have a question. You said the FB code works. What did you do? What did you put in your html page? I tried the FB code above and it gives me an ID error. Appreciate it if you can elaborate more. I just posted the ff in the forum "Customizing FB Share in Edge Animate"
    Thank you!

  • Why am I getting this error?  How do I add confirm message to button press?

    Using Java Studio Creator.
    I do not understand why I am getting the following page error:
    Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.
    Exception Details: java.lang.IndexOutOfBoundsException
    Index: 0, Size: 0
    Possible Source of Error:
    Class Name: java.util.ArrayList
    File Name: ArrayList.java
    Method Name: RangeCheck
    Line Number: 546
    ======================================================================
    I have a page that works.
    It has a button that is created in the session bean code with the following java:
    button = (HtmlCommandButton)application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
    button.setActionListener( application.createMethodBinding("#{ScheduleEditSessionBean.mainApply}", new Class[]{ActionEvent.class} ));
    button.setId( "applyUndates" );
    button.setType( "submit" );
    button.setTitle( "Apply updates.");
    button.setValue( "Apply" );
    button.setStyle(style);
    children.add(button);
    When the button is pushed, it calls the following session bean method:
    public void mainApply(ActionEvent actionEvent)
    updateScheduleData();
    scheduleAdjustFlag = 1;
    dataApplied = true;
    dataSaved = false;
    addControls();
    This all works just fine - no errors
    ====================================================================
    I wanted to add confirmation to the button press, so I removed the action listener for this button and added
    a javascript function call for the onclick method
    button = (HtmlCommandButton)application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
    style = "text-align: center; font-family: 'Arial','Helvetica',sans-serif; " + font + " height: 22px; width: 115px";
    // Commented out this line button.setActionListener( application.createMethodBinding("#{ScheduleEditSessionBean.mainApply}", new Class[]{ActionEvent.class} ));
    button.setOnclick("confirmApply()"); // Added this line.
    button.setId( "applyUndates" );
    button.setType( "submit" );
    button.setTitle( "Apply updates.");
    button.setValue( "Apply" );
    button.setStyle(style);
    children.add(button);
    I added a dummy button to the page that has the following call to execute the mainApply method in the sessioon bean.
    The button action just calls the mainApply() method in the session bean
    public String mainApplyBtn_action() {
    seb.mainApply();
    return null;
    Added the javascript to the page that simply pushes the dummy button if confirmed.
    function confirmApply()
    if( confirm( 'Are you sure you want to Apply these changes?' ) )
    form1["form1:mainApplyBtn"].click();
    The session bean method looks like this it is the same method as before, but without the action event argument.
    public void mainApply()
    lsb.logMsg( "<ScheduleEditBean.mainApply> Main apply pushed" );
    updateScheduleData();
    scheduleAdjustFlag = 1;
    dataApplied = true;
    dataSaved = false;
    addControls();
    ==================================================================================
    Now, when I push the original 'Apply' button, I get the confirmation box just like I expected.
    But when I confirm the question, I get the error at the top of this post.
    If I push the 'dummy button' directly, I do not get the error.
    I do not understand why I should be gettng this error.
    Can anyone give me a clue as to why this change would cause the problem?
    The error is related to an ArrayList.
    I use several of these on the page, but they should be filled with data in the preRender method of the page.
    Can anyone suggest a way that I can add confirmation to a button that is created under program control?
    Thanks

    Make use of the fact that when an onclick event of a button returns 'false', the action will not be taken.
    Pseudocode:<h:commandButton value="submit" action="#{myBean.action}" onclick="return confirm('Are you sure?');" />

  • OK since midday today firefox 3.6.24 apparently no longer executes javascript on ebay. Can't use the "add to watch list" buttons or the enlarge photo buttons. It says 'javascript at the bottom of the firefox window but nothing happens.

    just as I wrote above.. ebay loads and functions. I can bid and view auctions but trying to either use the "add to watch list" or "add to wish list" buttons or to switch between different posted photos of an item just gives me javascript:; at the bottom left of my screen but clicking the button has no effect.I'm still running 10.4.11 with the last java download.. is this an ebay change to a newer java version not supported by my os or is it a firefox error..oh and one more thing each page seems to have become 4 times longer..ie there is a huge empty space as I scroll down the page before I hit the bottom.Only appears to do this on ebay..haven't found any other sites showing similar errors and everything works fine on my imac running firefox 4 under 10.5

    Craig Stenton: at 12:13:04
    but I can't install windows! During the install I am asked for the product key and it tells me that it is not valid and so I can't proceed.
    Craig Stenton: at 12:14:16
    I can't use the usual methods of activation because I cannot get an activation code. I can't use the activation wizard. I can't call the number because it requires an activation code.
    Hi,
    I'm a bit confused with this paragraph, as you said Vista already install on your computer, why did you say Windows can't be installed?
    According to your description with your problem, it is Product edition and key are not match. Firstly of all, we must make sure the system you installed on your computer was
    Windows Vista Business, not matter 32 or 64 bit.
    Note: you can check current system edtion at System Properties.
    After that, you can try to input your product key and activate your system for test.
    If problem still presists, it would be better to provide the activation error message.
    Roger Lu
    TechNet Community Support

  • How do i add a Full Screen Button?

    Hi guys,
    I have used Quicklime X - File > Save for Web option to upload a video to my web site.
    This gave me a Java Script player and code to embed into my site, i have all the files running local on my server and the videos works well.
    My problem is that there is no full screen button on this player...
    Dose anyone know where i could find some code to add a full screen button to this player?
    I cant imagine it being to hard... but my knowledge of java is very limited.
    Thanks for your help
    Alex
    Edited by: swishk on May 21, 2010 10:35 PM

    Despite the similarity in names, Java and JavaScript are separate languages. For embedding Flash players or controls in web pages, you would be using JavaScript.

  • Add code To stander Java Clsess

    I have requirement to add button in stander OA Page To Print Report I need to implement this solution
    http://apps2fusion.com/at/ps/260-integrating-xml-publisher-and-oa-framework
    I Follow this step
    1- take all mds file from CE application to my project
    2- take all classes file to classless
    3- open the project in jdeveloper
    4- add button to BankAccountTransferPG.xml
    5- run the application
    all of this steps working fine and my application run with new button
    my problem is i need to put code under the button fire and after searching for java code in my application i didn't find any thig
    i found only classes file
    can any one help me how to find stander java code to put new method
    thanks

    Hi,
    You cannot modify standard class files. You have to create a new custom java controller file and extend that from standard controller class.
    However just for refering, u can use cavaj software to de-complie those class files.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Adding PayPal code to Flash button

    I want to use my own .swf button for PayPal payments with a "hidden format", but when adding the generated PayPal Website code to my html page, only a red X and the alt PayPal text is showing where the button should be. I have changed all Active X controls to Enable.
    Every time I contact PayPal I get a different reply. The last one was that I have to add a "static" image, but I really want to use my own button.
    I would rather find a way to paste the PayPal code into my buttons action script and then I only have to paste the Flash button to the html, but don't know how to manipulate that because the only code generated by PayPal is a "form" in html format. I am also adding text fields and guess that's why I don't get an generated email code from PayPal which I get if I don't add text fields.
    Any ideas how I can transform the code generated by PayPal to my action script are welcomed. I have about 150 buttons to add!
    This is my link: http://www.astondenwoodjewellery.co.uk/Jewellery%20html/Gold%20Rings/GR02_button_test.htm

    I will definitely mark when I have managed to do this, thank you. Still can't get it to work and I don't know where I'm going wrong, but shall continue trying...
    I have added the form in my html, but deleted the button which appeared as an X. Instead I've added my button with the code you gave me in AS.
    I don't know what I am doing wrong, but I keep receiving action script error messages:
    **Error** Scene=Scene 1, layer=glas, frame=1:Line 1: Statement must appear within on handler
         var sendLV:LoadVars=new LoadVars();
    **Error** Scene=Scene 1, layer=glas, frame=1:Line 2: Statement must appear within on handler
         var receiveLV:LoadVars=new LoadVars();
    **Error** Scene=Scene 1, layer=glas, frame=1:Line 3: Statement must appear within on handler
         receiveLV.onData=function(src){
    **Error** Scene=Scene 1, layer=glas, frame=1:Line 10: Operator '=' must be followed by an operand
         sendLV.on0= ;// use selected option for man/woman
    **Error** Scene=Scene 1, layer=glas, frame=1:Line 11: Operator '=' must be followed by an operand
         sendLV.on1= ;// use selected option for size
    **Error** Scene=Scene 1, layer=glas, frame=1:Line 8: Statement must appear within on handler
         GR02_test.onRelease=function(){
    Total ActionScript Errors: 6 Reported Errors: 6

  • How can I add a normal-sized button to my frame???

    hi,
    my GUI has two JScrollPane-s together in a JSplitPane and below I'd like to add a single small button.
    I put this button into a new JPanel, but it is displayed veeery BIG !
    I tried to use .setPreferredSize(new Dimension(int, int)), but it didn't help a lot.
    this is a piece of my code:
    public class MyTree extends JPanel implements TreeSelectionListener, ActionListener {
              this.setLayout(new GridLayout(2,0));
             buttonUpdateM_File = new JButton("Update the .m file");
             buttonUpdateM_File.addActionListener(this);
             JPanel actionPane = new JPanel(new GridLayout(0,1));
             actionPane.setMaximumSize(new Dimension(1,2));
             actionPane.setPreferredSize(new Dimension(5,10));
             actionPane.add(buttonUpdateM_File);
              //create the scroll pane and put the tree into it
              JScrollPane treeView = new JScrollPane(tree);
              //create the viewing scroll pane
              JScrollPane maskViewPane = new JScrollPane();
              //add the two scroll panes to a split pane
              JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
              splitPane.setLeftComponent(treeView);
              splitPane.setRightComponent(maskViewPane);
              Dimension minimumSize = new Dimension(420, 360);
              treeView.setMinimumSize(minimumSize);
              maskViewPane.setMinimumSize(minimumSize);
              splitPane.setDividerLocation(210);
            splitPane.setPreferredSize(new Dimension(600, 510));
            //Add the split pane to this panel
            add(splitPane);
            add(actionPane);
         }Thank you!

    thanks,
    as far as I understood there is no way to shrink the
    new JPanel with this GridLayout.Yes, Grid just makes a set of fixed sized boxes. If you want the JPanel to be the same size as the JButton, what do you want the panel for?

  • How to add an image or button to an AdvancedDataGrid cell with wrapped text alongside

    I have an advanced data grid with which i need to add either
    images or buttons to individual cells alongside the text.
    This i can do, but what i can't figure out is how to make the
    text wrap.
    Currently, I can make cell text wrap by using an itemRenderer
    which extends Text. Or, I can add an image or button to a cell by
    using an itemRenderer which extends HBox and contains an image or
    button child. To this HBox i can add a Text or Label object also,
    but i can't make the text wrap.
    Does anyone have any ideas/suggestions/solutions????
    Thanks
    Mark

    "ms10" <[email protected]> wrote in message
    news:g8jlb5$l6p$[email protected]..
    >I have an advanced data grid with which i need to add
    either images or
    >buttons
    > to individual cells alongside the text.
    >
    > This i can do, but what i can't figure out is how to
    make the text wrap.
    >
    > Currently, I can make cell text wrap by using an
    itemRenderer which
    > extends
    > Text. Or, I can add an image or button to a cell by
    using an itemRenderer
    > which
    > extends HBox and contains an image or button child. To
    this HBox i can add
    > a
    > Text or Label object also, but i can't make the text
    wrap.
    >
    > Does anyone have any ideas/suggestions/solutions????
    I'd look at the code for AdvancedDataGridGroupItemRenderer
    and try to see
    what keeps it from displaying an icon in the columns that are
    not grouping
    columns. I'd then extend it to change that and use an icon
    function.
    HTH;
    Amy

  • JFrame - add mouseover capability to button

    Hi, simple one here I think.
    Environment:
    using JAVA 1.5.0_06, Metal L&F on XP laptop
    javax.swing.plaf.basic.BasicMenuBarUI
    My JMenu is working just fine. I wish to have the JMenu button/image highlight during a mouseover. If I use a Windows L&F I can get it but that introduces some other problems.
    Is there an easy way to add code to my app to add this feature?
    thanks
    [email protected]
    Message was edited by:
    broue

    Hi,
    I did this a while ago
    http://www.oracle.com/technology/products/jdev/howtos/10g/jclientlov/customadfjclientlovpanel.html
    Frank

  • Does anyone know whether it is possible to add a Pay Pal button to web site created using IWeb?

    Does anyone know whether it is possible to add a Pay Pal button to a community web site I created using IWeb?
    If so how does hide the Pay Pal code?
    Robert Jones

    See this page for info ...
    http://www.iwebformusicians.com/Internet-Music-Sell-Distribute/PayPal.html
    Other pages in this section show how to set up a sales page and create a shopping cart.
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

  • How do I add a close window button/image

    All I want to do: Add a close window button (round/square with an "x" through it) to either one or many html files. I don't see how to do this.
    Using RoboHelp 8 HTML and WinXP. Thanks.

    Ahh I see now. You are asking where to obtain such an image!
    The RoboHelp Gallery doesn't contain one. Sorry. You will need to obtain one from any number of other locations.
    You might look at the following link for one possibility.
    Icon Archive
    Here are a couple from my own colloection. You might right-click and save as.
    There are also a number of packages you may purchase or find. Perhaps the following link will help.
    Click here to search Google
    I cannot advise on the legal implications of using said images.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 moments from now - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcererStone Blog
    RoboHelp eBooks

Maybe you are looking for