How to USE the information the user entered via BasicEditField or AutoTextEditField

What BlackBerry watch document - step by step - how to extract the data that the user has typed on the screen using BasicEditField or AutoTextEditField. and use it in a Java program? If BB doesn't have a good document, here are all the samples you have found useful?

I'm sorry, I didn't know that you had already gone through everything that is available.  And Yes, I was aware that the tutorials do not directly provide your requirement. I find that frequently samples and/or the provided code do not directly correspond to my needs and I therefore extend, it goes with the territory of being a programmer and is actually the part that I love - copy the code isn't fun and does not help his understanding.  Maybe you don't find so much fun.  Instead, please enjoy the following example.

import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.component.BasicEditField;
import net.rim.device.api.ui.container.MainScreen;

public final class AddDemo extends UiApplication {

    public static void main(String[] args) {
            AddDemo theApp = new AddDemo();
            theApp.enterEventDispatcher();
    }

    public AddDemo() {   

        MainScreen mainScreen = new AddScreen();
        pushScreen(mainScreen);
    }
}

class AddScreen extends MainScreen
                implements FieldChangeListener {

    BasicEditField _firstField = new BasicEditField("First Operand: ", "0", 10, BasicEditField.FILTER_INTEGER);
    BasicEditField _secField = new BasicEditField("Second Operand: ", "0", 10, BasicEditField.FILTER_INTEGER);
    BasicEditField _resultField = new BasicEditField("Result: ", "0", 11, BasicEditField.NON_FOCUSABLE);

    public AddScreen() {
        super();
        this.add(_firstField);
        _firstField.setChangeListener(this);
        this.add(_secField);
        _secField.setChangeListener(this);
        this.add(_resultField);
    }

    public void fieldChanged(Field field, int context) {
        String firstFieldData = _firstField.getText();
        int firstValue = 0;
        if ( firstFieldData != null && firstFieldData.length() > 0 ) {
            firstValue = Integer.parseInt(firstFieldData);
        }
        String secFieldData = _secField.getText();
        int secondValue = 0;
        if ( secFieldData != null && secFieldData.length() > 0 ) {
            secondValue = Integer.parseInt(secFieldData);
        }
        _resultField.setText(Integer.toString(firstValue + secondValue));
    }

}

Tags: BlackBerry Developers

