Taking action only the first time an event executes

I want a certain action to occur only the first time an event handler for a button is called. Is there a simple way to do this?
Bill F

There are two pretty easy ways to do this.
If you want to continue to trap other events (other event cases in your event structure), use a shift register:
1. Add a shift register to the loop containing your event structure. (right-click on the left-hand border of your loop and select Add Shift Register).
2. Wire a numeric constant = 0 from outside the loop to the input (left-hand) terminal of your shift register.
3. Inside your event structure, in the event case you want to handle only once, put a case structure around the code you want to execute only once. That code should be within the True case.
4. Add an Equal To 0? function (from the comparison palette) to the loop. Wire the input shift register to the input of Equal To 0?. Wire the output of Equal To 0? t
o the selctor for your new case.
5. Within the True case of your new case structure, add a numeric constant = 1. Wire that constant out to the output (right-hand) side of your shift register.
6. Within the False case of your new case structure, wire the input side of your shift register to the output tunnel created by the wiring in step 5.
This way the event structure will keep running and handling other events, but the case you just modified will only run the first time: the first time you get the event, the shift register will = 0 so you'll execute the True case of your new case structure. Within that case, you set the shift register to 1. The next time you get that event, the shift register = 1, not 0, so you'll execute the False case and not the code in your True case.
If you want to stop all event handling after the first event and your event handler is the only thing with its loop, from the event case (for the event you want to stop on), wire a True boolean constant out to
the Stop terminal of the loop containing your event structure.

