Disabled button fires an event ?!   :-O

Hi, friends!
I've never thought about the next issue: why desabled button can fire an et_Click event?
I havn't no idea to check that!
I thought before that enabled=false is the method to prevent et_Click event for that item, but...
<b>Is it a bug or feature?</b>
I'm talking now about v6.5, what can you say about that situation on v6.7?

It is not a bug, the SDK is simply informing you that the user clicked on something.  You can click on other disabled items such as edittexts and they will also generate the click events for you. 
The important difference with a disabled button is that the et_ITEM_PRESSED event won't be triggered.  The et_ITEM_PRESSED event is the correct one to use to detect the user pressing a button.
John.

Similar Messages

  • Disabled buttons still generate events

    It seems that disabled buttons still generate events in business one. If a button is disabled (even a standard one) click events can still be seen in the SBO event logger. I would have expected a disabled button to be completely disabled and no events to be generated whereas as it is I have to check in the event handler to see if the button is enabled or not.
    Is my understanding of this correct?
    Has anyone else had issues like this?
    Gordon Wood

    Hi Gordon,
    That sounds like an issue with the SBO Event Logger because no event is actually triggered in the addon when the button is disabled.
    Kind Regards,
    Owen

  • Disabled button fires events to event structure

    Hi all,
    I was trying to disable a Button on the frontpanel by using its enabled property while the event was executed. The ide wa not to create more events of this buttopn while its fucntion was executed. However thsi did not work.It was creating events even though it was greyed out.
    I troied two different versions:
    1) in the event case of the button (value changed) in a sequence I first dispalbned the button, execuded the code and then enabled it again
        Result: All events were generated even though the button was greyed out
    2)  in the event case of the button (value changed) in a sequence I disbaled the Button and then started a second event. The Second event executed the code and then enabled the Button egain
       Result: Even though the Button was greyed out events were generated
    3) in the event case of the button (value changed) in a sequence I first dispalbned the button, execuded the code and in the timeout event I thenenabled it again
       Result: No additional events were generated
    it seems that the enable state of the button is analysed at teh time when the event is execute din teh event case but not at the time when it was created?
    So I Tried the Time Input of the case expecting that it woudl give me a time stamp of the time when the key was pressed - but instead it gave me the time point when teh event was executed...
    Teh only othe rsolution was to set teh cursor to busy (however I dont want to see the changed cursor during the busy cycle)
    So how can I make shure that no additional events are fired during the time teh code of the Button s executed?
    Thanks for any help,
    Rainer

    to altenbach:
    The evet takes about one or two seconds - I checked the behaviour as shown in the attached examples with LV 8.5, LV 2010, TV2011, LV2012 - allways exactly the same behaviour.
    It does not make any difference weather you use switch when pressed or latched when pressed.
    It does not make any difference weathe ror not you tag "Lock front panel" for that event
    to sth:
    > If you disable a front panel control (ie the button) you cannot click on it and a value changed event will not be
    generated.
    This is my experience so far as well, but if you disable and enable the control within the same event it does not work (see attaced example 1) and 2). It only works if you do the enable in the timeout event.
    > The time stamp from the event case left hand property is the time of the event not the time of execution.
    > If you ask for the timer value inside the event case it will be the time of event case executing.
    In the attached exampel this is not the case. The time differecne between the Time input on the left and the Tick count
    placed in the event is 0 for all events generated whil the button is supposed to be disabled.
    As I wrote before, the explanation I have for this behaviour is that the events are generated by windows weather or not
    the button is disabled and they are queued to the event cue. Only when the event is handeled LabVIEW tests weather
    or not the button is disabled and ignores the event in case it is disabled. If the Disabling and enabling is done
    withim the same event the button pressed events are added to thw event queue and the button is set to enabled before the  next event (button pressed while it shoul be disabled) is handeled. When that event is handeled the button is enabled again (by the original event) and therefore the evenet is not ignored (because by the time of execution of the event the button is enabled again).
    If the button is enabled in the timeout event instead of the button change value event all event in teh queue are executed before teh timeout event. At their time of execution therefore the button is steill disabled. Only then the timeout event enables the button again.
    If the vi is set to busy (sand clock) this is activating actually a windows function/property and no events are queued to teh event queue by windwos. Therefore no button change event is added to teh queue.
    Funtciomn of the 3 attached Vis (LV 2010):
    Run the Vi, then press the Test button once - when it is greyed out click it a few more times. The test button value
    changed event has a 2 second delay. You will see the event counter increase, and you will see the time difference
    between the time property on the left of the event and the tick count vi whci is displayed in the waveform chart.  
    DisableButton 1: Disable and enable are ste in teh same event  
    DisableButton 2: The button is disabled then a second event is called to do the work and then enable teh button again
    DisableButton 3: The Button is disabled in button change value event and it is enabled again in teh timeout event.
    Attachments:
    DisableButton1-3.zip ‏29 KB

  • Useful Code of the Day:  Button fires events while held

    Have you ever been making a GUI application with Swing and used some JButtons? Fun, right? Have you ever wanted to have the button fire action events while the button was being held down? Well, if you just stick a plain JButton in your application and press and hold the mouse button on it, you'll see it doesn't do anything except sit there looking pressed in. Insolent button!
    RepeatButton (code below, couldn't think of a better name) is a JButton subclass which contains a timer that is set when the mouse button presses the button, and after a slight initial delay (configurable), fires action events to all registered action listeners repeatedly (with another configurable delay between events) until either the mouse is released or the mouse moves out of the button (it starts up again if the mouse moves back over without releasing the mouse button) or the button is disabled. The event modifiers are passed on as well, so you know if the shift or control buttons (or whatever) are being pressed at the same time.
    There is also a method to disable the repeated action firing while holding. This, in effect, turns the button into a normal JButton, if needed.
    There is a main method for testing which will show a button in a frame and print out the action command for each action event fired.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import javax.swing.*;
    import javax.swing.event.*;
    * <code>RepeatButton</code> is a <code>JButton</code> which contains a timer
    * for firing events while the button is held down.  There is a default
    * initial delay of 300ms before the first event is fired and a 60ms delay
    * between subsequent events.  When the user holds the button down and moves
    * the mouse out from over the button, the timer stops, but if the user moves
    * the mouse back over the button without having released the mouse button,
    * the timer starts up again at the same delay rate.  If the enabled state is
    * changed while the timer is active, it will be stopped.
    * NOTE:  The normal button behavior is that the action event is fired after
    * the button is released.  It may be important to konw then that this is
    * still the case.  So in effect, listeners will get 1 more event then what
    * the internal timer fires.  It's not a "bug", per se, just something to be
    * aware of.  There seems to be no way to suppress the final event from
    * firing anyway, except to process all ActionListeners internally.  But
    * realistically, it probably doesn't matter. 
    public class RepeatButton extends JButton
              implements ActionListener, MouseListener {
          * The pressed state for this button.
         private boolean pressed = false;
          * Flag to indicate that the button should fire events when held. 
          * If false, the button is effectively a plain old JButton, but
          * there may be times when this feature might wish to be disabled. 
         private boolean repeatEnabled = true;
          * The hold-down timer for this button.
         private Timer timer = null;
          * The pressed state for this button.
         private int delay = 60;
          * The pressed state for this button.
         private int initialDelay = 300;
          * Holder of the modifiers used when the mouse pressed the button. 
          * This is used for subsequently fired action events.  This may change
          * after mouse pressed if the user moves the mouse out, releases a key
          * and then moves the mouse back in. 
         private int modifiers = 0;
          * Creates a button with no set text or icon.
         public RepeatButton() {
              super();
              init();
          * Creates a button where properties are taken from the Action supplied.
          * @param  a  the button action
         public RepeatButton(Action a) {
              super(a);
              init();
          * Creates a button with an icon.
          * @param  icon  the button icon
         public RepeatButton(Icon icon) {
              super(icon);
              init();
          * Creates a button with text.
          * @param  text  the button text
         public RepeatButton(String text) {
              super(text);
              init();
          * Creates a button with initial text and an icon.
          * @param  text  the button text
          * @param  icon  the button icon
         public RepeatButton(String text, Icon icon) {
              super(text, icon);
              init();
          * Initializes the button.
         private void init() {
              this.addMouseListener(this);
              // initialize timers for button holding...
              this.timer = new Timer(this.delay, this);
              this.timer.setRepeats(true);
          * Gets the delay for the timer of this button. 
          * @return  the delay
         public int getDelay() {
              return this.delay;
          * Set the delay for the timer of this button. 
          * @param  d  the delay
         public void setDelay(int d) {
              this.delay = d;
          * Gets the initial delay for the timer of this button. 
          * @return  the initial delay
         public int getInitialDelay() {
              return this.initialDelay;
          * Sets the initial delay for the timer of this button. 
          * @param  d  the initial delay
         public void setInitialDelay(int d) {
              this.initialDelay = d;
          * Checks if the button should fire events when held.  If false, the
          * button is effectively a plain old JButton, but there may be times
          * when this feature might wish to be disabled. 
          * @return  if true, the button should fire events when held
         public boolean isRepeatEnabled() {
              return this.repeatEnabled;
          * Sets if the button should fire events when held.  If false, the
          * button is effectively a plain old JButton, but there may be times
          * when this feature might wish to be disabled.  If false, it will
          * also stop the timer if it's running.
          * @param  en  if true, the button should fire events when held
         public void setRepeatEnabled(boolean en) {
              if(!en) {
                   this.pressed = false;
                   if(timer.isRunning()) {
                        timer.stop();
              this.repeatEnabled = en;
          * Sets the enabled state of this button.  Overridden to stop the timer
          * if it's running.
          * @param  en  if true, enables the button
         public void setEnabled(boolean en) {
              if(en != super.isEnabled()) {
                   this.pressed = false;
                   if(timer.isRunning()) {
                        timer.stop();
              super.setEnabled(en);
          * Handle action events.
          * @param  ae  the action event
         public void actionPerformed(ActionEvent ae) {
              // process events only from this components
              if(ae.getSource() == this.timer) {
                   ActionEvent event = new ActionEvent(
                        this, ActionEvent.ACTION_PERFORMED,
                        super.getActionCommand(), this.modifiers);
                   super.fireActionPerformed(event);
              // testing code...
              else if(testing && ae.getSource() == this) {
                   System.out.println(ae.getActionCommand());
          * Handle mouse clicked events.
          * @param  me  the mouse event
         public void mouseClicked(MouseEvent me) {
              // process events only from this components
              if(me.getSource() == this) {
                   this.pressed = false;
                   if(this.timer.isRunning()) {
                        this.timer.stop();
          * Handle mouse pressed events.
          * @param  me  the mouse event
         public void mousePressed(MouseEvent me) {
              // process events only from this components
              if(me.getSource() == this && this.isEnabled() && this.isRepeatEnabled()) {
                   this.pressed = true;
                   if(!this.timer.isRunning()) {
                        this.modifiers = me.getModifiers();
                        this.timer.setInitialDelay(this.initialDelay);
                        this.timer.start();
          * Handle mouse released events.
          * @param  me  the mouse event
         public void mouseReleased(MouseEvent me) {
              // process events only from this components
              if(me.getSource() == this) {
                   this.pressed = false;
                   if(this.timer.isRunning()) {
                        this.timer.stop();
          * Handle mouse entered events.
          * @param  me  the mouse event
         public void mouseEntered(MouseEvent me) {
              // process events only from this components
              if(me.getSource() == this && this.isEnabled() && this.isRepeatEnabled()) {
                   if(this.pressed && !this.timer.isRunning()) {
                        this.modifiers = me.getModifiers();
                        this.timer.setInitialDelay(this.delay);
                        this.timer.start();
          * Handle mouse exited events.
          * @param  me  the mouse event
         public void mouseExited(MouseEvent me) {
              // process events only from this components
              if(me.getSource() == this) {
                   if(this.timer.isRunning()) {
                        this.timer.stop();
          * Testing flag.  Set in main method.
         private static boolean testing = false;
          * Main method, for testing.  Creates a frame with both styles of menu.
          * @param  args  the command-line arguments
         public static void main(String[] args) {
              testing = true;
              JFrame f = new JFrame("RepeatButton Test");
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JPanel p = new JPanel();
              RepeatButton b = new RepeatButton("hold me");
              b.setActionCommand("test");
              b.addActionListener(b);
              p.add(b);
              f.getContentPane().add(p);
              f.pack();
              f.show();
    "Useful Code of the Day" is supplied by the person who posted this message. This code is not guaranteed by any warranty whatsoever. The code is free to use and modify as you see fit. The code was tested and worked for the author. If anyone else has some useful code, feel free to post it under this heading.

    This makes word completion possible for JTextArea:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import java.util.*;
    * This class provides word completion for JTextArea.
    public class WordCompleteArea extends JTextArea {
        private boolean isTextComplete = true;
        public WordCompleteArea (Document doc, String text,
                                      int rows, int columns, KeyStroke expandKey) {
            super (doc, text, rows, columns);
            String s = "word-complete";
            Action wordComplete = new AbstractAction () {
                public void actionPerformed (ActionEvent e) {
                    wordComplete ();
            getInputMap ().put (expandKey, s);
            getActionMap ().put (s, wordComplete);
        public WordCompleteArea (Document doc, String text, int rows, int columns) {
            this (doc, text, rows, columns,
                            KeyStroke.getKeyStroke ("ctrl pressed SPACE"));
        public WordCompleteArea (Document doc) {
            this (doc, null, 0, 0);
        public WordCompleteArea (String text, int rows, int columns) {
            this (new PlainDocument (), text, rows, columns);
        public WordCompleteArea (int rows, int columns) {
            this (null, rows, columns);
        public WordCompleteArea (String text) {
            this (text, 0, 0);
        public WordCompleteArea () {
            this (0, 0);
         * Define if text already written in the JTextArea will be used
         * for expansion.
        public void setTextComplete (boolean b) {
            isTextComplete = b;
         * Find out if text already written in the JTextArea will be used
         * for expansion.
        public boolean isTextComplete () {
            return isTextComplete;
        private String tokenDelimiters = "\t\r\n ,;()[]{}%+/-*<>=&|!\"\'.@#";
         * Get delimiters that form a word.
        public String getTokenDelimiters () {
            return tokenDelimiters;
         * Set delimiters that form a word.
        public void setTokenDelimiters (String s) {
            tokenDelimiters = s;
        // Additional words used for expansion.
        private LinkedList wordCompleteList = new LinkedList ();
         * Add words that will be used as expansion.
        public void addCompleteWords (java.util.List words) {
            wordCompleteList.add (words);
         * Add a word that will be used as expansion.
        public void addCompleteWord (String word) {
            wordCompleteList.add (word);
        private String lastExpanded = null;
        private String lastExpansion = null;
        private Set dontAccept = new HashSet ();
        protected void wordComplete () {
            int caret = getCaretPosition ();
            if (caret == 0)
                return;
            String text = getText ();
            if (caret != text.length () && isCompletionLetter (text.charAt (caret)))
                return;
            StringBuffer sb = new StringBuffer ();
            int index = caret - 1;
            char ch;
            while (index >= 0 && isCompletionLetter ((ch = text.charAt (index)))) {
                sb.append (ch);
                index--;
            if (sb.length () == 0)
                return;
            sb.reverse ();
            String word = sb.toString ();
            String toExpand = word;
            if (toExpand.equals (lastExpansion)) {
                dontAccept.add (lastExpansion);
                toExpand = lastExpanded;
            } else {
                dontAccept.clear ();
            String s = findExpansion (toExpand, caret);
            if (s != null) {
                lastExpanded = toExpand;
                lastExpansion = s;
                replaceRange (s, caret - word.length (), caret);
            } else {
                dontAccept.clear ();
                lastExpanded = null;
                lastExpansion = null;
                int diff = word.length () - toExpand.length ();
                replaceRange ("", caret - diff, caret);
        private boolean isCompletionLetter (char ch) {
            return tokenDelimiters.indexOf (ch) < 0;
        protected String findExpansion (String word, int caret) {
            StringTokenizer st;
            if (isTextComplete) {
                st = new StringTokenizer (getText (), getTokenDelimiters ());
                while (st.hasMoreTokens ()) {
                    String s = st.nextToken ();
                    if (    s.startsWith (word)
                            && s.length () != word.length ()
                            && !dontAccept.contains (s)      ) {
                        return s;
            for (Iterator it = wordCompleteList.iterator (); it.hasNext (); ) {
                st = new StringTokenizer
                                ((String) it.next (), getTokenDelimiters ());
                while (st.hasMoreTokens ()) {
                    String s = st.nextToken ();
                    if (    s.startsWith (word)
                            && s.length () != word.length ()
                            && !dontAccept.contains (s)      ) {
                        return s;
            return null;
        // TEST
        public static void main (String[] args) {
            WordCompleteArea a = new WordCompleteArea ();
            JFrame window = new JFrame ();
            window.getContentPane ().add (a, BorderLayout.CENTER);
            window.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
            window.setSize (300, 300);
            window.setVisible (true);
    }

  • Button Fire Event Multiple Times

    Hey everyone.  I've somewhat inherited a LabVIEW program for a project I'm working on.  I need to fire an event in an event structure 20 times in a row to fully collect my data.  Right now i just have the event structure connected to a slider so i just slide it enough and it completes the 20 events needed.  Is there a way I can make one button fire an event 20 times?  I need the while loop for the entire program to run during these 20 times so a simple loop around the event code won't work.  Any ideas?  Thanks guys.

    I'd use another solution.
    When the button is pressed, start a dynamic VI that does the aqcuisition.
    When the VI is done, it sends a user event (or a value (signalling) event to
    some control), so the main VI knows it's done. By doing this, you seperate
    the DAQ and the MMI, which is good. Both VI's are kept simple. Put the data
    in a buffer, or pass it in the user event data.
    Timing and event structures are difficult. It's very inconvenient to exectue
    an event case every X sec. without using a dynamic VI (or parrallel loop).
    Using the time out event has it's own problems. The TO event is called when
    no other event occured for the given period. So if you'd add a mouse over
    event (as an example) the TO case isn't called at all when the mouse
    moves...
    You could also start a dynamic VI that creates a user event (or value
    (signalling) 20 times at some interval, and then quits. But it's just as
    complex as a dynamic DAQ vi, and less elegant.
    Regards,
    Wiebe.

  • Disabled button generates events

    Hello,
    I have a radio button that I want to disable while a background process is running.
    After the process finishes, I enable the button again.
    However, if the user clicks on the disabled button during the background process, an ActionEvent still gets generated.
    Then when the button is re-enabled, it responds to the event that was generated while it was disabled. I want to prevent my button from responding to events generated while it was disabled.
    I do not want to use the getGlassPane.setVisible(true) technique because I still want my cancel button to be able to generate events during the background process.
    I am using JDK 1.3.1 and my button is in a panel contained in a JFrame application.
    Suggestions?
    Thank you,
    Ted Hill

    Hello,
    I have a radio button that I want to disable while a background process is running.
    After the process finishes, I enable the button again.
    However, if the user clicks on the disabled button during the background process, an ActionEvent still gets generated.
    Then when the button is re-enabled, it responds to the event that was generated while it was disabled. I want to prevent my button from responding to events generated while it was disabled.
    I do not want to use the getGlassPane.setVisible(true) technique because I still want my cancel button to be able to generate events during the background process.
    I am using JDK 1.3.1 and my button is in a panel contained in a JFrame application.
    Suggestions?
    Thank you,
    Ted Hill

  • Mouse Events on Disabled Buttons

    Hi,
    In my application I should make a disabled button to show a tool tip when mouse is entered onto it.
    I'm using java.awt.container not Jcontainer.
    I have searched in SDN forums and after reading some of the comments what I understood is �disabled Swing button can react to Mouse events but a disabled awt button can not react to mouse events�.
    Is that true or did I not understand correctly?
    And how would I be able to implement the required functionality in my
    application?
    Thanks.

    import java.awt.*;
    import java.awt.event.*;
    public class AwtTooltip {
        private Panel getContent(Frame f) {
            Button left = new Button("left");
            left.setEnabled(false);
            Button right = new Button("right");
            Panel panel = new Panel(new GridBagLayout());
            new TipManager(panel, f);
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.weightx = 1.0;
            panel.add(left, gbc);
            panel.add(right, gbc);
            return panel;
        public static void main(String[] args) {
            AwtTooltip test = new AwtTooltip();
            Frame f = new Frame();
            f.addWindowListener(closer);
            f.add(test.getContent(f));
            f.setSize(300,100);
            f.setLocation(200,200);
            f.setVisible(true);
        private static WindowListener closer = new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                System.exit(0);
    class TipManager extends MouseMotionAdapter {
        Panel component;
        Window tooltip;
        Label label;
        public TipManager(Panel panel, Frame frame) {
            component = panel;
            panel.addMouseMotionListener(this);
            initTooltip(frame);
         * Since enabled Buttons consume MouseEvents we will
         * receive events sent only from disabled Buttons.
        public void mouseMoved(MouseEvent e) {
            Point p = e.getPoint();
            boolean hovering = false;
            Component[] c = component.getComponents();
            for(int j = 0; j < c.length; j++) {
                Rectangle r = c[j].getBounds();
                if(r.contains(p)) {
                    hovering = true;
                    if(!tooltip.isShowing())
                        showTooltip(c[j], p);
                    break;
            if(!hovering && tooltip.isShowing()) {
                tooltip.setVisible(false);
        private void showTooltip(Component c, Point p) {
            String text = ((Button)c).getLabel();
            label.setText(text);
            tooltip.pack();
            convertPointToScreen(p, component);
            tooltip.setLocation(p.x+10, p.y-15);
            tooltip.setVisible(true);
        /** Copied from SwingUtilities source code. */
        public void convertPointToScreen(Point p, Component c) {
            Rectangle b;
            int x,y;
            do {
                if(c instanceof Window) {
                    try {
                        Point pp = c.getLocationOnScreen();
                        x = pp.x;
                        y = pp.y;
                    } catch (IllegalComponentStateException icse) {
                        x = c.getX();
                        y = c.getY();
                } else {
                    x = c.getX();
                    y = c.getY();
                p.x += x;
                p.y += y;
                if(c instanceof Window)
                    break;
                c = c.getParent();
            } while(c != null);
        private void initTooltip(Frame owner) {
            label = new Label();
            label.setBackground(new Color(184,207,229));
            tooltip = new Window(owner);
            tooltip.add(label);
    }

  • JDev 10.1.3 ADF: How to fire an event when clicking a Radio Button

    I have a <af:table> component with the following code for my radio button
    <af:tableSelectOne text="Select and"
    binding="#{backing_viewFees.tableSelectOne1}"
    id="tableSelectOne1"
    attributeChangeListener="#{backing_viewFees.tableSelectOne1_attributeChangeListener}"
    autoSubmit="false">
    When I click the radio button it does not fire up my event in my backing bean?

    Thank you for the suggestion...it does work and fires the event, but it is still not selecting the current record when I try to perform an Update or Delete.
    I had to modify your code a bit in order for it work in JDev 10...used the JUCtrlValueBindingRef instead of the FacesCtrlHierNodeBinding.
    Here is what my af:table tag looks like:
    <af:table value="#{bindings.FeesView1.collectionModel}"
    var="row" rows="#{bindings.Fees001View1.rangeSize}"
    first="#{bindings.FeesView1.rangeStart}"
    emptyText="#{bindings.FeesView1.viewable ? \'No rows yet.\' : \'Access Denied.\'}"
    selectionListener="#{backing_viewFees.tableSelectOne1_attributeChangeListener}"
    binding="#{backing_viewFees.table1}" id="table1">
    If I put back my 2 original attributes, then my Delete and Updates work.
    selectionState="#{bindings.FeesView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.FeesView1.collectionModel.makeCurrent}"
    Here is my code in the backing bean:
    public void tableSelectOne1_attributeChangeListener(SelectionEvent selectionEvent) {
    JUCtrlValueBindingRef binding = (JUCtrlValueBindingRef)this.getTable1().getSelectedRowData();
    if (binding != null) {
    Row currentRow = binding.getRow();
    if (currentRow != null) {
    System.out.println(currentRow.getAttribute("CurrentRecordInd")); // this does print my selected value!!!!
    }

  • Is it possible to fire an event when radio buttons are clicked in a report?

    Hi All,
    I have got a requirement. In the selection screen i have certain input fields and three radio buttons. When radio buttons are clicked i have to grey out certain input fields. Is it possible to fire an event when i write program through se38??
    Thanks
    Rakesh

    Hi Rakesh,
    Check this code.
    SELECTION-SCREEN BEGIN OF BLOCK FINPUT WITH FRAME TITLE TEXT-001.
    PARAMETERS  : FILENAME(132) TYPE C LOWER CASE  NO-DISPLAY,
                  FDLOAD RADIOBUTTON GROUP RAD1
                  USER-COMMAND R1 ,
                  FUPLOAD RADIOBUTTON GROUP RAD1 .
    SELECTION-SCREEN END OF BLOCK FINPUT.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-002.
    PARAMETERS : FUNAME(132) TYPE C LOWER CASE MODIF ID AA.
    SELECTION-SCREEN PUSHBUTTON /33(30) ACTION USER-COMMAND
                     BTNACT MODIF ID AA VISIBLE LENGTH 8 .
    SELECTION-SCREEN PUSHBUTTON 43(30) CANCEL USER-COMMAND
                     BTNCAN MODIF ID AA VISIBLE LENGTH 8  .
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    PARAMETERS : FDNAME(132) TYPE C LOWER CASE MODIF ID BB.
    SELECTION-SCREEN PUSHBUTTON /33(30) ACTIONS USER-COMMAND
                     BTNACT1 MODIF ID BB VISIBLE LENGTH 8.
    SELECTION-SCREEN PUSHBUTTON 43(30) CANCELS USER-COMMAND
                     BTNCAN1 MODIF ID BB VISIBLE LENGTH 8.
    SELECTION-SCREEN END OF BLOCK B2.
    DATA : ACTNAME(8) TYPE C,SCRGRUP(2) TYPE C.
    INITIALIZATION.
    ACTIONS = 'Download'.
    CANCEL = 'Cancel'.
    ACTION = 'Upload'.
    CANCELS = 'Cancel'.
    ACTNAME = 'Download'.
    SCRGRUP = 'AA'.
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1.
    IF FUPLOAD = 'X'.
         MOVE 'Upload' TO ACTION.
         MOVE 'Upload' TO ACTNAME.
    ELSEIF FDLOAD = 'X'.
         MOVE 'Download' TO ACTION.
         MOVE 'Download' TO ACTNAME.
    ENDIF.
    AT SELECTION-SCREEN.
    IF SY-UCOMM = 'R1'.
        IF ACTION = 'Download'.
          SCRGRUP = 'AA'.
         MESSAGE S007(ZMESSAGE).
        ELSEIF ACTION = 'Upload'.
          SCRGRUP = 'BB'.
         MESSAGE S008(ZMESSAGE).
       ENDIF.
    ELSEIF SY-UCOMM = 'BTNCAN' OR SY-UCOMM = 'BTNCAN1'.
      LEAVE PROGRAM.
    ENDIF.
    *AT USER-COMMAND.
    CASE SY-UCOMM.
       WHEN 'ACTIONS'.
         LOOP AT SCREEN.
           IF SCREEN-NAME = 'FUNAME'.
           ENDIF.
         ENDLOOP.
    ENDCASE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR FUNAME.
      PERFORM call_filedialog CHANGING FUNAME.
    PERFORM call_filedialog CHANGING FUNAME.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 = SCRGRUP AND ACTNAME = 'Download' .
      SCREEN-ACTIVE = 0.
      MODIFY SCREEN.
    ENDIF.
    IF SCREEN-GROUP1 = SCRGRUP AND ACTNAME = 'Upload'.
      SCREEN-ACTIVE = 0.
      MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    FORM call_filedialog CHANGING fname.
      DATA: li_filetable TYPE STANDARD TABLE OF file_table,
        lv_return TYPE i,
        lw_filetable TYPE file_table.
      CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
        TABLES
          file_table = li_filetable
        EXCEPTIONS
          cntl_error = 1
          OTHERS     = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      READ TABLE li_filetable INDEX 1 INTO lw_filetable.
      fname = lw_filetable-filename.
    ENDFORM.                    "call_filedialog
    Reward Points, if useful.
    Regards,
    Manoj Kumar

  • Disabled button getting focus

    My problem is that a disabled button are getting focus, which is bad when the application are operated without a mouse.
    I made this litlte demo to illustrate the problem.
    Try pressing button no.1. This will disable button no.1 and button no.2,
    but why are button no.2 getting focus afterwards?
    * NewJFrame.java
    * Created on 29. september 2005, 16:55
    import javax.swing.*;
    * @author  Peter
    public class NewJFrame extends javax.swing.JFrame {
        /** Creates new form NewJFrame */
        public NewJFrame() {
            initComponents();
            printButtonStatus();
        private void printButtonStatus () {
            printFocus (jButton1);
            printFocus (jButton2);
            printFocus (jButton3);
            printFocus (jButton4);
         * Just debug inf.
        private void printFocus (JButton button) {
            System.out.println ("Button=<" + button.getText () + ">, Enabled=<" + button.isEnabled() + ">, Focus=<" + button.isFocusable() + ">");
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            jPanel1 = new javax.swing.JPanel();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            jButton3 = new javax.swing.JButton();
            jPanel2 = new javax.swing.JPanel();
            jButton4 = new javax.swing.JButton();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jButton1.setText("jButton1");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            jPanel1.add(jButton1);
            jButton2.setText("jButton2");
            jPanel1.add(jButton2);
            jButton3.setText("jButton3");
            jPanel1.add(jButton3);
            getContentPane().add(jPanel1, java.awt.BorderLayout.NORTH);
            jButton4.setText("jButton1");
            jPanel2.add(jButton4);
            getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);
            pack();
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
            // TODO add your handling code here:       
            jButton1.setEnabled(false);
            jButton2.setEnabled(false);
            jButton3.setEnabled(false);
            printButtonStatus();
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new NewJFrame().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JButton jButton4;
        private javax.swing.JPanel jPanel1;
        private javax.swing.JPanel jPanel2;
        // End of variables declaration
    }

    Very courius.
    I have made a little change in your code.
    1) scenario
    Simply changing .setEnabled(false) invokation, the class works fine.
    so
    jButton2.setEnabled(false);
    jButton3.setEnabled(false);
    jButton1.setEnabled(false);
    2) scenario
    the class works fine also using your .setEnabled(false) order invokations and putting after those:
    FocusManager.getCurrentManager().focusNextComponent();
    I do not know exactly why, I suppose that is there something not properly
    syncronized in events dispaching.
    In my opinion:
    a) setEnabled(false) at last calls for setEnabled(false) of JComponent
    that fires a propertyChange event
    so:
    scenario 1)
    buttons 2 and 3 are disabled before of button1 that has the focus in
    that moment (given by a the mouse click on itself)
    When botton1.setEnabled(false) is performed buttons 2 and 3 are
    just disabled, so focus is got by button4 (that is enabled)
    scenario 2)
    button1 that has the focus (given it by the mouse click) becames
    disabled before that button2 becames disabled too.
    So, probably, when the event of PropertyChanged is fired and processed, button2.setEnabled(false) invokation has not been
    just performed and swings looks for it as a focusable component
    So, using FocusManager.getCurrentManager().focusNextComponent(),
    we force the transer focus on next focusable component.
    This is only a my suppose, looking what happens.
    Regards.
    import javax.swing.*;
    * @author Peter
    public class NewJFrame extends javax.swing.JFrame {
    /** Creates new form NewJFrame */
    public NewJFrame() {
    initComponents();
    private void printButtonStatus () {
    printFocus (jButton1);
    printFocus (jButton2);
    printFocus (jButton3);
    printFocus (jButton4);
    System.out.println("--------------------------------");
    * Just debug inf.
    private void printFocus (JButton button) {
    System.out.println ("Button=<" + button.getText () + ">, Enabled=<" + button.isEnabled() + ">, Focus=<" + button.hasFocus() + ">, Focusable=<" + button.isFocusable() + ">");
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    private void initComponents() {
    jPanel1 = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    jButton4 = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jButton1.setText("jButton1");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    jPanel1.add(jButton1);
    jButton2.setText("jButton2");
    jPanel1.add(jButton2);
    jButton3.setText("jButton3");
    jPanel1.add(jButton3);
    getContentPane().add(jPanel1, java.awt.BorderLayout.NORTH);
    jButton4.setText("jButton1");
    jPanel2.add(jButton4);
    getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);
    pack();
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
    // I have simply change the order
    jButton2.setEnabled(false);
    jButton3.setEnabled(false);
    jButton1.setEnabled(false);
    // with this sentence the class work with original .setEnabled order
    //FocusManager.getCurrentManager().focusNextComponent();
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    printButtonStatus();
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new NewJFrame().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    // End of variables declaration
    }

  • How to enable or disable buttons on an interactive ALV report

    I have two buttons on Interactive ALV report. Before displaying the ALV report, I want to enable or disable buttons on ALV depending on some conditions.I dont want to make the buttons visible or invisible. This is not an OO ALV report.
    Please suggest !!!

    Then you have to use the event set_pf_status or parameter I_CALLBACK_PF_STATUS_SET for this pass the form name.
    You have to Implement the form Routine.
    FORM PF_STATUS using status type SLIS_T_EXTAB.
    SET PF-STATUS 'STS' excluding status.
    ENDFORM.
    First create the pf-staus using SE41 or double click on the status name and create . By default you make them Disable mode.

  • How can I fire an event case on the value change of an indicator, or a network variable?

    Hi!  I have an event structure setup to look for a value change of an indicator on the front panel.  The indicator is updated by the value of a boolean network-published shared variable through a seperate parallel loop that is polling all of the network-published shared variables.  The event, however, does not fire when the indicator changes value.  I have switched the indicator to a control and tested it with user interaction and that works just fine.
    I want to use the event structure space for my code exectution because it seems logical that that is where it would go, and it will help keep my block diagram tity.  The code is also something I would like executed with the front pannel temperarily disabled.  I would rather not have the code in my network-variable polling loop because again the tity issue.   I would also rather not use a notification VI wired to an independent loop for this particular code.
    Is there a way to have an event structure fire an event with the value change of an indicator, or a network variable directly?
    Thanks for your input.
    LV 8.5
    -Nic

    Thanks for the reply.
    I went about things a little differently, but got them to work so..... .  It really was not my desire to have a boolean indicator on the front panel.  As previously stated, my ultimate goal was to have an event fire on the change of a network variable, which I had to poll for anyway but that is tucked away in a section where I am handling all my network variables.  I ended up using that Create User Event, Register User Event, and Generate User Event SubVIs to handle the task.
    I've read the help for all of those SubVI's and it is not entirely clear to me if the event fires every time the "Generate User Event" receives some inputs, or if it only fires when the value changes.  I could do a test to find out.  It wouldn't be too difficult to add a shift register or a feedback node and place the Generate User Event in a case structure so that it is only fired when the input changes state.

  • How to fire an event dynamically in JSF Page

    Hi All
    How to fire an event dynamically in JSF Page?
    Thanks
    Sudhakar

    Hi,
    Thanks for the response. I mean to say, if I create the components dynamically then how can I fire events for those components.
    In otherwords,
    If I create the Button dynamically with particular ID being set to that component, then how can I call button action event when the button is clicked??
    Hope you understand
    What is the role of MethodBinding mechanism here??
    Thanks
    Sudhakar Chavali

  • I need to edit a re-occurring event in calender on my iPhone and there is no edit button for that event. How do I edit or delete it?

    I need to edit a re-occurring event in calender on my iPhone and there is no edit button for that event. How do I edit or delete it?

    I am not sure how this works but it seems that it may be all or nothing.
    To turn off Facebook events on your device:
    Settings > Facebook > Calendars > Off
    If you do not want to disable everything, maybe this thread will help:
    https://discussions.apple.com/thread/4349443

  • Disabled Button Gets Focus in 1.4 and not in 1.3

    Hi
    I am in the process of migrating from version 1.3 to 1.4.2
    I have a screen on which I I have a button which is disabled when teh screen initializes. There are other items to which I can navigate through TAB.
    If i keep pressing Tab so that the focus comes to the disabled object, then it just stays there...nothing happens in version 1.4 although version 1.3 works for a similar scene and teh control goes to teh next component on the screen
    I have tried setting the focus by checking the status of teh button and have set it to the same value as being enabled or disabled.
    Any help please!
    Thanks
    priya

    hi
    I have tried this...but this doesnot seem to help...
    i have also set
    setRequestFocusEnabled(false)
    to disable mosue and keyboard events..but thsi doensot seem to help either...
    thanks
    priya

Maybe you are looking for

  • Should I still use iPhoto? I want to store my photos on a NAS

    I'm trying to come up with a new photo workflow now that I have a Synology NAS on my home network. In the past, I've just let iPhoto do its thing, but now I'm not so sure I should even use iPhoto, given how my needs have changed. Some background: I h

  • File Sharing - External Drive - Unable to add user

    Hello, I am trying to share a folder within an external firewire drive. However, when in the "File Sharing" section, I am unable to add users after adding the folder to the "Shared Folders:". The add user dialog appears, but when a user is selected a

  • ITunes Not Opening-Error

    Hello,I just bought the new 5g 30g iPod Video, installed the new itunes/quicktime stuff and right after I finished downloading itunes id get an error saying somthing like "Sorry for this inconvience but itunes must shut down" It appears theres nothin

  • "java.lang.NoSuchMethodError" while try to access categories of taxonomy

    Hi , I have created Index( <b>INDEX1</b> ) using Index Admin iViews under taxonomy folder. under the index created( <b>INDEX1</b> ), I created a category manually ( <b>Cat1</b> ) . my structure is like this <b>/taxonomies/INDEX1/Cat1</b> when I try t

  • Implementing Basecommand interface

    hi all, i have created a GUI using swing which i want to evoke as a button in ARC map ,but for that i have to implement basecommand interface and use my code there , but iam not getting it how to do that so can any one give me a code snippet or a des