Similar Questions

  • I want to detect and use the video entering via the HDMI port on the computer. I was told the HDMI port was not set, but I can't seem to find the signal or the video.

    I want to detect and use the video entering via the HDMI port on the computer. I was told the HDMI port was not set, but I can't seem to find the signal or the video.  Any suggestions?

    As Tom SC replied, you must contact the company that manufactured your computer.  In general, the ports HDMI on most computers is an out-bound port, send video / digital audio output.

    You should probably use a video capture card that can capture from HDMI source,

  • How to use the user with event loop event

    Hello

    I want to communicate between 2 VI, so I have a global variable (boolean) who gives the order to an event tool to run. The problem comes from the fact that event loop accepts no global variable, I found on the forum that I can use the user event. Of course, the second VI works normally when I push the button (boolean) in there to run the event loop. Please can someone explain me how to do this, I am a chemist.

    Thank you.

    You enter the receiver structure of event for the event you want to receive.

    To do this in two screws, you will have to share the user between them event reference.

  • Satellite P300-133 - how to use the internet connection via BlueTooth

    Hello

    I finally solve my problem with the synchronization via bluetooth between my P300-133 and my [HTC | http://www.htc.com/europe/product.aspx?id=15674] with Windows Mobile 5 - with step by step instructions of Toshiba.

    But I don't know how to use the Internet via BT, I tried many ways, one of them was to create a PAN with P300 as server - correctly connected HTC to P300, but it seams I can share internet with P300 as a gateway. And I want to do the opposite - get internet from my mobile to the computer (while she is away from all the cables). I'm not sure this PAN in the right way...

    The question of the other and less important is to be able to share that connection with your laptop via bluetooth - I guess that this must be done through Pan

    Thanks for any help.

    Bartek

    You found a solution to this?

  • How to operate the user enter value query and get the result on the text element

    Hello

    I'm really beginning to JDeveloper and ADF, I want to execute the query below, before with forms, I just add: TEXT_NAME to enhance the users entries, what should I do now with ADF, really unclear question and I would be grateful all help with that.

    Select
    NVL (min (substr (a.StartTime, 1, 8)), 0) Service_Start_Time, nvl (sum (a.sessionvolume), 0) Total_Traffic_KB
    Of
    aaa_bill one
    where
    msid =: TEXT_ITEM
    and starttime > = (select max (fee) FROM aaa_bill
    where msid =: TEXT_ITEM and accountreason = 5);

    You can use a form of parameter ADF for this requirement.
    https://blogs.Oracle.com/Shay/entry/combining_multiple_queries_and

  • How to use the user defined function in the Update statement

    Hi all

    I wrote under the update statement to update the column based on the return value of function. but it does not work. Could someone help me on this. This function returns a single value for each project.

    Thanks in advance.

    UPDATE dg2. OD_PROJ_LOOKUP_TEMP o
    SET Months_In_Stage_Cnt = Months_In_Stage_Cnt_ret (o.project_id) select the double;


    Thank you
    Deb

    PLS-00231: function 'MONTHS_IN_STAGE_CNT_RET' cannot be used in SQL

    -What is the function that is declared private in a package? If Yes, then it must be public, otherwise the SQL engine cannot be used.

    Published by: Dom Brooks on November 18, 2011 09:43

  • Get the field to remain Virgin until the user enters the value in the previous field used in the calculation

    I work on a PDF form and am stuck on one of my calculations. There are two fields 'desired Start Date", which is a date entered by the user. The "desired end" date is one year from date entered by the user. I figured out - however, before the user enters a date, I want this field remains empty. Currently, it fills with 01/00/000. How can I get this field to calculate not unless a date is entered by the user? So far, I tried this but can not get the blank to stay:

    If the field 'Desired Start Date' is empty, leave 'to' field blank

    var myStartDate = new Date (this.getField("Desired_Effective_Date").value);

    If (((myStartDate == 0) & & (getField("myStartDate").valueAsString = "")) {event.value = "";})

    If the field "Desired Start Date" is an effective date, use the date to calculate one year after the date of entry.

    }

    else {this.getField("to").value = util.printd ("mm/dd/yyyy", new Date (myStartDate.getFullYear () + 1, myStartDate.getMonth (), myStartDate.getDate ()))}

    Try the following than the calculation script custom field "to".

    Get the value of the date field beginning

    var sStartDate = getField("Desired_Effective_Date").valueAsString;

    If the start date field is not empty...

    If {(sStartDate)

    Converts a date in a date object string

    Kai = util.scand ("mm/dd/yyyy", sStartDate);

    Add a year

    oDate.setFullYear (oDate.getFullYear () + 1);

    Set this field to the calculated date value

    Event.Value = util.printd ("mm/dd/yyyy", anyway);

    } else {}

    This field blank because the input field is empty

    Event.Value = "";

    }

    You may need to change the date format "mm/dd/yyyy", I used to match the formats of date fields.

  • How to create the user account using the command?

    How to create the user account using the command?

    Open cmd as administrator, and then type the following commands one after the other

    NET user / add program mypassword
    net localgroup administrators program / add
    net share concfg * C:------/ grant: program, complete
    This will create a user account with the name "Program" and the password "MonMotpasse".

    You can create the user name and password of your choice.
  • How to restrict the user to enter not same value in a table

    Greetings!

    I m asking a second time the upfront because I did not answer preivously, so please don't mind if it's a double.

    It was: I have created a table, as shown in the example.

    I want to validate the user name that you see in my example to restrict the user to enter the same value in the user name field before submitting page.

    for example when the user enters data as u see test in user name in the first row, when it goes to the second row and type same username as test "message will appear or restrict the user who has already typed or in use"...

    http://Apex.Oracle.com/pls/Apex/f?p=45296:1:22797340776918:

    It's all done on typing submit prior to registration.

    Please drivers

    Hello

    I m asking a second time the upfront because I did not answer preivously, so please don't mind if it's a double.

    It was: I have created a table, as shown in the example.

    I want to validate the user name that you see in my example to restrict the user to enter the same value in the user name field before submitting page.

    for example when the user enters data as u see test in user name in the first row, when it goes to the second row and type same username as test "message will appear or restrict the user who has already typed or in use"...

    http://Apex.Oracle.com/pls/Apex/f?p=45296:1:22797340776918:

    It's all done on typing submit prior to registration. >

    Stick the code below into the Page header > Javascript > run when loading the Page field.

    $('[input[name="f03"]').blur(function(){
      if ($('input[name="f03"][id!="'+$(this).attr('id')+'"]').val() == $(this).val()) {
         alert('Duplicate Entry.');
         var x = $(this).attr('id');
         setTimeout("(function(p){$('#'+p).focus();})('"+x+"')",100);
      }
    })
    

    Note:
    a.F03 is the 'name' of your column of username in the form of tables.
    b. This only valid values. If your tabular presentation has multiple pages then all of the rows are not currently displayed will be ignored.

    See you soon,.

  • How to use the Weblogic user in my WebCenter application?

    Hello

    I'm doing my first Webcenter application. I have configured my wiki and weblogic server to connect, forum (discussions) with my users OID. So now any user OID can connect to this application.

    In my custom application Webcenter I configured JAAS security, now I would like to know how to use the same users OID in my application. Is this possible? Can someone help me? I tried Oracle Developers Guide, but it doesn't help me.

    Sorry for my bad English...

    Thank you

    Nelson

    You need to register a new provider of authentication on WLS. Please see this link http://www.oracle.com/technology/products/jdev/tips/fnimphius/oidconfig/index.html.

  • Slide auto is using of multiple text entry boxes once the user enters two of the six answers

    I have several areas set up on a slide text entry.  The user must enter the answer in each text box.  And even though I have properties of all TEB "break from legends of success or failure", auto slide advance once the user enters only two of the six responses.  I thought that perhaps insert a click box and setting ' to pause until the user clicks on "would resolve the issue... but it is not.  Here's a screenshot of what my slide looks like and a screenshot of the properties that I set myself for each TEB.  Can someone help me please?  I need all six TEB to complete before moving to the next slide.

    TEBs.PNG

    TEB properties 1.PNG

    TEB properties 2.PNG

    The most important screenshot is missing: chronology. Where are the pausings for the TEB?

    You can start by changing the Actions on the success and the last attempt: they are both set to Continue, which means the playhead will be published immediately after a good response and after exhausting attempts in case of wrong answers. Set them to any Action.

    No Submit button? Only shortcut key entry for each TEB?

  • How can I make the submit button that is activated after the user enters a digital signature?

    I have a form that contains a digital signature field. Once the user enters their digital signature, my "submit" button is disabled. I wanted that this remains activated for the user can submit the form with their digital signature and the form (in PDF format) as an attachment.

    I'd appreciate any help.

    Kind regards

    Fanny

    You can configure the fields of lock after the signing of the digital signature. In Livecycle Designer across this field properties: object-> TAB Signature properties. Here can exclude the button submit or any other field, if necessary, do not lock after signing.

    -Rambeau.

  • Using a "button to submit the user entered data in PDF format in mail

    I created a form in which the user fills out the form and click on "Button" to submit data via PDF (attached to an email) to a specific e-mail (mailto:[email protected]). When the blank email to your colleagues, it does not have the function to work. Any help would be greatly appreciated!

    Also if you have the time is there a way to set the order of the data when the user submit via xml?

    Open the PDF in acrobat pro.

    Click Advanced-> Extend features in Reader

    Click Save now

    try that saved form

  • How to use the software keyboard Toshiba 50L9450VE TV?

    I just bought a LED TV model 50L9450VE. When installing, I need to enter the password for the wifi network. The remote doesn't have a keyboard of the letter, and the TV shows a soft keyboard to enter the password. How to use the software keyboard? I can't figure out how to get the cursor in it; the manual does not say, and I can't find the information online. Thank you.

    Hershel

    Suppose you are from Israel? Although this model is not made for the EU market, but probably for the Asian market, it looks like the European L93 series.
    You will find how to operate the software keyboard (page 52): http://www.toshiba-om.net/pdf/manual...h-Specific.pdf

  • Somehow, I blocked my user account (login) and I tried to help but can't find any info. How to UNLOCK the user account. Than k you

    The user has clicked on Vista, the little lock at the bottom of the START window.

    Somehow, I blocked my user account (login) and I tried to help but can't find any info. How to UNLOCK the user account. Thank you

    Hello

    Click the account icon that was locked and enter the password IF you know and otherwise:

    Try Safe Mode - several times, press F8 that you start. The Admin account there is no default password
    so unless someone has changed, you should have access there. Then Control Panel - accounts - users
    Manage another account - use this down your user account (to the lowest level) APPLY/OK
    then go back and reset it to the Admin APPLY/OK - this clearly allows corruption. Do this several times.
    Then fix the password in your usual account. Do not forget to leave your account administrator if you
    wish.

    If no joy Mode without failure:

    Try this - use the hidden administrator account to lower your user account (to the lowest level) APPLY/OK
    then go back and reset it to the Admin APPLY/OK - this clearly allows corruption. Do this several times.
    Then fix the password in your usual account. Do not forget to leave your account administrator if you
    wish.

    Make another Admin account with your password and use it to fix the others if necessary. (just for
    repair, don't use regular account, not a safety valve) always keep a spare ADMIN account.

    DO NOT LEAVE THE ENABLED LSA OR USE DAILY. If it corrupts you are toast!

    How to enable or disable the real built-in Administrator account in Vista
    http://www.Vistax64.com/tutorials/67567-administrator-account.html

    You can run the Admin account hidden from the prompt by if necessary.

    This tells you how to access the System Recovery Options and/or a Vista DVD
    http://windowshelp.Microsoft.com/Windows/en-us/help/326b756b-1601-435e-99D0-1585439470351033.mspx

    If you cannot access your old account, you can still use an Admin to migrate to another (do not forget to always
    not that an Admin account that is not used except for testing and difficulty).

    Difficulty of a corrupted user profile
    http://windowshelp.Microsoft.com/Windows/en-AU/help/769495bf-035C-4764-A538-c9b05c22001e1033.mspx

    ---------------------------------------------------------

    If necessary:

    Ophcrack is a free Windows password cracker based on rainbow tables.
    http://Ophcrack.sourceforge.NET/

    How to reset a Windows Vista - Trinity Rescue Kit method - password password reset disc - burn the ISO
    http://www.WikiHow.com/reset-a-Windows-Vista-password
    YouTube video on the use of the Trinity rescue Kit
    http://www.YouTube.com/results?search_query=Trinity+rescue+Kit&search_type=&AQ=f

    Reset your forgotten password the easy way using the Ultimate Boot CD for Windows
    http://www.howtogeek.com/HOWTO/Windows-Vista/reset-your-forgotten-password-the-easy-way-using-the-ultimate-boot-CD-for-Windows/

    Offline NT Password & Reset Editor
    http://home.eunet.no/~pnordahl/ntpasswd/

    I hope this helps.
    Rob - bicycle - Mark Twain said it is good.

Maybe you are looking for

  • The fans are not stop working after upgrading BIOS on Satellite A200

    Hello IM using the Satellite A200-1bp. I recently updated my BIOS 5.20 - winner and my fans are not end all the time working.I think his reason is update BIOSI'm looking for the BIOS below. Please help me...

  • Determine if the tab is active

    If you have a tab control that has 3 legs for example, I wonder how do you determine if the 3rd tab is selected?  For example, I would use that a True/False Boolean output according to the 3rd tab is selected... If the tab is selected, the Boolean va

  • Visa resource unavailable, device to use my other program

    Hey guys,.I bought a Usb to parallel Port adapter and created a pilot nor Visa for him and then launch labview and I ran some programs on the card and everything worked, I was able to send data to the usb port and able to light a led and turn off...

  • Cannot stay connected to the network, even after replacing my old router.

    I have a laptop Toshiba Satellite L655 is one year old and its operating system is Windows 7 home Premium I have Comcast internet service and use a NetGear wireless router. Recently, about 2 months ago I got this router in Comcast, in replacement of

  • Upgrade Vista Basic Vista Home Premium with the old product key.

    When I bought my laptop, it came with Vista Home Premium installed. I had to wipe my HD and reinstalled Vista using the diskette provided me by Dell, but the version they gave me was Vista Home Basic. Is there a way to upgrade to Home Premium with pa