Setting focus to a field, after a dialogue in front of her closed

I feel that I have seen this solution somewhere in this forum, but can't find it.

I have a screen that opens a popup screen.

The popup screen contains an editfield and a button.

The popup screen displays a dialog box if an error condition occurs.

Once the dialog box is closed, the popup screen is still one that is displayed.

It is, I need editfield to emphasis on the popup screen once the dialog box is closed.

I tried to implement the focusChangeListener on the pop-up screen, but it doesn't seem to work. The pop-up screen receives a manager who went to the super. Definition of the fieldChangeListener on this Manager has some problems.

Is there a better approach?

Still, I feel a little ridiculous for coming upward with a solution to this problem after posting the it. It is the solution, in case someone else runs into the same issue.

First of all, when you create the pop-up screen, a Manager is passed. In the popup screen, I keep a reference to the Manager:

public MyCustomDialog( Manager manager, String text, boolean isPassword )
{
    super( manager );
    this.manager = manager;
    ...
}

I declared a variable of module so that I could make the transfer of the Manager to the module.

Secondly, I overloaded the method onExposed() of the class of the screen in the pop-up screen:

protected void onExposed()
{
      manager.getField( 1 ).setFocus();
}

This set the focus to the edit field.

One thing I found interesting, is that I was unable to get the Manager of super. In the constructor, I put the Manager with a great (Director);

When I tried to get the reference to the Manager of super in the onExposed() method:

super.getManager ();

the reference is not null, no Manager. Odd.

Tags: BlackBerry Developers

