navigationClick() called when you click outside a field.

I have the following code below for the Blackberry Storm.  Its purpose is to make a menu screen with originally 4 BitmapFields that can be clicked.  All buttons work properly and regester and respond to the navigationClick() event.  However, if I click outside any field - the navigationClick() event is called on any field has the focus - even if the click is outside this area.

Any help is appreciated

SerializableAttribute public class MainMenu extends form {}

Private MenuScreenLayoutManager menuScreen;
protected MenuItem activate, soundOff, resume;
protected UiApplication addix;
    
public MainMenu (UiApplication addix) {}
Super(MainScreen.FOCUSABLE |) MainScreen.NO_VERTICAL_SCROLL);
This.addix = addix;
LabelField title = new LabelField ("Addix", LabelField.HCENTER |) LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
setTitle (title);
        
        
getMainManager () .setBackground (BackgroundFactory.createBitmapBackground (Bitmap.getBitmapResource ("menu_background.png")));

Set of MenuItem = new MenuItem (MenuItem.PLAY, Bitmap.getBitmapResource ("play_button.png"), Field.FOCUSABLE, this);
Stats MenuItem = new MenuItem (MenuItem.STATS, Bitmap.getBitmapResource ("stats_button.png"), Field.FOCUSABLE, this);
Help of MenuItem = new MenuItem (MenuItem.HELP, Bitmap.getBitmapResource ("help_button.png"), Field.FOCUSABLE, this);
resume = new MenuItem (MenuItem.RESUME, Bitmap.getBitmapResource ("resume_button.png"), Field.FOCUSABLE, this);
Activate = new MenuItem (MenuItem.SOUND_ON, Bitmap.getBitmapResource ("sound_on_button.png"), Field.FOCUSABLE, this);
soundOff = new MenuItem (MenuItem.SOUND_OFF, Bitmap.getBitmapResource ("sound_off_button.png"), Field.FOCUSABLE, this);
        
menuScreen = new MenuScreenLayoutManager();
menuScreen.add (game);
menuScreen.add (statistics);
menuScreen.add (help);
menuScreen.add (enable);
        
Add (menuScreen);
}
    
private void addResume() {}
menuScreen.add (curriculum vitae);
}
    
private void removeResume() {}
menuScreen.delete (curriculum vitae);
}
}

class MenuItem extends BitmapField {}
    
public static final int PLAY = 0;
public static final int SUMMARY = 1;
public static final int STATS = 2;
public static final int HELP = 3;
public static final int SOUND_ON = 4;
public static final int SOUND_OFF = 5;
protected int type;
private MainMenu mainMenu;

public MenuItem (int, Bitmap bm, long style, MainMenu mainMenu type) {}
Super (bm, style);
This.type = type;
this.mainMenu = mainMenu;
}
    
protected boolean navigationClick (int status, int time) {}
System.out.println ("Type" + type);
Field field;
switch (type) {}
case 0:
System.out.println ("Play");
synchronized (UiApplication.getEventLock ()) {}
mainMenu.addix.pushScreen (new GameScreen (mainMenu.addix, mainMenu));
}
break;
case 1:
System.out.println ("Summary");
break;
case 2:
System.out.println ("Stats");
break;
case 3:
System.out.println ("help");
break;
case 4:
System.out.println ("' sound - we '");
() this.getManager replace (this, mainMenu.soundOff);
break;
case 5:
System.out.println ("sound off");
() this.getManager replace (this, mainMenu.soundOn);
                
break;
            
}
Returns true;
}

protected void (_g, Boolean _on Graphics) drawFocus {/ * nothing * /}
}

class MenuScreenLayoutManager extends VerticalFieldManager {}
    
MenuItem field private;
private static val mutable int menuItemsStartPos = 260;
private static val mutable int menuItemHeight = 41;
private static val mutable int menuItemWidth = 142;
Private final int screenWidth = getWidth();
    
public MenuScreenLayoutManager() {}
Super(Manager.RIGHTMOST |) Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR);
}
        
protected void sublayout (int width, int height) {}
    
int numberOfFields = getFieldCount();
int menuXloc = 360-menuItemWidth;
for (int i = 0; i)< numberoffields="" ;="" i++="">
field = (i) getField (MenuItem);
Switch (field.type) {}
                    
case 0:
setPositionChild (scope, menuXloc, menuItemsStartPos + (menuItemHeight + 3));
layoutChild (field, width, height);
break;
                        
case 1:
setPositionChild (scope, menuXloc, menuItemsStartPos);
layoutChild (field, width, height);
break;
                        
