Is it possible to handle multiple events using Jscript for a button in Apex

Hi,
I've application wherein in one of the pages for a button, I need to trigger 2 events as: 1. redirect to a new page upon 'click' of the button
2. display a set of values on 'mouse over' that button.
I'm able to handle both separately, but not in one button. I would like to know if there is any limitation in Apex that we cant handle multiple events? Currently I've put a text item near the button, and called the Jscript for mouse over event in that as a temporary workaround. Can someone let me know if this is feasible? If not any other alternative to handle this?
Thanks in advance,
gsachidh

Hi Gsachidh,
well interesting problem you're facinng. Indeed, it can't be specified using the 'Button Attributes' So we have to come up with an workaround.
A quick en dirty solution would be to specify it with the 'Optional URL Redirect options'. In a normal button, with processing on same page, this would be 'no target'. but in case of additional things to be done this can be used, using an target URL. I used this many times, in example with popUp windows for refreshing the caller object when changes are made. In your case we have to add next to the href an onmouseover event. this can be done with;
Target set to => URL
URL - target => javascript:doSubmit('<button_name>');" onMouseOver="javascript:showTooltip('tooltip');"
Here the " is the key, letting ApEx know the target (href) is doSubmit('<button_name>'), just like when no target would be specified and adding a new javascript event; onMouseOver.
Although this is a dirty solution in my opinion, it is the best i could come up with. I have another idea in how to do this, that is by adding this event dynamically with javascript with an addEvent. But i don't have an example at the moment for this scenario.
Simon
Message was edited by:
S1M0N