Similar Messages

  • App file sharing: files are displayed only the first time...

    clicking somewhere else and then back to the application that you want to share files are not there any more.
    I've to close and re-open the itunes in order to see them again.
    itunes is running on windows 7 64bit.
    is this a bug ?
    thank you.

    Hi! I have the same, exact problem. The files are displayed only the first time I look at the apps listed under File Sharing. If I look at another app on the list, the files on the one I previously checked are gone when I look at it again. Is there any way to fix this? I have a Lenovo X61s on Windows XP Professional 32 bit.

  • QuickTime launches slow but only the first time

    QuickTime is slow in Mac OS 10.7, that's been widely discussed.
    In my case, QuickTime is slow to open up a video file (MP4, AVI, WMV, etc,), but only the first time.  After I've successfully opened up the one video file, all subsequent video files open up quickly, even after quitting QuickTime.
    However, after a restart it's the same old situation again.
    Is QuickTime installing something, then removing it when the computer shuts down?

    QuickTime is slow in Mac OS 10.7, that's been widely discussed.
    In my case, QuickTime is slow to open up a video file (MP4, AVI, WMV, etc,), but only the first time.  After I've successfully opened up the one video file, all subsequent video files open up quickly, even after quitting QuickTime.
    However, after a restart it's the same old situation again.
    Is QuickTime installing something, then removing it when the computer shuts down?

  • Wait cursor appears only the first time... unless I don't move the mouse!

    Ah yes, another cursor problem:
    I am setting a wait cursor in my main JFrame when a key-release or a menu item click is detected (the time-consuming action is then triggered in a child JInternalFrame), and so far, it's been working great.
    Then I noticed that the wait cursor only appears the first time the time-consuming action is called (or more precisely, if I never move the mouse, it happens every time as it should, but if I move the mouse, it only happens the first time! Ah, and I noticed I CAN move the mouse but ONLY when it is in the form of the wait cursor!).
    Strangely, I can see the cursor blink briefly when the action is done, precisely when it should be changing back to the default cursor... what gives? If I close the child internal frame and re-open it, I can get the wait cursor again the first time only (again, unless I keep the mouse still, in which case it works great - argh).
    Any ideas would be deeply appreciated!
    Cheers!
    PS - Here's a snippet of how we set the cursor, this is code in our main JFrame, called via either a keypress event or clicking on a menu item - mostly it's stuff that is unrelated, and we simply set the wait cursor as the very first line, so why in the world would it skip that line???? (the rest of the lines do in fact get executed):
    private void refreshMenuItemActionPerformed(java.awt.event.ActionEvent evt) {     doRefreshMenuItemAction(); }
    private void doRefreshMenuItemAction() {
    this.setCursor(new Cursor(Cursor.WAIT_CURSOR));
    JDesktopPane desktop = (JDesktopPane)this.getContentPane().getComponent(0);
    JInternalFrame activeFrame = desktop.getSelectedFrame();
    try {
    if ( activeFrame instanceof IDataDrivenForm ) {
    ((IDataDrivenForm)activeFrame).refresh();
    } catch (Exception ex) {
    ex.printStackTrace();
    this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));

    almost...
    I now see that glasspanes are an answer to that question. I got it to work (almost) using a glasspane (see code snippet below). But what I can't quite grasp now is why this code does not work when I call it from a child (contained) dialog (and possibly internal frames as well)??? When I do so, the dialog freezes (the button I pressed doesn't even release) and the cursor does not change to waiting. This time I'm really not sure where to go next....
    I appreciate anyone who has read this far, and would really be indebted to you for some good advice!
    PS - Here's the nifty code, placed in my main JFrame class. I just substituted "this.setBusy(true);" for every place I was manually setting the WAIT_CURSOR in the past (and of course with matching setBusy(false)):
    public final void setBusy(boolean isBusy)
    Component glassPane = this.getGlassPane();
    Cursor theCursor = isBusy ? Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ) : Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR );
    this.setCursor( theCursor );
    glassPane.setCursor( theCursor );
    glassPane.setVisible( isBusy );

  • RemoteObject FAULT handled only the first time

    I'm creating RemoteObject and then handling the fault event
    myRemoteObject.addEventListener(FaultEvent.FAULT,
    faultHandler);
    protected function traiterFaute(event:faultHandler): void
    CursorManager.removeBusyCursor();
    mx.controls.Alert.show("An error has occured");
    Why this event is only handled the first time ?? So in this
    cas the Alert Box is appearing only on the first fault !!!
    Is it normal ,

    I ended up creating a new RemoteObject on each request. Seems
    terribly inefficient, but it's the only thing that worked.

  • Time machine would back up only the first time after I shut off my imac and started it up again.  Then it would fail or claim it could not locate my external Hard Drive even though it's icon was showing in the time machine dialog window.

    Time machine only ever backed up the first time it runs immediately after I start up my computer after it has been shut off.  All other back up attemps fail.  Recently it stopped recognizing the icon for my external hard drive in the time machine dialog window where you select the hard drive to back up to, and turn on and off the time machine function.  Now the external HD icon only shows up on the desk top but no longer in the dialog box. I just tried shutting the computer off and turning it on again and now the light is on, on the external hard drive but the icon does not even appear on the desk top.
    The external hard drive is a 1TB Seagate. The drive still has plenty of unused capacity.  I ran a diagnostic test on it. It said the disk needed repair but the repair function would not work. The message stated that it could not be unmounted and repair is not available because the disk can't be written to. The Mac OX utility said the disk can still be opened but can't be changed nor repaired.  The external HD is not S.M.A.R.T. supported.
    I haven't tried replacing the cable yet. Is that the next thing I should try?

    What Mac OSX version are your running ("iOS" as shown in your profile cannot run on a Mac computer)?

  • Exception occurs only the first time

    The server listens on a port to which client connects in applet mode. Every time client connects to server for the first time (i.e. after a fresh server installation), the client pops an exception:
    java.io.InvalidClassException: javax.swing.ImageIcon$AccessibleImageIcon; local class incompatible: stream classdesc serialVersionUID = -3994512798706967451, local class serialVersionUID = -1903458698681874148.Subsequent client connects to server does not pop this exception. i.e. This occurs only for the first time.
    Through posts in forum, I thought that this could be due to swing serialization incompatibility across version.(But in this application both server and client are on the same m/c having a single JRE and JDK, both are of version 1.4.2 )
    But I am not able to reason out why the exception occurs only for the first time and then disappers in subsequent connects. ( despite clearing javaws cache and Browser cache and restarting server ... and it works on RMI mode).
    What could be the reason ?

    Hi
    We recently changed our load balancer to a new load balancer. we get this error only after the load balancer change.
    When the error occurs, I could see ORA-12571 error message only in the application error log. The listener.log has only the following message about TNS 12502. It does not have any message about ORA -12571.
    TNS-12502: TNS:listener received no CONNECT_DATA from client
    12-MAR-2010 12:23:26 * (CONNECT_DATA=(SERVICE_NAME=AppName)(CID=(PROGRAM=c:\wind ows\system32\inetsrv\w3wp.exe)(HOST=WEB02)(USER=NETWORK?SERVICE))) * (ADDRESS=(PROTOCOL=tcp)(HOST=172.x.x.x.x)(PORT=2202)) * establish * AppName * 0
    12-MAR-2010 12:23:26 * (CONNECT_DATA=(SERVICE_NAME=AppName)(CID=(PROGRAM=c:\wind ows\system32\inetsrv\w3wp.exe)(HOST=WEB02)(USER=NETWORK?SERVICE))) * (ADDRESS=(PROTOCOL=tcp)(HOST=172.x.x.x.x)(PORT=2203)) * establish * AppName * 0
    12-MAR-2010 12:23:26 * (CONNECT_DATA=(SERVICE_NAME=AppName)(CID=(PROGRAM=c:\wind ows\system32\inetsrv\w3wp.exe)(HOST=WEB02)(USER=NETWORK?SERVICE))) * (ADDRESS=(PROTOCOL=tcp)(HOST=172.x.x.x.x)(PORT=2204)) * establish * AppName * 0
    12-MAR-2010 12:24:09 * 12502
    TNS-12502: TNS:listener received no CONNECT_DATA from client
    Thanks
    Ashok

  • Hyperlinks work only the first time clicked when published

    I am using hyperlinked text captions for slide navigation within a course.  I have placed the text hyperlinks on the master slides so they appear throughout.  The hyperlinks either link to an external pdf (job aid) or to another slide within the course. 
    When I publish the course, the hyperlinks only work the first time they are clicked.  All other times, I get the hand cursor when I roll over them, but nothing happens when I click.  Is there a setting somewhere to allow for infinite clicks on they hyperlinks?

    Hi there
    Odd that this would happen. There is no setting I'm aware of that determines the number times a link may be clicked.
    My guess is that something else is going on. Normally, the slide is paused when the link is clicked. Is this the case for you? One thought is that by clicking the link, the pause is released and perhaps the link is then no longer active because the playhead reached a different spot?
    Cheers... Rick

  • BATCHINPUT: Screen appears only the first time

    Hi everybody,
    I have the following situation in R/3:
    On transaction ABZON when the user selects this transaction for the first time, appears a window asking for the company field (BUKRS). If the user enters the same transaction again without login off, that window doesn't appears going directly to the transaction's main screen.
    The problem is that I have to make a batch input of this transaction but doesn't want the user to logoff every time it needs to run the batch input again.
    How can I avoid that screen to appear or force the batch input to always show that screen.
    If anyone can help me will be appreciated.
    Thanks,
    Orlando.

    Orlando,  I've ran across this is same problem in another transaction.    What I did was I "separated" the transaction.  Meaning the first thing that happens when the transaction runs, is to take care of the window that appears only once during a log on session.  Then later when doing the BDC to actually do something, it will not need to have this part of the recording.
    So for example, do your recording for the window that pops up enter a value, and back out of the transaction.  Call this BDC code before doing any of the rest of the transactions.  Not that the value is filled, it will not pop up again during the rest of the session.  Call your BDC to process the rest of the transaction.
    Regards,
    Rich Heilman

  • Permissions issue only the FIRST time I try to overwrite a file.

    I've a standard user account and I've found overwriting protected files is bugged in Leopard.
    As an example: every time I'm upgrading Camino web browser with the latest nightly build (by dragging the new version from it's disk image, and into the Applications folder) I get a permissions issue the first time only. As usual I am warned I will need to authenticate, then I am warned I will be replacing a file, then the first time only I get told I do not have sufficient privileges on one or more items to continue. The second time I try I am allowed to progress to the authentication window where I enter my admin username and password and the operation completes.
    The same thing happens with other files I'm trying to overwrite that are located in protected folders (I just use Camino as an example because it is a daily occurrence). But it ONLY happens the first time.
    This has persisted through three erases of my brand new iMac's HD and clean installations of Leopard. I have of course run Disk Utility multiple times to repair the HD (no errors found) and repair permissions (just the usual ACL errors every Leopard user faces).

    Hi,
    What's the error message did you get? It would be better to provide a screenshot for your problem.
    Generally speaking, this problem can be caused by third party adds-on of IE. You can try to start IE with no adds-on mode for test.
    Open run, type iexplore -extoff, pess
    Enter.
    If it works properly, please chck which plugin enabled in your browser, try to disable them for test.
    In addition, this can also be caused by IE settings, try to reset IE for test.
    Roger Lu
    TechNet Community Support

  • Error 1055 occurred at Property Node, only the FIRST TIME I run the VI

    hi !
    I'm managing some object properties with 2 subVIs,
    so I send to the first one a number and a cluster which contains the objects references, so that it controls the "visible" property depending on the number,
    and I send to the second one the previous cluster and an other cluster which contain the objects data, so that it controls the data depending on some parameters.
    VI is better than explaination, so find it attached !
    at the first time you'll run it, the error occurs, so click "stop" button, and run it again, no error, and you'll understand the way it works.
    To fond the error again, just close it completely and re-open it.
    (I built an example VI as close as possible to my real VI, and I get the same error, so I attached only the example)
    hope you'll understand (if no I can explain better)
    thanks a lot.
    Attachments:
    tests erreurs.zip ‏57 KB

    yoz'st wrote:
    smercurio_fc a écrit :
    You have to write to the control/indicator the local variable points to.
    sorry but I don't really understand this... (I'm french).
    A local variable points to a control or indicator. To "initialize" it you have to write a value to it. Or, you can set the value of the control/indicator to a default value.
    I tried to use globals, but the same error occurs...
    Of course it will. Because you're not understanding that you have a race condition. http://en.wikipedia.org/wiki/Race_condition

  • Hand off works only the first time

    iphone 6
    macbook air 2012
    hand off always works on the phone...i can see what is on the mac...
    but on the mac i cannot see what is on the phone
    log out iCloud on all my devices...log back in...
    it works on the mac...i see the iPhone app icon on the mac dock left most position....
    i click it...the iPhone app opens on the mac...great!!!
    but when i close the app on the Mac hand off is gone...
    e.g. it works the first time...
    (p.s. phone calls can be made from the mac, message is all synched...that part works...)

    fixed it...
    my behavior was very similar...it rarely intermittently worked...i somehow stumbled on the fact that it was a bluetooth issue...then i finally fixed it...now it works like a charm...here is a post i made after i fixed it...turns out it has to do with allowing "bluetooth and internet connection sharing..."  here is a post a made with my solution...hope it works for you...
    Had a similar problem...
    open an app on mac...can see it on phone...
    open an app on phone...cannot see it on mac...or see it once then its gone...
    my problem (not sure if it is yours)...
    Mac-->System Preference: Sharing
    1. Turn on Bluetooth sharing; 2. Turn on Internet sharing bluetooth PAN...
    worked for me...
    (have not seen anyone or apple post this...they should)

  • Af:commandMenuItem action only works first time

    I am using the af:panelPage, and have added a menu1 facet that contains an af:menuTabs component with 3 af:commandMenuItems. I'd like the selection of each tab to invoke a bean 'action', where I'll set some flags that control the rendering of different subviews.
    I really like JDeveloper and ADF Faces... but I must be misunderstanding something basic. It all seems easy, and when I run and select one of the tabs, the correct 'action' is called and all works great. But when I then select a different tab, the 'action' is not called. Nothing happens after this.
    I'm still learning both web-aps and JSF stuff, so hopefully I'm just doing something dumb.
    The .jspx stuff looks like:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:c="http://java.sun.com/jsp/jstl/core"
     xmlns:af="http://xmlns.oracle.com/adf/faces/EA16"
     xmlns:afh="http://xmlns.oracle.com/adf/faces/EA16/html">
    <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
     doctype-system="http://www.w3.org/TR/html4/loose.dtd"
     doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <afh:html>
    <afh:head title="try1">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
    </afh:head>
    <afh:body>
    <af:form>
      <af:panelPage binding="#{backing_rmMain.panelPage1}">
        <f:facet name="menu1">
          <af:menuTabs binding="#{backing_rmMain.mainTabsBar}">
            <af:commandMenuItem text="Overview"
              binding="#{backing_rmMain.overviewTab}"
              action="#{backing_rmMain.overviewTabAction}"/>
            <af:commandMenuItem text="Configuration Setup"
              binding="#{backing_rmMain.configTab}"
              action="#{backing_rmMain.configTabAction}"/>
            <af:commandMenuItem text="Results View"
              binding="#{backing_rmMain.resultsTab}"
              action="#{backing_rmMain.resultsTabAction}"/>
          </af:menuTabs>
        </f:facet>
        <f:subview id="overviewPage" rendered="#{backing_rmMain.showOverview}">
          <jsp:include page="/WEB-INF/pages/Overview.jspx"/>
        </f:subview>
        <f:subview id="configPage" rendered="#{backing_rmMain.showConfig}">
          <jsp:include page="/WEB-INF/pages/Config.jspx"/>
        </f:subview>
        etc...
      </af:panelPage>
    </af:form>
    </afh:body>
    </afh:html>
    </f:view>
    </jsp:root>
    The backing bean action handlers simply set some booleans and return (I've tried returning both null and a simple string value... I'm not using navigation rules for this). If I set breakpoints, the action handlers get called, but only for the first selection.
    Thanks for any suggestions or help.
    Don

    After a couple of days of "try this, try that" I've concluded that the problem was caused by the <jsp:include>. As I'm learning, one must be careful when mixing JSF and ADF components, as well as how components are nested within containers.
    I was hoping there would be a way to visually develop a page fragment in one file, and then include it in another file. But I could not find a way to do this.
    What I'm doing for now is:
    1. Create a jspx file for my sub-page (so I can develop it graphically).
    2. Create a jspf fragement file, and include that in my main page using <jsp.directive.include>.
    3. copy/paste from the jspx file to the jspf file to test (but only copy the portion between the <af:form> block.
    Seems to work. I'm open to better suggestions.
    Don

  • PRs workflow triggered only the first time

    Hi all,
    do you know a way to trigger a workflow for Purchase Reqs only when the first agent (requisitioner) releases it and not at every step? I'm managing all the release strategy inside a custom workflow and the cancel release as well.
    I'm using BUS2105.eventstepcreated as start event but it is triggered in each step (as the name suggests ) and also for a cancel release.
    Thanks in advance.
    Angelo

    Hi Angelo.
    Sorry if I have different perspective.
    You can enhance the standard workflow for PR (single release and collective release). This workflow triggers for each PR created.
    And instead of you manage release strategy inside your workflow, you can maintain release strategy (release group and release code) inside the MM configuration by assign to specific object type. This approach will capture agent assignment from the configuration and calculate the release strategy (include the classification) as well

  • Power Mac G5 Freezes only the First Time starting up

    PowerMac G5 on StartUp freezes every FIRST time. Sometimes it chimes, most times it doesn't. Used the Hardware Test disk and it says RAM is OKAY. I have 4 1 gb chips that I have been using for 2 years without problems. I reset PMU, I zapped PRAM, NRAM, removed Airport card, used compressed air to clean the insides, reseated all RAM chips, repaired permissions - and nothing changes. I removed all peripherals and nothing changes. It always starts the 2nd time, so I can still use it. I need to know what is causing a First Startup freeze at the Grey screen, but again, 2nd start is good. I am a Recording Engineer with a ProTools HD rig, so I can't afford to take the computer out to repair, as I am in the middle of a Project. Just want to know if anyone has seen this issue before and dealt with it?

    Very grateful for all of the replies! Disk Utility showed no errors, I replaced the battery last week, with a correct replacement. No problems with Clock/Date. RAM has been reseated. Airport Card removed, etc. I will put in some new RAM as soon as it arrives to see if that solves the issue - and I glad that someone echoed that software testing doesn't always show the whole picture. I cannot boot in Safe Mode. Does this help get closer to the root problem? It's confusing that it always works on the second boot and never the first boot. Even later in the day, it has the exact same issues. It gets to the grey screen spinning gear and freezes - every first boot, all the time. 2nd boot is flawless. That's what I don't understand. What problem goes away on the 2nd boot? Sounds like a Power issue of some sort, but I've never run into it. Also - Chime almost never occurs on startup - so I can't do the PRAM zap while waiting for 3 chimes, because I don't get any. Does this help describe the problem?

Maybe you are looking for

  • TV not recognizing MDP to VGA adapter

    Hi, I'm new to Macs and just bought my first about a week ago.  I tried to hook up my TV to my computer using the MDP to VGA adapter.  When I plug in the adapter the screen goes blue for a second just like it does when I hook it up with HDMI, but it

  • Screen Light of n82

    Does anybody know that when phone(n82) is switched on the light is pretty bright but after some time it becomes very low! As well when any incoming call or alarm rings the light is increased and when it is stopped then again it comes to normal. Do an

  • Opening a WebLogic WebService file in Workshop

    Hello, Some of the members in our team are having this weird issue of opening a weblogic webservice in the workshop! Whenever we open the webservice, the design and source view take forever to load and everytime we change a comment or code, the save

  • There is some font labels that do not  appear in adobe  acrobat and appear in the reader " appear as

    there is some font labels that do not  appear in adobe  acrobat and appear in the reader " appear as  boxes" and I need to work with the acrobat  can any body help

  • PHP Authentication Class

    Hello, I just wanted to inform every that I have a php class 95% completed which basicilly mimics that of the perl script to authenticate. I'll be willing to share the script if anyone is interested. Aaron Axelsen UW-Whitewater