Similar Questions

  • How to set focus on PaneManager Field after it is created.

    I'm trying to set the focus to the first title of the pane Manager view... for the first title in the tab...

    Content is dispaying the first tab on the opening screen.

    I tried these ways.

    LabelField historyTitleField = new LabelField ("History", Field.FOCUSABLE |) Field.FIELD_HCENTER);
    Component = new part (historyTitleField, value);

    After setting PaneManagerView added this line to set the default focus: historyTitleField.setFocu ();

    It did not work...

    I have tried both the options below:

    paneManagerView.getField (0) .setFocus ();   Did not work

    paneView.setFieldWithFocus (historyTitleField);  Not work...

    Anyone has an idea... How to set the first title of the focus of the Manager pane tab?

    try to wrap it in an invokelater

  • Setting the focus on a field without scrolling to it

    Hi all

    Basically, I implement scroll smoothly for is a VerticalFieldManager by subclassing, generating a thread and call setVerticalScroll accordingly... The result is a very nice scrolling.

    However, I also want to control the focus of the fields. However, Field.setFocus () scrolls automatically to this field... that is not what I want.

    How can I set focus to a field without the user interface infrastructure automatically scrolling to it?

    tjerkw wrote:

    I can't replace getVerticalScroll Manager: this is a final method...

    Well I've almost implemented smooth scrolling... but he jumped up and down sometimes because of the blackberry user interface infrastructure...

    Oh yes! I was wondering why I had to create a new getVerticalPosition() - that's why!

    Jumping from high to low is inevitable since these invokeLater arrive at unpredictable times.  Be sure to keep the overall pace and it will be good enough.

    Another word of warning: If you make your scroll of in a TimerTask, don't forget to cancel it when your manager scrolls smoothly becomes obscured and set one new another appointment when necessary.  If you leave it running (for example, runs at 20 Hz or so, looking for the last event not transformed), if will drain the battery like crazy...

  • Adjustment of focus and the deletion of a field after the length control

    I have a form I'm working on that requires a few basic length checks but I have a problem with one of my fields. In the case of change, I have this:

    If (xfa, event.newText.match (/ [^ 0-9 /])! == null) {}

    this.rawValue = null;

    xfa.host.setFocus (this);

    }

    ElseIf (xfa.event.newText.length > 9) {}

    this.rawValue = null;

    xfa.host.setFocus (this);

    }

    but it will not draw the field or set the focus to the field when he fails to verify. I'm not sure what the problem is.

    Thank you!

    I use dynamic PDF... the code I gave you behaves exactly how you want it to be...

    the problem with your code when I test it, is because when you use the corresponding method, it does not return true or false, it returns only the first character of the string... you should try using the RegExp object rather...

    In addition, when you try to use (this.rawValue = null) in the case of change, it cannot apply this line of code because the rawValue of the field doesn't have a change not yet, no, unless you have left the field. You should always use the xfa.event when you try to play with the value in the case of change of a textfield...

    So try instead... I hope it will work

    var reg = new RegExp(/[^0-9]/);

    If (reg.test (xfa.event.newText)) {}

    XFA. Event.change = "";

    xfa.host.setFocus (this);

    }

    Do not use else if

    If (xfa.event.newText.length > 9) {}

    XFA. Event.change = "";

    xfa.host.setFocus (this);

    }

  • Keep the Focus on the button after mouse click

    Hello

    I have a button in my VI that triggers a function. I would like to know how can I keep the focus on the button after clicking with the mouse over it? I ask that because I want that after the first click, the focus is kept on the button then I can activate the button with the space bar.

    I know I can hit the button with "tab" and then use SPACEBAR, or I can put another key to toggle this button.   But the behavior that I'm trying to get is: 'after the first click on the button for the first time, emphasis is stored on it and then I can use the space bar to activate the button.

    Ideas?

    Thank you.

    Dan07.

    I found the solution. Using a property node, set to True KeyFocus.

    Thank you.

    Dan07.

  • Home field after the validation error

    Using Application Express 4.2.5.00.08

    I created a validation for each required to shoot the submit button field. If a field is NULL, the error message 'field is required' online is displayed.

    If an error occurred, is there a way to put the cursor in the field associated with the error? Currently, it returns the first field at the top of the page.

    Thank you very much

    Validation_Error.png

    Hi HRSysAdmin,

    Your answer is already given by fac586 in the very next post the question. Although there are a few minor changes to the solution.

    fac586 wrote:

    HRSysAdmin wrote:

    Using Application Express 4.2.5.00.08

    I created a validation for each required to shoot the submit button field. If a field is NULL, the error message 'field is required' online is displayed.

    If an error occurred, is there a way to put the cursor in the field associated with the error? Currently, it returns the first field at the top of the page.

    Do the a Page Load Set Focus dynamic action with Selection of Type jQuery Selector and jQuery Selector defined value on :input.apex-page-item-error:first .

    Here are the changes made to the fac586 solution:

    • Go to the Page attributes-> display attributes-> Set Cursor Focus not cursor focus

    Why is it necessary? As it is set by default to the first point of page bothers our dynamic action set out below and, making it useless.

    • Here is the dynamic action proposed by fac586

    Here, the change is jQuery Selector is passed to input.apex - page-point-error: first to .apex-page-point-error: first as the prior takes the elements of entry into consideration, what happens if the first element on which the error occurred is a textarea or select list. For more information, see jQuery selectors.

    jQuery is a powerful javascript library when it comes to complex interactions between the user interface. You should save some time to learn the basics.

    Not to mention that the solution of Reema is not relevant because it proposes to transfer validation logic in javascript.

    I hope this helps!

    Kind regards

    Kiran

  • How to edit PDF form fields after registration

    I am very new for PDF forms and thought I was getting better.  I'm create forms of Word documents and need to make frequent changes to the PDF form after that I have recorded because I'm still learning.  I thought I read somewhere that you should be able to change the properties of a field after saving a copy, but that did not work.  I forgot to uncheck "Ahmed multi field" and the need to set in my text boxes but I can't change.  I continue to recreate the formula over and over again on the Word doc.

    Hi Ally1286,

    Save a copy, it is required to change the form when you have distributed the form or registered as a Reader extended PDF. In this case, if you want to add scrolling functionality to a tool to "Prepare the form" field then go in (in DC) to the title of the Toolbox on the right.

    On this screen, select the file and click Start. Double-click on the field and go to the 'Options' tab check the appropriate box.

    Let me know if it works for you.

  • RN v1 duo set for Time Machine and after a clean install of Yosemite I can't access my data

    Hi guys,.

    I have the ReadyNas duo v1 set for Time Machine and after a clean install of Yosemite I can't access my data.

    When I try via the Finder, files look for empty to me while info shows that they are not.

    I have no more support and I tried everything I could but all my data remains inaccessible.

    I have finally reached my backup via Time Machine, it was temporary unavailable yesterday.

    Thank you guys!

  • How to upgrade the height of a field after painting?

    Hello world!

    Here's my question: I implement my own domain with the following components:

    A text which may be multi-line

    A second text which may be multi-line

    An image with a fixed height (80px)

    When the getPreferredHeight() substitution, I don't know the future height of my area (which depends on the multiline settings). So I would update the height of my field after the painting process, while it takes only the necessary height.

    How is it possible to do?

    Thank you in advance.

    OK, I did so using a prepareLayout() method in the constructor as computs the width and height of the next field.

  • EditField aligned right... fields after do not appear

    I've been looking for a while and are still unable to find a solution to this. I read that the EditField uses the ENTIRE WIDTH, but in my scenario, I see not all fields after a custom EditField.

    The EditFields work/display well, but any field after appearing at all

    What I am doing wrong?

    Here is the class that contains my EditFields

    class FieldsManager extends VerticalFieldManager {}
    private int _width;
    private int _height;

    FieldsManager (int width, int height) {}

    Super(Manager.NO_VERTICAL_SCROLL |) Manager.NO_VERTICAL_SCROLLBAR);
    Super (0);
    _width = width;
    _height = height;
       
    Font ft_fields = Font.getDefault () .derive (Font.PLAIN, 16);
    _cityField = new EditField ("", _trip.getLOCATION () .trim () + "," + _trip.getCOUNTRY (), 25, Field.FIELD_RIGHT) {}
    Protected Sub layout (int maxWidth, maxHeight int) {}
    int myWidth = getMaxSize() * getFont () .getAdvance ("W");
    myWidth = Math.min (maxWidth, myWidth);
    Super.Layout (myWidth, maxHeight);
    }

    };
    _cityField.setFont (ft_fields);
    _reasonField = new EditField ("", _trip.getCUSTOMER () .trim (), 25, Field.FIELD_RIGHT) {}
    Protected Sub layout (int maxWidth, maxHeight int) {}
    int myWidth = getMaxSize() * getFont () .getAdvance ("W");
    myWidth = Math.min (maxWidth, myWidth);
    Super.Layout (myWidth, maxHeight);
    }
    };
    _reasonField.setFont (ft_fields);
       
    Add (_cityField);
    Add (_reasonField);

    }

    protected void sublayout (int width, int height) {}
    Field _editField;
    get the total number of areas falling under this Manager of
    int numberOfFields = getFieldCount();
    int y = 0;
    for (int i = 0; i)< numberoffields;="" i++)="">
    _editField = getField (i); get the field
    Are police = _editField.getFont ();
    EditField ef = _editField (EditField);
    int textWidth = Math.max (font.getAdvance (ef.getText ()), police
    .getAdvance('0'))
    + font.getAdvance(' ');
    layoutChild (_editField, textWidth, height);
    setPositionChild (_editField, width - textWidth, y);
    y += _editField.getHeight ();
    }
       
    setExtent (width, height);
    }

    public int getPreferredHeight() {}
    return _height;
    }

    public int getPreferredWidth() {}
    return _width;
    }

    }

    It is added to the main screen. All the fields added in the future do not appear... help?

    Check the values in your sublayout method using the debugger

  • How to set focus on submitButton and messageTextInput?

    Hello!

    How can I set the focus on submitButton and messageTextInput?

    Thank you.

    http://gyanoracleapps.blogspot.No/2011/03/set-focus-on-bean-dynamically.html

    BR, 906099

  • How can I lock the fields after that you filled out a pdf file

    How can I lock the fields after that you filled out a pdf file

    Hello

    Please refer to this topic THAT PDF locking after filled will be a great help.

    Kind regards

    Nicos

  • How can I automatically populate the date field after only one "digitally signs" a .pdf form? Help, please! Thank you!

    How can I automatically populate the date field after only one "digitally signs" a .pdf form? Here's a sample:

    _ Digital Signature___ (signs), Date (Auto-remplit)

    Under field properties of the signature on the signature tab, you can use a custom script, like this:

    this.getField("Date").value = util.printd ("mm/dd/yyyy", new Date());

    You know, however, that a digital signature always displays the date and time, it has been applied?

  • I bought the first elements 13 and 13 Photoshop elements according to a trail. I received 1 set of serial numbers to activate Photoshop and 2 sets for first. However, after you type in the first series of numbers for the first, there was no place to type

    I bought the first elements 13 and 13 Photoshop elements according to a trail. I received 1 set of serial numbers to activate Photoshop and 2 sets for first. However, after you type in the first series of numbers for the first, there is no place to type in the second set. How can I check if the first has been correctly activated?

    You get usually just a serial number by program... a list of 24 numbers, 6 sets of 4.

    Click the icon of the program and see if it boots without asking for a serial number.

    If it is not running now, please contact support:

    To contact support, please click the link below, click on the still need help? option in the blue box below, then choose the cat. Make sure you are signed in with your Adobe ID, have cookies enabled and have deleted your cookie cache.  If you have any questions, try another browser.

    Serial number and activation support

    Guinot

  • Need to fill the value of the sequence in a field after insertion in the ofa page

    Hi all

    I have a custom OAF insert the page in do I have to fill out a sequence to a field value, once the data inserted with success at the table.

    so for this I followed the approach below.

    1 > created a database sequence.

    2 > java in the EOImpl of the file in the accessor method Set for their respective fields wrote code below.

    {} public void setContainid (numeric value)

    If (value == null) {}

    OADBTransaction t = getOADBTransaction();

    value = t.getSequenceValue ("XXXXX_CONTAIN_SEQ");

    }

    setAttributeInternal (CONTAINID, value);

    }

    But still, I'm not able to complete the sequence value for the field in my oaf page, please help me with that.

    Thank you

    Hello

    Write this logic to create the EOImpl method:

    public void create (AttributeList attributeList)

    {

    Super.Create (AttributeList);

    Transaction OADBTransaction = getOADBTransaction();

    ContID number = transaction.getSequenceValue ("XXXXX_CONTAIN_SEQ");

    setContainId (contID);

    }

    Sushant-