Similar Messages

  • URGENT: Is it possible to upload multiple files using STRUTS

    Hi,
    Is it possible to upload multiple files using STRUTS.
    I am able to upload a single file. But how do i upload multiple files ??
    upload.jsp
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:html>
    <head>
    <title>New Page 1</title>
    </head>
    <body>
    <html:form action="/secure/uploadFile.do" enctype="multipart/form-data" method="POST" type="com.smartstream.webconnect.user.actions.UploadActionForm">
    <p>File to upload
    <html:file property="fileUpload" size="20"/></p>
    <p><html:submit/></p>
    </html:form>
    </body>
    </html:html>
    UploadAction.java
    public class UploadAction extends BaseAction {
        Logger log = Logger.getLogger(AttachMessageAction.class);
        public ActionForward executeAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ActionException {
            System.out.println("executeAction of UploadAction");
            UploadActionForm uploadActionForm = (UploadActionForm) form;
            int fileSize = uploadActionForm.getFileUpload().getFileSize();
            System.out.println("uploadActionForm.getFileUpload().getFileSize() = " + uploadActionForm.getFileUpload().getFileSize());
            byte buffer[] = new byte[1024];
            try {
                BufferedInputStream bufferedInputStream = new BufferedInputStream(uploadActionForm.getFileUpload().getInputStream());
                FileOutputStream fos = new FileOutputStream("s:\\uploaded\\" + uploadActionForm.getFileUpload().getFileName());
                int read;
                while ( (read = bufferedInputStream.read(buffer,0,buffer.length)) != -1) {
                    fos.write(buffer, 0, read);
                fos.flush();
                fos.close();
                bufferedInputStream.close();
                return mapping.findForward("success");
            } catch (IOException e) {
                e.printStackTrace();
                return mapping.findForward("error");
            }catch(OutOfMemoryError o){
                o.printStackTrace();
                System.out.println("o.getMessage() " + o.getMessage());
                return mapping.findForward("error");
    UploadActionForm.java
    public class UploadActionForm extends ActionForm{
        private FormFile fileUpload;
        private byte[] fileContent;
        public FormFile getFileUpload() {
            org.apache.struts.taglib.html.FormTag _jspx_th_html_form_0;
            return fileUpload;
        public byte[] getFileContent() {
            return fileContent;
        public void setFileUpload(FormFile fileUpload) {
            this.fileUpload = fileUpload;
        public void setFileContent(byte[] fileContent) {
            this.fileContent = fileContent;
    }--Bhupendra Mahajan

    Yes, you could try using the multipart handler...
    But I have a better idea...
    Determine the maximum number of file uploads that the
    user can do at one time. I mean, you can't
    realistically have the user upload a million files at
    one time. So say the max is 20. So you create your
    action form class with 20 FormFile fields called file1
    to file20.
    Then when you dynamically create your page, you
    dynamically create the specified number of file fields
    and 1 hidden field called "totalFiles" which contains
    the number of file fields you created. This should be
    an int field in the form bean.
    Then when you do your action processing, you just loop
    thru the totalFiles... Or well, actually, you may not
    need that at all. You could just check all the
    FormFile fields and whatever ones aren't null contain
    files.But what about UploadActionForm.java[b]
    How do i have exact mapping of the HTML form in this file ??
    --[b]Bhupendra Mahajan

  • Is it possible to show multiple events in the Events window of IMovie ?

    we have recently made a video of a play,  where we filmed from different angles each day  over 7 nights using a selection of long and mid-shots.  So we now have multiple Events ( one from each day).  In order to now edit all the events into a single project it would be helpful if  I could display all the events underneith each other in the Events window to make shot selection and editing easier.
    Can this be done in I Movie,  Thanks

    In the View menu do you have, Group Events by Disk, Grou Events by Month and Show Separate Dates in Events all checked?
    That should allow you the broadest way to view all your Events.
    Matt

  • HOW TO HANDLE MULTIPLE VALUES IN BDC FOR A PARTICULAR FIELD.

    I THINK IT IS HANDLING OF TABLE CONTROLS IN BDC
    PLEASE LET KNOW WHETHER THESE TWO ARE SAME CONCEPT OR NOT
    HOW TO HANDLE TABLE CONTROLS IN BDC
    Moderator message - Please do not use all caps. Please do not ask interview questions -  post locked
    Edited by: Rob Burbank on Jun 26, 2009 10:02 AM

    Hi,
    To handle table control in BDC you will have to enter at least one record in the table control and there after use the index number to increment to the next line item.
    Say you run a recording for a transaction which has a table control (ME21), here after you have completed the recording, you'll see the code which will have sometjing like <fieldname>(01) and the entered value. that valeu has been entered as the first line item (01 being the index).
    You will have to replace the hard coded line item index with a variable and inside a loop increment the item index. Once you reach the maximum allowed line items on your screen juct press the pagedown button (or insert new row) and reset the index to 1.
    Following is a code snippet I used while uploading data for ME31K (vendor contract). It is not the complete code but does show how your code needs to be changed with using index for line items.
    Here we assumne that the maximun number of lines displayed at a time on the screen is 14.
    << Unformatable code removed >>
    Hope this helps.
    Regards,
    Sachin
    Edited by: Rob Burbank on Jun 26, 2009 10:03 AM

  • While using Status for Object button it is taking more than 15 mins to open

    Hi Gurus,
    We are trying to attach documents to ZBOS & OR types sales documents , while opening the Status for Object button of the sales order it is taking more than 15 mins to open , once it is opened it is working as normal.
    can you please let us know is it the system functionality because of which it is taking so much time to open or the problem  is with  something else.
    please let us also know whether it is  system impacting process.
    We are using 4.6C.
    Thank You,
    Boyeni.

    Hi Syed ,
    Greetings!!!...
    Thank you very much for your Swift response!.
    could you be so kind to let me know The Program that needs to be refreshed.
    Thank You once again for your Assistance.
    Boyeni.

  • Handling multiple events in web application

    We are converting a window application to a web application. We are facing an issue while implementing the web application with Java on front end and Oracle DB in back end. Consider a field with a car registration number which needs to be verified if it exists in the DB and fetch the remaining values related to the car and display it. At the same time we also need to save the car registration number in the form (displayed in the browser) so that other operations (such as invoicing) can happen on the car. We have a constraint that we cannot touch any of the server procedures in the DB (which handles all DB calls) but could only play with the functions in the UI.
    Now the verification of the reg. no. happens whenever we go 'out of focus' from the text box where the reg.no. is written. However, if the user presses 'save' button to save the reg.no., verification should also occur and data should be saved. Now the problem we are facing is that on pressing the save button, two events are occurring simultaneously - 1. textbox with reg.no. is getting 'out of focus' and 2. save button is getting pressed resulting in verifying the reg.no. again. Due to this two events happening simultaneously, one or other method is failing leading to the car reg.no. not getting verified and saved as it should be.
    Could anyone think of any solution to overcome the issue?
    /Mayank

    Hi,
    Your assumptions are all correct. Indeed there is Javascript code executing on focus change and AJAX is doing the validations by inturn calling an oracle procedure through some Java rountine. The two requests are overlapping and hence blocking the complete execution of either, leading to the validation not taking place at all.
    The webpage gets refreshed everytime an event occurs and thus the next event can take place only after the page has refreshed once (after completing all the validations linked to that event). The problem is occuring since the page is not getting time to refresh. With simultaneous execution of 2 events, the validations related to 'Out of focus' remains incomplete before the 'save function' starts. I am constrained not to put the validation related to 'Out of Focus' in the beginning of 'save' event since that would alter functionality of the 'save' event. Again, I am not allowed to change any of the server procedures on the DB side and have to pass exactly the same i/o parameters for it to function properly.
    What I am trying to find is: Whether it is possible to find out (using some global variables) that when the 2 events are happening simultaneously, their functionalities could be combined and serialized in just one refresh of the webpage. and how?
    I am trying to get this project done by Java resources and am myself not very technical with Java. If a solution exists and I get to know it exists, I can guide the programmers to try out the approach that come up.
    Thanks so much :)

  • Handling multiple events simultaneously.

    Hi,
    I have a window with a CNiGraph inside. In the graph I have multple traces. I have a toolbar which has the following buttons:
    * Pan
    * Zoom Area
    * ZoomX
    * ZoomY
    * Range mark
    * Add annotation
    When the user clicks a toolbar item I have to change the Tracking mode to the appropriate mode, eg
    if (m_nMode == 0)
    m_Graph2D.SetTrackMode(CNiGraph::TrackAllEvents);
    else if (m_nMode == 1)
    m_Graph2D.SetTrackMode(CNiGraph::TrackPanPlotAreaXY);
    else if(m_nMode == 2)
    m_Graph2D.SetTrackMode(CNiGraph::TrackZoomRectXY );
    else if(m_nMode == 3)
    m_Graph2D.SetTrackMode(CNiGraph::TrackZoomRectX);
    else if(m_nMode == 4)
    m_Graph2D.SetTrackMode(CNiGraph::TrackZoomRectY);
    else if(m_nMode == 5)
    m_Graph2D.SetTrackMode
    (CNiGraph::TrackDragCursor);
    else if (m_nMode == 6)
    m_Graph2D.SetTrackMode(CNiGraph::TrackDragAnnotation)
    My problem is the following. If the user has a cursor displayed and wants to zoom I set the trackmode, however if after the zoom he wants to move the cursor I have to change the trackmode. Is there a way to have multiple trackmodes at the same time. Meaning if the user creates a rectangle for zooming it zooms however if the user starts dragging an annotation or a cursor it will respond to that.
    Since if I change to TrackAllEvents it will not track my cursor or my annotations, since the events are never fired.
    Please help,
    Thanks
    Miklos

    The Measurement Studio C++ graph does not support enabling multiple interaction modes. As you suggest, the way to do this is to have a toolbar, in which the user can select the interaction mode that he or she wants.
    On a side note, the Measurement Studio .NET graph does support enabling multiple interaction modes. However, using the Measurement Studio .NET graph would require that you use a managed language (e.g. C#, VB.NET, Managed C++) for your user interface.

  • How to handle fault event using Cairngorm?

    Hi,
    I have started using Cairgorm framework recently. But in this, I'm not able to figure out a place to handle a fault event. Based on some tutorial, here's my Command code:
    public class LoginCommand implements ICommand, IResponder{
            public var model:ViewModelLocator = ViewModelLocator.getInstance();
            public function LoginCommand(){
            public function execute(event:CairngormEvent):void{
                var loginEvent:LoginEvent = event as LoginEvent;
                var delegate:LoginDelegate = new LoginDelegate(this);   
                model.userName = loginEvent.loginAttempt.userName;
                model.password = loginEvent.loginAttempt.password;
                delegate.login(loginEvent.loginAttempt);
            public function result(data:Object):void{
                model.applicationState = model.constants.MAIN_SCREEN;
                model.acCarbonFootPrint = data.result.EtCarbonFootPrint;
                model.acVariants = data.result.EtVariant;
                model.acBuildings = data.result.EtBuilding;
                model.cbLabelField = model.constants.FIELD_DESC_NAME;
                CursorManager.removeBusyCursor();
            public function fault(info:Object):void{
                CursorManager.removeBusyCursor();
                var faultEvent:FaultEvent = FaultEvent(info);
                Alert.show("Some fault...");
    If the return from the webservice is successful, it get's into result function. But if there is something wrong(like URL is offline), it wont get inside the fault function. Instead I get a runtime error. Here' a screen shot which depicts the dispatch of fault event from WebService.as:
    Is there some other place\function where I can catch this fault event?
    -Deepak

    Usually, if there is a mismatch in data type (input character length exceeds the number that is defined for a field at backend DB table), I get a faultCode:DecodingError
    faultString:SOAP Response cannot be decoded. Raw response:
    This fault event will be caught in the fault function in the code above.
    But it is not catching the faultCode, Server.Error.Request and it's not triggering the fault function.................

  • How to handle multiple SMS using push registry

    Hello all
    I m using push registry. for incomming sms
    My application have some tasks after reciving sms form a particular phone no. Application will starts When u get a SMS from a number say 122222.
    After reciving an sms application is busy in further task.
    What will happen when another sms comes??
    Will Application Suspendes?? or application listen that sms??

    hi vinay,
    My name is lakshman.I am alos trying to implement the sms and call option to my application.
    If you don't mind can you give me suggestions in the following
    1) how to Implement the call option in our application
    2)how to implement the sms option in our application
    i am waiting for your reply
    thanks in advance
    or else give me the site address where i can find the solutions
    ok thankyou
    lakshman

  • Problem when handling multiple messages using sequential convoy

    Hi Guys,
    We receive two files from FTP server. One is Order file and other one is notes file which is optional one. If the note flag in order file is 1 then we should process notes file as well. Here we implemented sequential convoy and it was working fine when we
    receive order file first and then notes file. it is throwing error when we receive notes file first as we set initialize correlation for Order file.  Please share your ideas what to do when we receive notes file first than order file?. Thanks!!

    Hi,
    i added debug points and ran it. i dropped one order file and one note file but it is initializing active instance for both order and note files. Here is the order of logs.
    Initialized Order
    Initialized Note
    followed Note

  • Multiple event handlers registered for the same event and error when adding users to sec groups

    Project Server 2013 CU April (May) 2014
    I've created and installed two event handlers (separate dll:s) and both are triggering on Project Published - initially, both are working fine.
    After an IISReset, trying to create a new security group (or add a user to an existing group) will result in an error on the page and a corresponding error in the ULS log - the latter indicating an error in the method security.creategroups, and specifically
    a problem 'An item with the same key has already been added.'
    An SQL trace reveals a break in execution after executing the proc 'pub.MSP_ADMIN_ReadEventReceivers' which returns all registered event handlers.
    In my case, the result of that proc execution shows that there are two event handlers registered with an EVENT_ID of 53 (Project Published) and with ORDER_FIRED set to 1 and 2 respectively.
    I tried removing one of the event receivers using the Central Admin PWA interface and then everything worked just fine - I added the event receiver back again, and everything STILL worked! IISReset and I got the error back again. :-(
    Since there's obviously some problem with reading multiple entries from that table regardless of the ORDER_FIRED differentiation, I tried temporarily modifying one of the '53' entries in the table directly and then the sec group was created just fine!
    I would like to know if anyone else has seen this? I've seen this on three separate installations now after deploying a second event listener onto those systems.
    /Lars Hammarberg
    //Lars Hammarberg www.connecta.se

    Hi Lars,
    yes I have seen the same issue. It is not related to April CU. I had the error before with SP1.
    It is not only an issue with the security groups. At least in our case nothing worked at all. No custom field editing, all Queue Jobs failing.
    For your case I suggest you consolidate your code in one eventhandler.
    Theory says that you can have more than 1 (up to 999) eventhandlers for one Event (http://msdn.microsoft.com/en-us/library/ms481079(v=office.12).aspx) but that seems not to
    work. Not sure, if it worked in earlier versions.
    Kind regards
    Christoph
    Christoph Muelder | Senior Consultant, MCTS, MCSE, MCT | SOLVIN information management GmbH, Germany

  • Handling 3d objects using JavaScript for Acrobat 3D Annotations API

    I am trying to learn how to handle 3d objects with this manual: http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_3d_api_reference.pdf
    When I execute some code, for example,
    myTimeHandler= new TimeEventHandler();
    myTimeHandler.onEvent= function( event )
    console.print( "Current simulation time is:" + event.time );
    console.print( " second(s)" );
    runtime.addEventHandler( myTimeHandler );
    I get an error like this:
    TimeEventHandler is not defined
    Why?
    P.S. I have 3d object in the document, and can get it with function getAnnots3D.

    You have to run the code in the context of the 3D annotation (by attaching the script to the annotation's properties panel, or by right-clicking the active 3D scene and choosing "run a javascript". You cannot run it in the console.

  • Create multiple VIs using a for loop

    Hi,
    I'm still pretty new to LabVIEW, so this question might be easy for you guys here..
    I'll simplify what I'm trying to do.
    I've got two numeric controllers that act as the rows and columns of a matrix.
    I'd like to take those numbers from these two controllers and use them to create a matrix of a certain picture.
    Example:
    The rows controller is given 3, and the columns controller is given 4.
    Using these numbers I would like the end result to show a certain image (let's say, a cube) multiplied on a 3 by 4 matrix.
    Let's say the picture is an X, then the end result should be:
    XXXX
    XXXX
    XXXX 
    I think I should be using a double for loop (one inside the other obviously), and I should also create the "position" property in order to display each picture of the cube in it's right place.
    The problem is that I don't know how to CREATE the pictures over and over again, while being able to control each one's position property.
    Any help would be GREATLY appreciated!
    Solved!
    Go to Solution.

    1) By "multiple VIs" I meant that I think that I need to create express VIs on the fly while running the for loop. I might be totally wrong here.
    2) Yes, by "numeric controllers" I meant numeric controls in the front panel.
    3) The matrix I'm referring too isn't an object nor a VI in LabVIEW but a virtual matrix that is the end result. I used the term "matrix" because the end result is actually a matrix (of rows and columns) of pictures..
    I'll try to elaborate and even simplify it more:
    Let's say I want to display one picture. That's easy, no problem there.
    Now let's say that I'd like to display n pictures on a one dimensional array. Just one row.
    What I think I need to do is to read from the numeric control in the front panel the number (n) of pictures, and then create them in a for loop, while using the "position" property to set the distance between each picture (using coordinates).
    My original question was just like the above, but for a two dimensional matrix/array. So I guess we can even simplify it even more, by saying it's only one dimensional.
    My way of action here might be totally wrong, and there might be an easier way or another way to go about this...
    Thanks for the quick answer!!  

  • Having trouble sizing multiple graphs using a For Loop in Excel.

    I am creating multiple graphs in Excel using LabVIEW but I can only set the size for the first graph.  The others are ignored.  I am using the Excel Insert Graph Vi.  I can change the position of al 4 graphs and i can change the size of the first graph created but not the others.  Simply create and save a blank Excel workbook and use it when it prompts for the file.  Here is my my code.  Will someone please let me know what is going on.  Thanks.
    Attachments:
    Excel Graph Test.vi ‏88 KB

    If anyone is still following this thread, I have discovered a solution to the problem of resizing multiple graphs in Excel with the Report Generation Toolkit.  The problem seems to occur because subsequent graphs that are added to the report are configured to "Lock Aspect Ratio", which means you cannot assign a width and height to the graph that would violate its initial width/height proportions.  I was able to get around this behavior by defining the object's position and dimensions after creating the object, as opposed to defining them at the same time the object was created.  This problem will be fixed in a future release of the Report Generation Toolkit.  For now, you can fix the problem yourself by modifying vi.lib\addons\_office\excel.llb\Excel Insert Graph.vi.  Here is a screenshot of the affected area of code as it is currently implemented:
    And here is a screenshot of what the code looks like after my modifications that fix the problem:
    By assigning the dimensions after turning off the "Lock Aspect Ratio" feature, we see that all the subsequent graphs are sized correctly.
    Please let me know if you have any questions on this fix.
    -D
    Message Edited by Darren on 07-06-2006 04:48 PM
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman
    Attachments:
    Add_Chart_AFTER.jpg ‏91 KB
    Add_Chart_BEFORE.jpg ‏53 KB

  • Creating multiple mailboxes using Powershell for users who already exist in AD

    Hi there,
    Wondering if anyone can help, I am wanting to use Powershell to run a command which references a CSV file to create a mailbox for a user who already exists in AD.
    It needs to reference the username, to ensure the correct user has a mailbox created (as mentioned they exist already in the domain), place them on a specific database (e.g DB1) and assign them an email address as well as possibly an alias email address
    too.
    Can anyone provide me the headings of the CSV file which would be needed as well as the powershell command to run. It would be great too if I could also set the quota sizes for the user at the same time of creating the mailbox, but if not possible or complicated
    I can run a script afterwards to do this. I would only want to warn them when their mailbox is 1.5GB in size and stop them sending when it reaches 2GB. 
    Thanks

    So create a csv file with the following headers and data
    UserID, Alias
    UserID should be the user SamAccountName, and the Alias is the Mailbox Alias that you want to set. Supposing that the csv file is named users.csv and located under C:\ , open the Exchange Management Console and run:
    $users = Import-Csv c:\users.csv
    Foreach ($user in $users) {
    Enable-Mailbox -Identity $user.UserID -alias $user.alias -database 'DB1'
    Set-Mailbox -Identity $user.UserID -IssueWarningQuota 1.5gb -ProhibitSendQuota 2gb 
    Please Mark As Answer if this helps
    ammarhasayen

Maybe you are looking for

  • How to transfer sales bom from SAP R/3 to APO?

    Hi Experts, I just want to ask how to transfer sales bom from R/3 to APO? if i change my bom usage to 5 and use this BOM in my Production version be enough to send it to APO? Also, this is my first time using sales bom, could you please help me under

  • Problem with append += text in Text Field

    Hi guys i have a problem with append text. I have one array which contain some city names, like CityArea=["NAME 1", "NAME2" ...etc]; Then i have one String and one Text Field. Using for loop im getting right results. But when im running script again

  • Does CF offer an alternative to frames ?

    I have a web application where we need an illustration to be fixed at the top of the screen, and then row after row of database results, which offer information which references the drawing at the top of the screen. My boss has asked if there's any w

  • When taking a picture with IPad. Camera my recipients always receive the photo upside down. WHY?

    When taking a photo with my IPad, then sending it, my recipients always the phot upside down.  WHY?   Help Please.

  • PDF and FLV links not working

    I have a course that's made up of a series of hyperlinked swfs and html files. There are also some flvs and pdfs in this. We had to design it in this format (vs. pdf or exe) because of our customer's special requirements. To try to make a long story