Field edict preventing Manager dirty

Heya,

I've been surfing around trying to understand it, but I was very little success. I have four EditFields, and if they have all the input and then characters trying to get out of the screen that a dialog box opens saying changes have been made, I want to save, delete, or cancel. I don't want this dialog box to appear. With ButtonField I can specify it to not to get dirty, but that little style is not available for the EditField :/ How can I prevent this open dialog box?

Thank you!

~ James

Override onSavePrompt and/or onSave

Tags: BlackBerry Developers

Similar Questions

  • How can I get the position of a field in a Manager?

    Hi all

    I just want to know that how I can the position of a field in a Manager (Vertical or flow)?

    If I get the x, position y, I can do a pop-up screen depends on this position...

    Can someone help me solve this problem?

    Thank you very much.

    Welcome to the forums.

    I use getFocusRect to fetch the XYRect of the target field. You can get the details from there.

  • Adding fields to a Manager different button clicks

    if (field == buttonField && label.equals("First")) {
                LabelField label = new LabelField("1");
            add(label);
            buttonField.setLabel("Last");}
    else if (field == buttonField && label.equals("Last")) {
            buttonField.setLabel("First");
            labelField2 = new LabelField("2");
            add(labelField2);
            labelField3 = new LabelField("3");
            add(labelField2);
    }
    

    Here is an example of my FieldChangeListener. It is clear what he does (even for me clear ). It simply adds fields - a field to the first button clicks - and two others to the second click.

    What I want to do is to add these fields to a manager - regardless of the vertical or horizontal, I just need to get the concept of how it should be done. The idea is to build a manager at the first click on a button and add labelField. When the second click occurs, I need this Manager to add an other field (s), for example as in my example code.

    Could you please indicate the way to do this? It might be very obvious of sth, yet lack me.

    EDIT: spelling errors, sorry...

    Edit2: Can it be reached via setter/getter?

    Setter / getter did the trick.

    if (field == buttonField && label.equals("First")) {
                getHFM();
                    LabelField label = new LabelField("1");
            setHFM().add(label);
            buttonField.setLabel("Last");
    }
    else if (field == buttonField && label.equals("Last")) {
            buttonField.setLabel("First");
            labelField2 = new LabelField("2");
            setHFM().add(labelField2);
            labelField3 = new LabelField("3");
            setHFM().add(labelField2);
    }
    
    public HorizontalFieldManager getHFM(){
            hfm = new HorizontalFieldManager(USE_ALL_WIDTH);
            add(hfm);
            return hfm;
    }
    public HorizontalFieldManager setHFM() {
            return hfm;
    }
    
  • Customizing fields to a manager of a screen.

    This is my first post here, so Hi everyone.

    I have the following problem:

    I create a "Manager" to the screen. So, I want to add the field to this Manager, and after that I want to add fields to this handler in sublayout method and try to setPositionChild and LayoutChild. The problem apparently is that I can't call the following functions on the newly created Manager, because they are protected.

    GRR Im may be confusing.

    Since I went through a period of similar confusion about a year ago, I think I know what you're asking.

    So here:

    1. some of these protected methods aren't for you to call - they are called by the BlackBerry infrastructure.  You override methods such as sublayout(), setPreferredWidth() etc to change the behavior of your Manager.

    2 setPositionChild() and layoutChild(), on the other hand, are protected and not private in the abstract class Manager exactly because RIM wanted to give you access to them when extending the class of their Manager.  You call to your sublayout() method to position the fields as desired.

    3. you don't add fields inside your method of sublayout() - you add before add your manager to another Manager (or a screen). When the screen containing your Manager finally gets push in the battery of the screen, the system calls your method sublayout() to determine how your manager wants to look in the provided rectangle.  In addition to laying the fields, you will need to call setExtent() and setVirtualExtent() it.  In order to browse your fields managed one by one, use getFieldCount() and then getField() in a loop.

    Good luck - you will need it!

    Arkady.

    P.S.: I suggest that you answer here again if you have more general questions.  For something more specific, try searching the forums first, and then open your own new discussion if you can't find what you need.

  • touch events for several fields in the Manager of several

    In my application... I have a vertical field (VFM) Manager in the screen.

    In this optimization of resources, I inserted 3 manaagers:

    (1) District Manager hfmHeader horizontal (in which I added 1 label (NON_FOCUSABLE) and 1-2 Btns according to the conidtion (tuochEvent FOCUSABLE and overrried all in initlilsing it).)

    (2) District Manager vertical ListField container or TextField or LabelField vfmManager in accordance with the condition.

    ((3) District Manager horizontal hfmButtons containing 6 btns... all tuochEvent FOCUSABLE and overrried initlilsing while the).

    public int getFieldAtLocation (int x, int y)
    {
    XYRect rect = new XYRect();
    int index = getFieldCount()-1;
    While (index > = 0)
    {
    getField (index) .getExtent (rect);
    If (rect.contains (x, y))
    break;
    -the index;
    }
    return to index.
    }

    Second, the click event try something like:

    protected boolean touchEvent(TouchEvent event)
    {
       switch( event.getEvent()  )
       {
            case TouchEvent.CLICK:
              int index = getFieldAtLocation(event.getX(1),
                                             event.getY(1));
              // Ignore click events outside any fields
              if (index == -1)return true;
              Field field = getField(index);
              if(field.equals(bitmapField))
              {
                System.out.println("Bitmap Clicked");
              }
            return true;
       }
       return super.touchEvent(event);
    }
    

    Even when I am using above solution, can't scroll. and click event of the hfmButtons buttons aren't the gt performed.

    Second... If I don't stand... I am able to scroll and executed at least the first 3 buttons click event.

    How can I implement for each button click event in any Manager? Is this possible...

    Can someone please help in this regard. Any suggestion or if possible code snippet will be appreciable.

    Thank you

    Use the snippet for each manager of...

    case TouchEvent.CLICK:
    India = getFieldAtLocation (event.getX (1),)
    event.getY (1));
    If (India! = - 1) {}
    Field fm = getField (India);
    {if (FM. Equals (vfmMain))}
    int index1 = vfmMain.getFieldAtLocation (event.getX (1),)
    event.getY (1));

    If (index1 >-1) {}

    Field = vfmMain.getField (index1);

    check field is instance of the field you want

    {if (Field.Equals (footerManager))}
    Container.isFooterManager = true;
    int index2 = footerManager.getFieldAtLocation (event.getX (1), event.getY (1));

    Search fields in the Manager of this...

    } ElseIf... {

    go on the same cehcking

    } ElseIf {}

    ... like this, go to the control...

    }

    }

  • Adding fields to a Manager slows down application

    Is there a reason why adding fields to a Manager directly slows my application?

    In the constructor of my screen, I loop and add 200 LabelFields.  This causes the user interface is very slow.

    However, if I loop and add fields to a temporary VerticalFieldManager and then add only the Manager screen, works fast.

    The disadvantage of this approach is that the user will not be able to see the added both fields.

    I am surprised that I did not notice this earlier.

    Here's the slow code:

    import net.rim.device.api.system.Application;import net.rim.device.api.ui.Manager;import net.rim.device.api.ui.component.ButtonField;import net.rim.device.api.ui.component.LabelField;import net.rim.device.api.ui.container.MainScreen;import net.rim.device.api.ui.container.VerticalFieldManager;
    
    public class TestScreen extends MainScreen {
    
      private static final int NUM_ROWS = 200;
    
        VerticalFieldManager outerRowManager;
    
       public TestScreen() {     super();
    
            ButtonField runBackgroundButton = new ButtonField("Background") {         protected boolean navigationClick(int status, int time) {             new BackgroundThread();               return true;          }     };
    
          outerRowManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR);
    
           add(runBackgroundButton);     add(outerRowManager); }
    
       public class BackgroundThread {
    
         public BackgroundThread() {           (new WorkerThread()).start();     }
    
           private class WorkerThread extends Thread {
    
             public void run() {
    
                 for (int i = 0; i < NUM_ROWS; i++) {
    
                     synchronized (Application.getEventLock()) {                       outerRowManager.add(new LabelField("ROW " + i, LabelField.FOCUSABLE));                    }             }         }
    
           } }}
    

    And here is the quick code:

    import net.rim.device.api.system.Application;
    import net.rim.device.api.ui.Manager;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    
    public class TestScreen extends MainScreen {
    
        private static final int NUM_ROWS = 200;
    
        VerticalFieldManager outerRowManager;
    
        public TestScreen() {
            super();
    
            ButtonField runBackgroundButton = new ButtonField("Background") {
                protected boolean navigationClick(int status, int time) {
                    new BackgroundThread();
                    return true;
                }
            };
    
            add(runBackgroundButton);
        }
    
        public class BackgroundThread {
    
            public BackgroundThread() {
                (new WorkerThread()).start();
            }
    
            private class WorkerThread extends Thread {
    
                public void run() {
    
                    outerRowManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR);
    
                    for (int i = 0; i < NUM_ROWS; i++) {
                        outerRowManager.add(new LabelField("ROW " + i, LabelField.FOCUSABLE));
                    }
    
                    synchronized (Application.getEventLock()) {
                        add(outerRowManager);
                    }
    
                }
    
            }
        }
    }
    

    The answer is actually quite simple. Every time that you add a field to a Manager, updateLayout() is called. In the first example, you already added "outerRowManager" to the screen and it was posted until you start adding LabelFields. In the second example you add fields to the Manager until the Manager has been added to the screen and displayed. Its always faster to add bottom up (onscreen Manager fields)... In addition, you are synchronizing with the interface thread user 200 times compared to 1 time.

  • How to justyfing several fields in a Manager?

    What happens if I have three fields of label in a horzontal Manager and I want to do something like this:

    [Field1 Field2 Field3]

    Where field1 is left justified and fields2 and 3 are justified to the right.  Any ideas?

    Create your own custom handler and position fields as you wish in the subLayout() method, with the help of setChildPOsition().

    There is an example of a Manager in the developer's guide.

  • move the focus from the field to the Manager

    Help!

    I have a HorizontalFieldManager with some fields inside. When I touch on the hfm, I want that he win the tune-up. Everything is fine with the BlackBerry without a touchscreen. I can scroll all hfms.

    But when I touch on the subject of the focus in the hfm gain the focus and not the hfm. How can I change?

    When I want to get the Manager on the ground and give it focus that nothing changes. Call this.setFocus () in the manager didn't make when press the subject field of the focus. When I touch outside the scope of field, everything is fine!

    I have no idea!

    Can someone help me please?

    Concerning

    When the fields are non-Focus, you can still have a NullField focusable.

    a non-trivial alternative might be to manually indicate the development of the manager through the methods onFocus() and onUnFocus() of the field that is getting the focus

  • How to place fields on a manager horizontal?

    Hello

    I want to place two fields on the same horizontal Manager on both ends. IE I want to place a label on the left-hand side field and a ButtonField on the corner of the side right of the same manager Hhorizontal. I tried the following code, but did not work.

    For example:

    VFM VerticalFieldManager = new VerticalFieldManager();
    HFM HorizontalFieldManager = new HorizontalFieldManager();
    LabelField lblField = new LabelField ("test1", LabelField.FIELD_LEFT);
    ButtonField btnField = new ButtonField ("test2", ButtonField.FIELD_RIGHT);
            
    HFM. Add (lblField);
    HFM. Add (btnField);
    VFM. Add (HFM);

    This has not produced the expected results but on the contrary the two fields are aligned on the left side.

    I'm doing something wrong in the code above? Is there any alternative for this? Waiting for a response as soon as possible...

    Thank you

    Thank you guys for the quick response. The following code does the trick

    VFM VerticalFieldManager = new VerticalFieldManager();
    HFM HorizontalFieldManager = new HorizontalFieldManager();
           
    LabelField lblField = new LabelField ("test1", LabelField.FIELD_LEFT);
    ButtonField btnField = new ButtonField ("test2", ButtonField.FIELD_RIGHT);
           
    VerticalFieldManager vfmLeft = new VerticalFieldManager();
    VerticalFieldManager vfmRight = new VerticalFieldManager (Manager.USE_ALL_WIDTH);
           
    vfmLeft.add (lblField);
    vfmRight.add (btnField);
           
    HFM. Add (vfmLeft);
    HFM. Add (vfmRight);
    VFM. Add (HFM);

  • to align the label Center field in horizontalfield Manager

    Hello world

    I have three field label inserting in horizontal field Manager, by default, it is show laft alignment.

    But I need to put all the Center horizontally.

    someone can help me.

    My code is given below

    HorizontalFieldManager curencyPrice = new HorizontalFieldManager (HorizontalFieldManager.FIELD_HCENTER |) Manager.USE_ALL_WIDTH)
    {
    public int getPreferredHeight() {}
    Return ((int) ((30 * screenHeight) / totalHeight));
    }

    public int getPreferredWidth() {}
    Return ((int) ((200 * screenWidth) / totalWidth));
    }

    protected void sublayout (int maxWidth, maxHeight int) {}
    Super.sublayout (getPreferredWidth (),
    getPreferredHeight());
    setExtent (getPreferredWidth (), getPreferredHeight());
    }
    };

    value = new CustomLabelField_Land ("" + ht.get ("currencySymbolLeft") +"", 12389754, 25, 0,)
    // 0);
    curencyPrice.add (value);

    String s = ht.get ('price') m:System.NET.SocketAddress.ToString ();

    Value1 = new CustomLabelField_Land (s, 1521508, 25, LabelField.FIELD_HCENTER, 0);

    curencyPrice.add (value1);
    value11 = new CustomLabelField_Land ("" + ht.get ("currencySymbolRight"), 12389754, 25, 0, 0);

    curencyPrice.add (value11);

    Thanks in advance

    By default, a LabelField will only the space he needs.  And a HFM will also take only the horizontal space he needs.  You can add your HFM to a VerticalFieldManager and ensure that the HFM says FIELD_HCENTER and it focuses, as a value for money defaults across the width.

  • Add a field to a manager internal vertical field (vertical field managers are nested) on a screen, will eventually call the sublayout of the screen. Can someone explain the mechanism of notification concerned?

    Hi-

    I have a screen with vertical field managers nested (that is the top of the screen on the display stack) when I add a field for the internal more vertical domain manager, I see that is called the method sublayout of the screen. I understand that we add a field to the vertical field manager and the screen currently, the State of the screen becomes so he made a layout, followed by the painting.

    But I want to know how the screen (or the user interface engine) will know that a field is added to one of its managers of content vertical field (is there a notification for this mechanism). I mean when I add a field to the Interior more vertical field Manager how will be the vertical field Manager that knows a level up to this topic, and finally how the screen also know this about and new provision itself. (The sequence of method calls etc... Will be useful)

    Again this is not breaking anything in my application and everything works as expected, but it will be useful if I can understand the underlying reasons for the above.

    This is my first Forum announcement ever, bear with my presentation (suggestions are welcome).

    Concerning

    Ravi

    each field can call getManager to check if it is added to another Manager. If a field is added to a manager that this Manager notifies its topmanager, it notifies its topmanager etc. until the highest level is reached.

  • Validation of DateTime field (without custom management functions)

    Hello

    I need to know how I can validate if a date is correct or not and fail to do something.

    I have a DateTime Field field, with a pattern ' DD / MM / YYYY ', the value appears correctly using the selected template, the problem is validation.


    Now I just that if the date is wrong, teaches an alert to the user, and the focus returns to the DateTime control until you enter a valid value.

    I need something like:

    -Form1.SUBVENCION_O_AYUDA.dateTimeField1: Validate - (JavaScript, client).

    If (this.rawValue! = null & &! test (this.rawValue, ' DD/MM/YYYY')) {}

    xfa.host.setFocus ("this");
    }

    How will I know if the validation is successful or not (without having to implement long-standing management functions)?

    By default, if I put 'validation model messaga' field, a warning message is displayed, but here the emphasis is more and the user can continue to fill the rest of the form, whereas the datetime field is filled with an incorrect value.

    I want to warn the user to continue to fill out the form, if the value in the dateTime field is not valid.

    Any idea?

    Thank you!

    Hello

    If your date may not be formatted correctly against your view model then the formattedValue is equal to the rawValue.

    Thus, in the event output put;

    If (this.rawValue is this.formattedValue)

    {

    App.Alert ("enter a date in the dd/mm/yyyy" format "");

    xfa.host.setFocus (this.somExpression);

    }

    Bruce
  • How to disable the password field in the management of Oracle users

    Hello

    How to customize the field password on the user - define the uneditable form? I tried customizing the forms on this field, but it did not work. Can we have an idea if this field can be customized at all

    Thank you in advance!

    See if it works for you. I tested and it's ok

    Raises the event - a TIME NEW POINT INSTANCE
    Trigger - USER object. USER_PASSWORD
    The two process - mode

    Action type - property
    Object Type - point
    Target - USER object. USER_PASSWORD
    Name of the property - ACTIVE (APPLICATIONS COVER)
    -False

    Save and open/close both forms. In the modes entry or query, whenever the user access the password field, it is disabled and cannot be changed.

    I hope that it works as expected. Just play :-)

  • Prevent development leave Manager then moving left/right

    I have a screen with a manager at the top, lower-left editfield and a button at the bottom right. I am trying to find a way to make sure if the user tries to move their development (with wheel) left/right, it moves back and fourth between these two fields. If the user moves to the top (in other fields), it will go directly to the Manager at the top, and if they move down it will stay on all the areas that they were on.

    I could get this to work with navigationMovement, but then the editfield would no longer work.

    Anyone have any ideas?

    After looking around the docs a bit more, I've finally came up with this solution. It is a bit hardcoded for my specific case, but should help others who have similar problems.

    protected int moveFocus(int amount, int status, int time) {
        int original = getFieldWithFocusIndex();
        int result = super.moveFocus(amount, status, time);
        boolean fieldChanged = (original != getFieldWithFocusIndex());
    
        // Move focus vertically
        if ((status & Field.STATUS_MOVE_FOCUS_VERTICALLY) == Field.STATUS_MOVE_FOCUS_VERTICALLY) {
            if (amount > 0) { // Move Down
                 // Just stay at the original field
                if (fieldChanged) getField(original).setFocus();
            } else { // Move Up
                // If the field changed leave manager
                if (fieldChanged) {
                    return -1;
                }
    
                // If the field didn't change return the result
                return result;
            }
        }
    
        // Don't leave the manager
        return 0;
    }
    
  • How to get the field at any time a vertical field Manager?

    Hi guys. In the application, that I'm working on, I came across a bit of a challenge.

    Basically I have a vertical field Manager ful of custom components.

    Basically this custom components, draws the user name, some other info and pictures of the user related to their account.

    It all works very well, but what I'm trying to do is to get the exact field on the vertical field Manager at any time. You see, while it displays the image of the user, I download from a Web server (and it will display a picture by default while it is downloading). So what I'm trying to do is go to the correct custom component of the vertical field each time Manager, so I can quickly change the image is correct, once I get the correct uploaded image. The manager of vertical field is called via the standard method.

      VerticalFieldManager vfm = new VerticalFieldManager(VERTICAL_SCROLL|VERTICAL_SCROLLBAR) {
    
    protected void sublayout(int w, int h) {
        super.sublayout(480, Math.min(240, 360)); 
    
    }
    
    };
    
    for(int i=0; i< contacts.length; i++)
    {
    //Contacts is an array of my custom component. I am just calling it
    contacts because it basically is a list of contacts.
    vfm.add(contacts[i]);
    }
    
    add(vfm);
    

    Everything works well for me except a way to get the correct field on the vertical field manager. So that I can

    Run it in a contact, and then reset the image.

    Can anyone help with this?

    Thank you

    I suggest that you give to your download manager - a reference to the contact that you update, if networking is done, you can refresh it.

    except if you develop for a device of some I would be careful with the absolute values like 480 btw

Maybe you are looking for

  • uninstalled Microsoft word

    We have deleted the wrong word from our computer and wonder if we have to buy it again. I don't think that we have a return to the top. Thank you.

  • I am trying to install a PC game. When the DVD and I click on install I get the message, setupexe has stopped working

    original title: setupexe has stopped working I am trying to install a PC game. When the DVD and I click on install I get the message, setupexe has stopped working, windows will find a response and advise. Nothing happens. What should I do to install

  • driver wifi HP pavilion g4

    HP Paviolion g4-1314tx Windows 7 x 64 My recovery disks do not work so I decided to install everything manually. The only device that I have not managed to install is my wifi driver. so I looked on the net. I tried all the drivers on the site below,

  • All of a sudden, I can't print to my wireless network.

    I have a wireless printer Artisan 810 with a desktop connected to the router.  I have two laptops connected wirelessly to the router.  I had everything installed and works very well for two or three weeks about.  Now, impressions of a laptop and desk

  • Having a problem in Windows 7 when using Skype

    Hello world My name is Steven Lash, I lived in San Diego in the United States. I have been using Windows 7 for the past 6 years, all software and applications work properly except Skype, for these 2-3 weeks, I was faced with problem on my Skype. I do