Maybe you are looking for

  • Equium P300-16 t - system error writing Configuration data

    Salvation message for the first time I have a Toshiba Equium P300-16 t and it has developed an error starting on the screen, it says System error writing Configuration dataF1 - F2 CV - Bios settings When it appears that I can't get the option of reco

  • Laptop HP Env S15 - webcam does not work

    error message: "Cyberlink YouCam cannot connect to your webcam (HP Truevision HD)... » Drivers and software seem to be up to date. 8.1 Windows operating CyberLink YouCam 3.5.6117 (DE) - supplied with the laptop Driver HP Truevision HD 6.3.9600.16384

  • HP Pavilion Ultrabook 14-b011tx windows update

    Hello, I recently bought Hp Pavilion Ultrabook 14-b011tx. And it came with windows 7. The shopkeeper told me that once I have download and install all updates, the windows will be up upgraded to windows 8. In the meantime, I have a problem that some

  • P7 - 1420t: plug on motherboard

    I added a USB to my HP p7 - 1420t.  The card requires a power connection 4 pins on the motherboard.  Where is the plug located on the motherboard?  Could I also use one of the connectors for power cable providing the hard drive and optical drive?

  • HP LaserJet 1606dn: printer LaserJet HP 1606dn stopped printing today

    I printed one document this morning very well. I tried to print a different, and nothing happened, even if when I open the print window, he stated that the task had been completed --100%. I tried to manually reinstall the latest printer driver softwa