Using event as keypress

Hi everybody,
I'm new to Javscript in Acrobat, but I looked through some tutorials and the scripting guide.
I need to use a Javascript when someone is entering a text into a textfield.
I found in the API the event "event.keyDown", but I don't know where and how I can use it on one textfield.
Does anybody have an example ?
I need something like this :
var field = this.getField("testfield")
if ( event.keyDown on field ) {     // This is the part where I am struggeling -.-
     app.alert ( field.value ) ;

It works partly ...
When I use " app.alert ( event.value ) ; " , I don't get the full text which I inserted, I get the text without the last insertet Number/Character.
So I have asd and I type 1 behind it, then I get the alert "asd" instead of asd1.
What am I doing wrong now -.- ?

Similar Messages

  • How do I use event.target.name in AS2?

    Thanks to kglad I was able to see how event.target.name in AS3 could make a button load a movieclip with the same namesake.
    I'm doing the same thing now in AS2 but don't know what to write instead of event.target.name.
    And so at the moment each button pushes info into an array and then a function uses that to decide which movieclip to attach to a holder after it has faded out once, and then fades in again...
    // ***** IMAGE GALLERY START ***** //
    // Add image to holder
    imgholder.attachMovie("img0", "image0_0", 1)
    // Array
    var nextLoad = ["img0"];
    // Btn listeners
    img5.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img5"); btnClick() } // Written on 1 line
    img4.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img4"); btnClick() }
    img3.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img3"); btnClick() }
    img2.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img2"); btnClick() }
    img1.onRelease = function() {
    nextLoad.pop();
    nextLoad.push("img1");
    btnClick()
    img0.onRelease = function() {
    nextLoad.pop();
    nextLoad.push("img0");
    btnClick()
    // The btn function
    function btnClick() {
    trace ("click");
    var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 100, 0, 1, true);
    myImgTween.onMotionFinished = function() {
    fadeOutImg();
    // The btn function part II
    function fadeOutImg() {
    trace ("fadeOutImg");
    imgholder.attachMovie(nextLoad, "image1_1", 1);
    var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 0, 100, 1, true);
    I know I should be able to push the button name into the array, but am having to use a string... I'm sure my code is cumbersome!! But it works. I've tried pushing the button name but it end up including the full stage reference.
    Is there a cleaner way of doing this using event.target.name?
    Thanks for looking!

    There is no event.target in AS2. However since AS2 has no way of remembering the scope object where the target object resides, you can use this to your advantage to retrieve the name of the target by using the "this" command in the function whenever you use the above format "mc.onPress = myfunc". FYI, the popular workaround Delegate, made it possible that when you called "this" in the function, you could retrieve the scope object where the target instance resides. So without its use, "this" will return the name of the target object. Anyway this is the code you can use:
    imgholder.attachMovie("img0","image0_0",1);
    var nextLoad = ["img0"];
    img5.onRelease = onImgRelease;
    img4.onRelease = onImgRelease;
    img3.onRelease = onImgRelease;
    img2.onRelease = onImgRelease;
    img1.onRelease = onImgRelease;
    img0.onRelease = onImgRelease;
    function onImgRelease():Void {
       nextLoad.pop();
       nextLoad.push(this._name);
       btnClick();
    // The btn function
    function btnClick() {
       trace("click");
       var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 100, 0, 1, true);
       myImgTween.onMotionFinished = function() {
          fadeOutImg();
    // The btn function part II
    function fadeOutImg() {
       trace("fadeOutImg");
       imgholder.attachMovie(nextLoad,"image1_1",1);
       var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 0, 100, 1, true);

  • How can I view my photos in "Events" like in iPhoto? How can I create events?  I have 55,000 photos and 1700 events so the only way I can possibly manage my photos is using events that are one slide in size.

    I have 55,000 images organized into about 1700 events. The only reasonable way to view my library is using events in iPhoto where each event has one image That still leaves 1700 images to sort through but that is a lot easier than 55,000 images.  In the side bar is a folder with "iPhoto Events" but those views still show all of the slides.  How can I create events and view my photos as events as in iPhoto?  Events are critical for large libraries and has been my primary way to sort images.
    Thanks!

    I had a problem a couple of months ago when iPhotos suddenly rearranged the order of my Events (Why won't iPhoto let me arrange my photos?) .  I was told "Use albums not events - events are not a good way to organize - albums and folder are designed for organisation and are very flexible".
    Haha!  I should have paid attention and read between the lines!  My iPhotos were highly organised groupings - not according to date but the way I wanted them - and it was so easy to do!  I see now that if I had them all in albums, as per the Apple Apologist suggestion, I wouldn't have this unholy mess I have been left with just to make iPhone & iCloud users happy.  I am now going through Photos and making Albums (of what used to be in my Events)  ... maybe I'll get this finished before they do another non user friendly update!

  • Add fields to maintenance view and update then using events

    Hi experts:
      I've created a table with 4 fields, one of them is userid. Also, there is a maintenance view to add new entries.
      I want to display user name when typing userid using events (1 or 21). I know how to do it if username is one of the fields of the table, but there is a requirement to not store username in the table, just userid.
    My question is: is possible to add a field into the maintenance view and update it using events but not store the value in DB?.
    Thanks in advance for your help.
    Regards,
    Carlos.

    In the save event just clear the entries of the field(user name) in the internal table.

  • Can i use events for anything i want?

    hi
    i've got a doubt about events. i am using events to send information between objects, so that the objects don't need to know who they are sending the information to.
    so i created my own events, listener and listenermulticaster
    but i have the feeling that events are intended to be used by the GUI objects, swing and awt.
    my question is if it is a good programming practice to use events to communicate other kind of objects. or maybe using events is not desirable at all??
    if events must not be used for this kind of works, what are the other ways to do it??
    thanx in advance,
    Lagarto

    well, thank you for your time
    now im considering using interfaces. if i understand it, the idea would be this:
    object A has information to send, so it has an atribute of tipe MyInterface, which has the methods to send the data.
    object B wants to get the data, so it create a new MyInterface and do something like:
    A.setMyInterface(new MyInterface() {....});
    i think this would work if there is only object B which wants the data (actually, this is the case i was thinking of from the beginning)
    but what can i do if there are more objects wich must get the data?
    Must the object A keep a Vector or something of more than one interfaces??
    thanks again...
    Lagarto

  • HOW TO CREATE  and  USE EVENTS IN WORKFLOWS .

    HOW TO CREATE  and  USE EVENTS IN WORKFLOWS with the help of classes.
    What i am doing is..
    open se24
    event tab->event name->parameters
    method tab->method name->event handler->copy parameters
    interface tab->if_workflow->enter
    tell me what else to do step by step
    Another important thing is that HOW to use these class events to trigger the workflows.
    REPLY ASAP
    THXS IN ADVANCE

    Hi,
    Pl. see this blog...
    Raising ABAP OO events for workflow
    Regards,
    JOy.

  • Why and how to use events in abap objects

    Dear all,
      Please explain me why and how to use events in abap objects with real time example
    regards
    pankaj giri

    Hi Pankaj,
    I will try to explain why to use events... How to use is a different topic.. which others have already answered...
    This is same from your prev. post...
    Events :
    Technically speaking :
    " Events are notifications an object receives from, or transmits to, other objects or applications. Events allow objects to perform actions whenever a specific occurrence takes place. Microsoft Windows is an event-driven operating system, events can come from other objects, applications, or user input such as mouse clicks or key presses. "
    Lets say you have an ALV - An editable one ...
    Lats say - Once you press some button  you want some kind of validation to be done.
    How to do this ?
    Raise an Event - Which is handled by a method and write the validation code.
    Now you might argue, that I can do it in this way : Capture the function code - and call the validate method.
    Yes, in this case it can be done.. But lets say .. you change a field in the ALV and you want the validation to be done as soon as he is done with typing.
    Where is the function code here ? No function code... But there is an event here - The data changed event.
    So you can raise a data changed event that can be handled and will do the validation.
    It is not user friendly that you ask the user to press a button (to get the function code) for validation each time he enters a data.
    The events can be raised by a system, or by a program also. So in this case the data changed event is raised by a system that you can handle.
    Also, Lets say on a particular action you want some code to trigger. (You can take the same example of validation code). In this case the code to trigger is in a separate class. The object of which is not available here at this moment. (This case happens very frequently).
    Advantage with events : Event handlers can be in a separate class also.
    e.g : In the middle of some business logic .. you encounter a error. You want to send this information to the UI (to user - in form of a pop up) and then continue with some processing.
    In many cases - A direct method call to trigger the pop up is not done. Because (in ideal cases) the engine must not interact with UI directly - Because the UI could be some other application - like a windows UI but the error comes from some SAP program.
    So - A event is raised from the engine that is handled in the UI and a pop up is triggered.
    Here -- I would have different classes (lets say for different Operating Systems). And all these classes must register to the event ERROR raised in application.
    And these different classes for different Operation systems will have different code to raise a pop-up.
    Now you can imagine : If you coded a pop-up for Windows (in your application logic) .. it will not work for Mac or Linux. But of you raise a event.. that is handled separately by a different UI classes for Win, Linux or Mac  they will catch this event and process accordingly.
    May be I complicated this explanation .... but I couldn't think of a simpler and concrete example.
    Cheers.
    Varun.

  • USER LOGIN GENERATION USING EVENT HANDLER IN OIM 11G

    Hi
    I am looking to generate user logins in OIM 11g (11.1.1.5) using event handlers. Can anyone guide me with the process and which API need to be used?
    Regards

    You have to write your custom class which implements oracle.iam.identity.usermgmt.api.UserNamePolicy. Then you have to register the plugin which will contain the plugin.xml and class file of your custom code.
    More in this metalink ID 1228035.1

  • How to Update multiple items in other list using event handler?

    Hi All,
    If i update a item in a list, then i should update multiple items in another list need to be update. How to achive using event receivers?

    Hi Sam,
    According to your description, my understanding is that you want to update multiple items in another list when updated a list item.
    In the event receiver, you can update the multiple item using Client Object Model.
    Here is a code snippet for your reference:
    public override void ItemUpdated(SPItemEventProperties properties)
    string siteUrl = "http://sp2013sps/sites/test/";
    ClientContext clientContext = new ClientContext(siteUrl);
    List oList = clientContext.Web.Lists.GetByTitle("another list name");
    ListItem oListItem = oList.GetItemById(1);
    oListItem["Title"] = "Hello World Updated!";
    oListItem.Update();
    clientContext.ExecuteQuery();
    Best regards,<o:p></o:p>
    Zhengyu Guo
    Zhengyu Guo
    TechNet Community Support

  • Using events in Process chain

    Hi All,
    I have below scenario:
    Now we are using event collecter and subsequent event in event collector .
    I am going to convert my loads into Process chain from Infopackage groups. My problem is I can use event1 directly in Start of process chain but how to trigger event2 using this chain. I need to trigger event2 once my PC is completed successfully. The even2 will trigger a background job to execute one ABAP program. This ABAP program triggers event1 again if it meets certain requirement.
    Hope you understood my problem.
    Thanks in advance
    Vani

    Hi,
    If I have understood properly,
    Event1(Start) --> Sequence of PC steps --> ABAP Program Process Type (To trigger Event2)  --> Event2 triggers again Event1( If meets requirement)
    What is your End of the Process Chain if it triggers again Event1?
    Why do you want to trigger events in a cyclic way?
    Regards,
    Suman

  • How to update Payload in existing BO using Event SubProcess( Non Interrupt)

    Hi ,
    I am using oracle BPM 11.6 Version.
    Let me explain the Problem :
    1. CoreProcess contains Three Human Task.Following Roles
    1) Approver One .
    2) Approver Two.
    3) Approver Three.
    2. Request Created through external Application ( As-Synchronous Process )
    3. PAN Card number as Correlation Key and Maintain Status element also.
    Status like -- Created, cancelled ,opened, Re-opened.
    4. External system have to update status on CoreProcess , using Event Subprocess ( as non interrupting Event to update Current Payload ).
    Problem I am facing :
    When I try to update Status , Not updated in my coreProcess payload.when ever coreProcess instance wait in any human task workspace.
    Using Event subProcess ( Non interrupt Event to achive this ) but my coreProcess pay load information not changed.I tried with Update Task to achive but no option to achive this.
    Can any one please help me . Thanks in advance.
    Regards
    krishna Moorthi p

    A non-interrupting even subprocess will no work on a copy of the data, it works on the same copy of the data as the rest of the process. Your problem is coming from the fact that human tasks are handled by the TaskService which is external to the BPMN engine. When the human task is created a copy of the payload is sent to the TaskService. This data is kept there until the task is completed at which time the updated payload is sent back to BPM.
    In your case you are updating the process data objects but that does not update the task payload as well. Unfortunately the Update Task activity does not seem to support updating the payload. I think the 2 options you would have are:
    1. Use the TaskService directly as a web service to update the payload
    2. Try updating the payload and then withdrawing the task. You can then possibly model a loop back to your human task in the process.

  • Using Event 21 in Table maintenance generator

    Hi,
    How can i get the updated record when using event 21 in maintenance generator.

    >
    ABINASH VERMA wrote:
    > Hi,
    >
    > How can i get the updated record when using event 21 in maintenance generator.
    Can You give Us any Idea what is Event 21 in Maintenance Generator.
    Regards,
    Suneel G

  • Use Events or delegates in my application??

    I am trying to implements events in c#. my scenario is that there will be multiple events and there will be multiple events listeners to an event(many to many relationship).
    the problem here is since there are many events and if i implement all in one class, maintaining code will a tough task, and if i create one class per event there will be too many classes.
    I found a solution which has an event broker in this link: http://msforge.net/blogs/paki/archive/2007/11/20/EventBroker-implementation-in-C_2300_-full-source-code.aspx
    but here the author is using delegates only instead of events. he is maintaining a dictionary wherein he is saving some event ID as key and list of delegates as value. this solves my problem of code maintenance.
    my question is that is it fine to do this way since behind the scenes an event is a construct that wraps a delegate only or use events which c# is already providing rather than maintaining a dictionary?
    which one is a better way in terms of performance or any other way?
    Also is there any better way to implement my scenario with events
    Please provide your inputs.

    You should take a look at the event aggregator pattern:
    http://martinfowler.com/eaaDev/EventAggregator.html
    I have written a blog post about how to communicate between classes using the event aggregator class that is included in Prism here:
    http://blog.magnusmontin.net/2014/02/28/using-the-event-aggregator-pattern-to-communicate-between-view-models/
    Prism is a framework for building composite XAML based applications from the Microsoft Patterns and Practices Team:
    http://msdn.microsoft.com/en-us/library/gg406140.aspx. But even if you are not developing a XAML based application, the concepts and many of the components are still useful.
    Another popular framework out there is MvvmLight which uses a Messenger class to handle this kind of communication:
    https://marcominerva.wordpress.com/2014/06/25/how-to-send-string-and-content-messages-with-mvvm-light-messenger/
    http://stackoverflow.com/questions/16993918/mvvm-light-messenger-sending-and-registering-objects
    http://msdn.microsoft.com/en-us/magazine/dn745866.aspx
    Hope that helps.
    Please remember to mark helpful posts as answer and/or helpful and please start a new thread if you have a new question.

  • Am I the only one that uses Events like Albums?

    Ever since the iPhoto '06 days (now on iPhoto '11), I've been using Events like Albums.  Like the event "Niece" where I put all the pictures of my niece, rather than create an Album for it.  I just like the visual layout of Events better, never really got into the Albums feature much.
    Does anyone else do this, or is it just me?  Are there any drawbacks to doing this?  Is there ever a circumstance where an Album would be better?

    Photos in Events can only be sorted by date while those in albums can be sorted by title, date, keyword, manually and rating. 
    To assemble all photos of your niece together you could create a Smart Album with the criteria Keyword contains niece.  Then as you import new batches of photos into its event go thru and add the appropriate keyword to those photos containing your niece.  All automatic. They will show up in the smart album for your niece.
    Your method is more like file organization in the Finder rather than digital asset management like iPhoto does.
    OT

  • Can I use Event structures in a subVI?

    Hi,
    I have a subVI (ProvaEv1.vi) that use an event structure inside. But when I use it in a VI (ProvaVI.vi) the event structure in the subVI doesn't catch the events.
    I tried to insert the event structure in a while loop but it doesn't work too.
    Could you help me?
    Thanks Ius
    Attachments:
    ProvaVI.vi ‏11 KB
    ProvaEv1.vi ‏15 KB

    "iusn" <[email protected]> wrote in message news:[email protected]...
    Thanks to all for your answers!
    Wiebe! I tried to do as you suggested but I am not able to link the Event Reference Number inside te SubVI with the Event Register Number of the Register for Event in Main VI. There is e class conflict. Another question: how the SubVI can know the structure of the Register event outside?My aim was to create a modular structure but it seems very difficult, wath do you think about these problems?
    The broken wire is related to your question. The event structure inside the sub vi knows about the events you register in the main, because the reference wire/control has a "strong" type. It contains information about the registered events. That is also why the wire is broken. You have to register all events, then create an indicator/control of the output. Use that control in the subvi. You have to do this every time the events change (you might use a type def if you use the control a lot).
    Usually, the events that you would want to put inside subvi's are those related to user interface objects. I've had this a lot. You make a nice interface, but it's not reuseable, because the events are mixed with all the other events. Only solotion is to manually add the needed event cases in your program, and copy the code.
    Even if you can put the events in a sub vi, I'd expect hanging vi's when more subvi's are registered for the same event. It's hard to tell without trying. So it's not a real solution either.
    Like Chrisger suggested, the event callback might help a little, but they are tricky, and actually ment for this (they are intended for activex callbacks).
    Perhaps you should look at XControls (if you use 8.2). It would be more work to replace your code to XControls, but once you're done, you have reusable code.. Haven't worked with them jet, but they are invented for this problem...
    Regards,
    Wiebe.
    I have already create my application using event structure just in Main VI but it seems very complicate to read and keep update, I would have wanted to give modularity to my application.
    Thanks Ius
    SubVIEventMain.vi:
    http://forums.ni.com/attachments/ni/170/203225/1/SubVIEventMain.vi
    SubVIEvent.vi:
    http://forums.ni.com/attachments/ni/170/203225/2/SubVIEvent.vi

Maybe you are looking for

  • How to share security context between different application ?

    Hi all, I have two applications(ADF faces + BC, JDev 10.1.3.1) deployed into OAS 10.1.3.1. The two applications are : 1) SalesApp -> main menu page = SalesMenu.jspx 2) ReportApp -> main menu page = ReportMenu.jspx I want implement security using Cust

  • Problem opening Aperture in Mountain Lion

    I'm running Aperture 3.3.2 and upgraded to Mountain Lion last night. Since the upgrade Aperture is hanging on the "Opening Aperture Library" window. I've repaired and rebuilt my library with all referenced files on externals attached. No help. I've a

  • Down pmt clearing through APP

    Dear Friends, Can we clear the vendor down payment automatically?  I mean through APP can we do this? Please give me your inputs Thanks in advnace NMB

  • Poor resolution when burning in IDVD

    I'm trying to create a slide show using ken burns effects, transitions, music and then burn to a dvd to share with family. I was told the best way to do this is to create the slide show in I-movie, share it to I-dvd, and then burn it. When playing ba

  • How do I get new tab to open to google search? It used to!

    New tabs had started opening to Yahoo. Stopped using Mozillauntil Chrome started annoying me. Got rid of Yahoo search page by disabling freezenet but now when I click on the + sign to open a new tab, I get a blank page. I used to click on the + sign