case 2:
setPositionChild (scope, menuXloc, menuItemsStartPos + 2 * (menuItemHeight + 3));
layoutChild (field, width, height);
break;
                        
case 3:
setPositionChild (scope, menuXloc, menuItemsStartPos + 3 * (menuItemHeight + 3));
layoutChild (field, width, height);
break;
                        
case 4:
case 5:
setPositionChild (on the ground, 70, menuItemsStartPos + 3 * (menuItemHeight + 3));
layoutChild (field, width, height);
    
}
                    
}
setExtent (360, 460);
}
}

It is one of the many design flaws (IMO) of the key on the blackberry event. What you get is by design.

If you click anywhere on the screen where there is no field under the point of click, the click event will be dispatched on the ground right now with the update. You should override the touchEvent and write a 'isWithinBounds' method that checks just as the x and are coordinated are less than the width and the height of the field.

The key event is within the limits of the field on which it is called, you handle if you ignore it.

Tags: BlackBerry Developers

Similar Questions

  • Stop the movement of the cursor when you click on the field

    Hey there,

    I am trying to find a way to stop the trackball to move the focus around a bunch of fields I have in a custom handler that I created. I want that the development movement will not apply when the user clicks on a field, with emphasis.

    The reason why I want to do is to move this autour field and NOT the focus.

    Is it possible to implement this switching between the two?

    Thank you for your help.

    NavigationMovement to implement in these areas. Set a Boolean inside this field switch when you click on it, and then, in navigationMovement, check that then call your special treatment and return true or return super.navigationMovement.

  • I received a pdf file and the words in the text of the form filled in and saved tabs/forms appears only in the only filed when you click on this field.

    Hi, the text in tabs/forms of the form filled in and saved text doesn't appear when you click on this tab and field offices. When I go to another tab / filed, it disappears. I need to see everything at once.

    Auto-fill text fields is inactivated.  I have acrobat Pro XI / Win764bit. I can't find anything useful in the German speaking forums (there you will find only: save it on your desktop, open the with another program - not adobe, save it as a .jpg, use the preview and save/print pdf, open with photo shop and so forth but nothing works.)

    It would be good to get a link to an old solution or a useful answer.

    Kind regards

    Is there a chance that the application overview on Mac has been used to complete and save the form? What you describe is a typical sign that it was like overview corrupts PDF forms in a number of ways. You can fix this in Acrobat if you have access to a blank form uncorrupted by exporting the form with FDF data and important in the blank form.

  • Save the forms editable on MAC - once saved problems cannot see the text when you click in the fields

    Using Acrobat 9 Pro, I created an editable PDF form that can be saved/printed using the reader.

    My clients can fill out the forms without problem, but when they save them and send back them to be transformed, the information they typed are no longer visible. You can view the information typed If you physically click in each field individually, but it does not automatically appear as I want to.

    It doesn't seem to be a problem with the clients using a Mac. Does make a difference if he clicks on SAVE or SAVE as?

    Does anyone have an idea what I can do to fix this?

    Evil. He wrote:

    You can check the information typed If you physically click in each field individually, but it does not appear automatically

    This is very typical of the problem created when files are completed and saved in the preview.

  • Context menu prevent from appearing when you click on?

    I get the context? menu (the one with the full Menu and options Show/Hide keyboard) when I press (touch screen) or click on a field in a listechamps.  I don't know why.

    I extended ListField as follows:

    public class TableField extends ListField {
        TableFieldCallback callback;
        public void setTableCallback(TableFieldCallback callback) {
            this.callback = callback;
        }
        protected boolean trackwheelClick(int status,int time) {
            App.DEBUG("CLICK START " + time);
            if (null != callback) callback.onclick(this.getSelectedIndex());
            App.DEBUG("CLICK CONSUMED");
            return true;
        }
    }
    

    The domain manager that contains this field implements TableFieldCallback and sets the callback object.

    The scope of the list does not contain child field, rather than the 'data' are set for each field.

    I press list (click on) a field (line) in the field and trackwheeClick() is called calls my onclick() method in my object and is processed (it loads another opinion), but the context menu is displayed, even if I returned true from trackwheelClick() of signs that I have consumed the event.

    This behavior is unacceptable, I need a way to be able to disable the context menu when you click on the field ofc.

    Note: the full menu appears sometimes, but I guess that's because I also accidentally click / tap the full menu option in the context menu that... maybe its because the context menu Gets the event of publication in the press / click don't know.

    Hey to return true on nothandled touch clear also

    and for the contact not returning true not managed navigationClick should do the job.

  • Text for the username variable input area moves to the next screen when you click

    I assigned a username variable to a text entry area. If I mouse click inside the text box to enter a name, I am taken to the next screen. In other words, the entry text box seems to act like a button. Is there something I need to change in the Properties window to prevent this?

    Hi Eddie,.

    You have 2 possible actions: a by clicking on the button (success), a when you click outside the button (the rest of the slide) which is a failure. And you can attach an action at a time. The default action for both is 'Continue', which means that the head of reading which has been suspended by the button, will continue. You don't want that to happen if the user clicks on the button, but outside the key (like by clicking in the field ETB). This is the reason why recommended Manish allows you to change the action for failure to 'No action', which means that nothing will happen if the user clicks outside the button. He can then click in the text field and type its entry.

    Lilybiri

  • sites Web unwanted/requested is automatic when you click and the input field

    When I click on a field to enter a code, name, etc., or select a link specific other independent link is presented in a new tab. This happens all the time, but at least 90% of the time.

    is firefox browser by default on your system and what are these links (ads...)?

    When you try to make another browser default and unwanted links and then begin to open up to the other browser and then some kind of malware is active on your system, but it does not affect firefox in particular.

    Please run scan also of your system with various other tools such as the free version of malwarebytes, microsoft safety scanner & kaspersky security scan.

  • CP9: Text entry box: Lost Focus displayed when you click Submit

    Hello

    I seem to have problems with my text entry areas (TEBs).

    Sometimes, these problems do not appear all the time.

    Later a being that when I click on the button the Focus Lost text caption is displayed.

    I came across the question when you work on a project, so I decided to 3 slides project to test.

    1 BER on the screen.

    • Success goes to the next slide.
    • Failure displays caption built-in failure.
    • Focus Lost shows a text caption.

    Slides mask lost Focus of text caption at the entrance.

    No advanced actions.

    Timeline shows just TEB and lost legend for Focus text.

    CP9 TEB Focus Lost.jpg

    CP9, project that is unresponsive (a new project - only 3 slides), project preview & Preview in the browser. have not yet published.

    I deleted the slide and added a new slide.

    I deleted the cache and reset the preferences.

    Concerning

    Donal.

    The way you described the configuration and screenshots, it seems to be behaving exactly as it should.

    I was expecting to see THE text caption every time that you click the submit button.

    Should the lost Focus event fires when the cursor was placed in field ETB and then you move outside this field and click on anything, which of course would include by clicking on the button submit of the BER itself.

    So far I don't see any bug or issue here.  Can you describe what you think that SHOULD be the case?

  • DW CS6 - Spry Collapsible Panels - how to close panel when you click away from him?

    I know in general onmouseout is used to close the other items, but I couldn't understand it with the Panel collapsible spry. I have the Panel opening and closing onclick onclick, but I would really like it closes when you click anywhere else on the page outside the Panel.

    Thank you!

    Your example is neither SAG nor tab panels.  It is a called a Mega Menu which is very different.

    http://www.jqueryrain.com/demo/jQuery-mega-menu/

    Nancy O.

  • not ask web pages uddenly that appears when you click on a link to

    I'm on a Web page that I want and I click on a relevant link for more information about this page. The link opens correctly but so is another page that I did not and has no connection or interest to what I do. Then I have to cancel the unwanted page and one remains open. It's very annoying and can you please tell me how to stop it. It only started happening recently.
    Thanks - I hope

    I understand when you click a Web link within a site, two Web pages open instead of one. This looks like some kind of Adware and I would recommend looking for malware or reset Firefox (please understand that this will restore Firefox to its default values, and all customizations will be removed in a folder called 'Old Firefox Data' on the desktop)

    Troubleshooting Firefox problems caused by malicious software and the Preferences of Firefox reset to troubleshoot and solve problems

  • files do not open when you click on

    Today, I tried to open two .txt files by clicking on it. It's the same thing when I tried to open a .jpg photo.

    I tried to click the icon and I tried holding it down, double clicking, etc. I forgot what to do to open a file or something has changed on my Xoom. I would really appreciate ome entry to tell me what the problem is.

    What is the bug 3.2 on the selector app shows off the screen?

    When you click on a file to open it, and there is no default program to open it with, a list of possible programs are provided to allow you to choose which program to use.

    I have 3.2 there is a bug. The list is posted outside the Visual area of the screen. The rest of the screen is blurry and slightly grey.

    The solution is to activate the auto-rotation and change beween landscape/portrait. The list of possible programs then appears and you can select how to open the file.

  • an error "file does not have a program associated with it for performing this action" when you click office and recent places.

    Original title:

    Win7 victory explrer click dsktop & mployment plces & get eror msg file is not a CDSA wth to prfrmin ths field prgrm. pls instl one prgrm so is alrdy instld Credit Union assc ltvds cntrl pnl prgrms

    I don't know how to fix. Help, please.    Win7 windows Explorer click

    Office & recent locations & grterror msg:
    This file does not have a program associated with it for performing this action. Please install a program or, if it is already installed. create an asssociationin the default programs control panel.
     
    Information given in the new thread:
    Error Msg When you try open office spaces & recent since the win Explorer

    when im in windows Explorer and click on the desktop or the recent places the link I get a msg of error and they will not open, but all others open. I posted pictures of error msg to skydrive yesterday.

    Hello

    Welcome to the Microsoft Community Forums.

    I see you've found an error "file does not have a program associated with it for performing this action" when you click office and recent places.

    1. Have you made changes on the computer before this problem?
    2. What is the full error message?

    I suggest you to report to us the screenshot of the Advanced window so that we can understand what exactly the situation.

    See:
    Use SkyDrive download collected files and post screen shot/image
    http://social.technet.Microsoft.com/forums/en-us/w7itproui/thread/4fc10639-02dB-4665-993a-08d865088d65

    The average while you can try the following steps and check if the error reappears.

    Method 1:

    Step 1:

    Start the computer in safe mode and check the number.

    Some options, including the mode safe mode, start Windows in a limited State, where only the essential is started. If a problem doesn't reappear when you start in safe mode, you can eliminate the default settings and basic device drivers and services as a possible cause.

    Follow this link provided below to start your computer in safe mode.

    http://Windows.Microsoft.com/en-us/Windows7/advanced-startup-options-including-safe-mode

    Step 2:

    Put the computer to boot and check if the problem persists.

    To help resolve the error and other messages, you can start Windows 7 by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/kb/929135

    Note: After troubleshooting, be sure to set the computer to start as usual as mentioned in step 3 of the KB article provided above.

    Method 2: I also suggest that you scan your computer with the Microsoft Security Scanner, which would help us to get rid of viruses, spyware and other malicious software.

    The Microsoft Security Scanner is a downloadable security tool for free which allows analysis at the application and helps remove viruses, spyware and other malware. It works with your current antivirus software.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Note: The Microsoft Safety Scanner ends 10 days after being downloaded. To restart a scan with the latest definitions of anti-malware, download and run the Microsoft Safety Scanner again.

    Important: During the scan of the hard drive if bad sectors are found, the scanner tries to repair this sector, all available on which data may be lost.

    It will be useful.

    Back with the details so that we can help you further. We also indicate the result of the suggested steps.

  • Quiz question buttons don't 'deselect' when you click off of (see photo)

    Quiz question buttons don't 'deselect' when you click off of my multiple choice quiz (always view as in a selected state, even when I click on a choice). I have feedback works, but the button (I used the buttons-sample group of three) and copied an additional. I use InDesign version 11 on a Windows 7 machine and export to PDF. All other features buttons / interactive seem to work great.

    2016-06-09_10-47-49.png

    To be clear, you have box behavior (more than one may be selected), when you want to the behavior of the Button Radio (alone in the game can be selected at one time by selecting another unselects the first).

    To get the option button behavior, in Acrobat, rename fields and give them all the exact same name:

    Then differentiate them using the Options > Radio button choice property:

    Here's how the game will look in domain:

  • How to enlarge the parts of a circle of get - have text pops up when you click on it?

    I'm working on an interactive infographic in edge animate CC. I use pieces of a circle and when you click on / hovered, I want the pieces to grow and also have the text pop up on the side. I am struggling with how to animate my circle pieces so that they move and are clickable. Can someone offers directions?

    I made a sample for you, but not using EC.  This used boxes, images and a text field which is change according to the box that is clicked. I hope this helps.

    PNG and info.zip - Box

  • Result has changed when you click on the PDF attachments

    Result has changed when you click on the PDF attachments.

    It's recent, possibly after updates, I use Adobe Reader 10.0.10, Firefox 35.0.1 on a computer that is running Windows 7

    I no longer get the open/save dialog box when I click a pdf attachment, how do I get that back please?

    I have other problems, but they may be related to the above, so I would like to sort first if possible.

    ,

    In Firefox, go to Tools - Options - Applications and enter "pdf" in the filter field. Then select the action you want from the list.

Maybe you are looking for