read textField

Hi, I need help for text input, I have this code:

add(new AutoTextEditField("Text:"," ", 40,EDITABLE));

I want to know how I can read text written on this text field to record in a var.

Thank you

You must keep a reference to the field.

AutoTextEditField myfield = new AutoTextEditField();

Add (MyField);

Now, you can return to the reference and tell

String text = myfield.getText ();

Tags: BlackBerry Developers

Similar Questions

  • read textfield on the next screen

    Then. I am very new to programming and a hard time to find an answer to my question because I don't know anything specific to search again.

    I have a textfield on my first screen named txtPrice and txtQuantity and a btnCalculate button. How to multiply these on the next screen?

    I tried to set the fields for two text as a public variable on the screen, but the value entered on the roll screen1 does not grow above screen2.

    Could someone please provide an example of how to do this.

    Thank you!

    Welcome to the forums and emissions of BlackBerry.

    This kind of thing is not something is not specific to BlackBerry, and it might pay to read some more information about Java programming., otherwise you'll beat Java and BlackBerry trying to learn things.

    Anyway, in this case, probably the best thing to do is actually pass values through to display 2 as part of the constructor.  So in your treatment for your press the button, you'll have something like

    Price of the string = txtPrice.getText ();

    String quantity = txtQuantity.getText ();

    Screen2 newScreen = new Screen2 (price, quantity);

    UiApplcation.getUiApplication () .pushScreen (newScreen);

    And you Screen2 constructor would look like

    Public Screen2 (price, amount of String String) {}

    .....

    }

    You will need something like

    float quantityFloat = Float.parseFloat (quantity);

    to put strings into numeric values, you can multiply.

    But like I said, learn java on the Blackberry is a challenge.  I would try to get some skills in Java on a PC (which is much more friendly learner) before developing on the BlackBerry.

  • Reading and scrolling down a textfield without modification.

    Hi all

    I create an interactive PDF which allows you to take a note. So there is a textfield with several marked line. When I use my PDF on my ipad, I can still take some remark, but when I finished and I remove my keyboard, I can't scroll to the bottom of the TextField. I have to click on the text, open the keyboard and then I can scroll down. Is there a way to scroll to the bottom of a text field on acrobat reader for ipad without opening the keyboard?

    Thank you!

    Bernd is correct. The text field is not set unless it is activated (by pressing on it). Once you enable it, the keyboard is displayed (unless an external keyboard is connected).

  • The alpha property does not not on TextField if publication of Reader 9

    Hello

    I have a movie that works very well when I publish to Reader 10, but when I publish to Reader 9, the code that assigns an alpha property to my TextFields stops working. I have a previous movie, I probably did in CS4, which uses code similar to fade in and out TextFields. It was published for Reader 9 and works very well. Is it possible that something has changed in CS5 (note that I don't use of TLF, only the dynamic TextFields text boxes)?

    Here is an example of the code that I use:

    Stop();
    Import fl.transitions.Tween;
    Import fl.transitions.TweenEvent;
    Fl.transitions.easing import. *;
    import flash.events. *;
    import flash.text. *;
    import flash.text.TextFormat;
    import flash.utils.Timer;
    import flash.display.MovieClip;
    import flash.display.Sprite;

    var txtFormat1:TextFormat = new TextFormat();
    txtFormat1.font = "Optima"
    txtFormat1.color = 0 x 000000;
    txtFormat1.bold = false;
    txtFormat1.size = 16;
    txtFormat1.leading = 2;

    var subtitle: TextField = new TextField();
    subtitle.autoSize = TextFieldAutoSize.CENTER;
    Subtitle.Selectable = false;
    subtitle.defaultTextFormat = txtFormat1;

    var fadeInSubtitle:Tween;

    addChild (subtitle);
    Subtitle.x = stage.stageWidth / 2 - subtitle.width / 2;
    Subtitle.y = stage.stageHeight / 2 - subtitle.height / 2;
    Subtitle.Alpha = 0;
    Subtitle.Text = "what is the most important question in";

    fadeInSubtitle = new Tween(subtitle,"alpha",None.easeNone,0,1,3,true);

    You must embed fonts.

  • How to display multiple values read from database in a textfield

    Hi all

    I'm working on a feature where say if there are 3 employees in a Department and then I want to show all names (separated by commas) employees of the Department in a textfield.

    do any body have any suggestions?

    Thank you
    Tauceef.

    See also:

    {: identifier of the thread = 1033907}

  • In the target FPGA read/write control function?

    Hi people,

    I learn a lot from the sample project FPGA, including how you can easily retrieve and set controls and indicators in an FPGA using the read/write control function running in an RT target.

    However, I can't find a way to do something similar in a FPGA target.  I've been down this road before - that is, trying to move the data in/out a looping VI FPGA (void) to a (parent) FPGA VI - where my memory points to reach what I needed use.

    So I was happy to see the palette FPGA enabled me to drop the control functions to read/write on a FPGA vi target.  But alas there where tons of errors (not compatible son for target, etc.) and I guess now it's not possible.

    So, just to be sure, I'm not missing something, is there something like control functions to read/write to use in an FPGA for read/write in an another FPGA (looped)?

    In addition, why would I be able to read/write on a FPGA vi control functions if they are not supported?  (Sorry for the n00b question)

    Thank you

    Steve

    maherhome wrote:

    You're right that I don't have this knot in my palette.  However, I also do not seem to have a Refnum Occurrence in the palette is in the FPGA (see below), but I need to synchronize several loops of FPGA and added research using the textfield in the VI editor (and if compiles and runs).  So 6 months to Labview and I'm fuzzy on how the palette is restricted

    I don't know what you're trying to prove here. There is no control of refnum in search in your image. Occurrences are available in FPGA, and for control of refnum for one you just right click on a function of the instance and create a control. If you can create a valid thread of a certain type of data, then you can create a control or the indicator for it, regardless of the question to know if this type of control or indicator appears in the palettes. However, the functions that you can use in the block diagram are limited by what is available in the palettes.

    maherhome wrote:

    Regarding orders read/write for the FPGA/lights, I'm surprised that the infrastructure developed to allow read/write between RT and FPGA has not mobilized to allow read/write between FPGA and FPGA.  The elements of memory function, but they are less convenient.

    You may have noticed that you cannot compile the individual parts of an FPGA VI and combine them later; This is because when you compile an FPGA VI, all its subVIs are essentially merged to create a single block diagram (with additional logic if one not reentrant Subvi is used in multiple locations, this is why it is not recommended on FPGA). The subVIs no longer exist in the FPGA compiled; reading and writing a control on them would make no sense. If you want similar behavior, use global variables - but understand that global variables store values in FPGA logic resources. Using the elements of memory (or FIFO, which can also store in memory) leaves more fabric available FPGA logic by storing data in resources specially designed for this purpose.

  • Tests of TextField

    Hello

    Can someone tell me what I'm doing wrong here?  I want text large enough to read, but it's true lower case.  I'm just playing make a primitive text editor and I started with the code in the page Web Adobe FileReference.

    package {
        import flash.display.*;
        import flash.events.Event;
        import flash.events.MouseEvent;
        import flash.net.FileReference;
        import flash.net.URLRequest;
        import flash.net.FileFilter;
        import flash.text.*;
        import flash.text.TextFormat;
        import flash.text.TextFormatAlign;
    
        [SWF(height="600", width="1024", frameRate="30", backgroundColor="#ffffff")]
        public class EditFile extends Sprite {
    
            private var MyTextField:TextField = new TextField();
            private var MyButtonField:TextField = new TextField();
            private var MyFile:FileReference = new FileReference();
            private var C_format:TextFormat = new TextFormat();
    
            public function EditFile() {
    
                C_format.bold = true;
                C_format.size = 40;
    
                MyTextField.border = true;
                MyTextField.width = 700;
                MyTextField.height = 450;
                MyTextField.setTextFormat(C_format);
                MyTextField.multiline = true;
                MyTextField.type = TextFieldType.INPUT;
    
                MyButtonField.background = true;
                MyButtonField.backgroundColor = 0x339933;
                MyButtonField.x = 850;
                MyButtonField.y = 120;
                MyButtonField.height = 30;
                MyButtonField.text = "Click here to save";
    
                addChild(MyTextField);
                addChild(MyButtonField);
                MyButtonField.addEventListener(MouseEvent.CLICK, clickhandler);
                stage.nativeWindow.visible = true;
    
            }
    
            private function clickhandler(e:MouseEvent): void {
                MyFile.save(MyTextField.text);
            }
    
        }
    }
    

    Another thing cute is my cursor keys work (sort of) in the TextField, even if it does not exist on the keyboard of the pop-up window (maybe it should be?).  The mouse can select text, but not to change the insertion point as the cursor keys can.

    Thank you

    Harry

    Hey harry,.

    change this line:

    MyTextField.setTextFormat(C_format);
    

    This line:

    MyTextField.defaultTextFormat = C_format;
    

    that should do the trick even if I can't use my keyboard on my laptop for some reason any... works only if I type with the integrated keyboard.

    Edit: I forgot to put the explanation hah... defaultTextFormat property applies the format of text of w/e tell you him AGAIN all text entered in the field. the setTextFormat method applied the text of w/e format that say you the CURRENT text in the field.

  • Read the dynamically created objects

    Hello

    I get my feet wet with development of Cascades, and I was hoping someone here could answer some questions I had.

    I am defining a container that contains a drop-down list and a zone of textfield and I need to repeat this containing three more times. I thought by using the ControlDelegate class to create three instances without writing the code three times. However, I don't know how I'd read the value of each instance of the drop-down list and the ControlDelegate textfield.

    Any Suggestions?

    If you instantiate the like this:

    Container {
        property variant control1
        property variant control2
        property variant control3
    
        id: rootContainer
        Label  {
            text: "Example Component Definition"
        }
        Button  {
            text: "Click to create dynamic component"
            onClicked :  {
                // Create the component and add it to the Container
                control1 = compDef.createObject();
                rootContainer.add(control1);
                control2 = compDef.createObject();
                rootContainer.add(control2);
                control3 = compDef.createObject();
                rootContainer.add(control3);
            }
        }
        attachedObjects: [
            ComponentDefinition {
                id: compDef
                textfield { id: text }
            }
        ]
    }
    

    Then components are accessible as control1.text, control2.text etc.

    If the number of objects is constant, then ControlDelegate might be more convenient.

    For ListView, you can use ArrayDataModel or GroupDataModel (for more complex models with sorting) and fill it with any type of data. Any kind of items can be added, it's just a picture of QVariantMaps. It is not necessarily Xml or SQL wrapper, but specialized models also exist for this. It is even possible to create a subclass of DataModel custom c++ to expose existing data objects.

  • Horizontal scrolling TextFields custom

    Hello friends. I am trying to create a textfield that automatically scrolls horizontally when the field is full. I use a custom class of TextField shown below which I reduced for simplicities sake. I have also included the call that I use. Any ideas why it would not produce a scrolling textfield horiztontally? Thanks to all lots of love.

    Create a new TextField in a HorizontalFieldManager

    HorizontalFieldManager mgrFirstName = new HorizontalFieldManager (HORIZONTAL_SCROLL);

    FirstName TextField = new TextField (BasicEditField.NO_NEWLINE, HORIZONTAL_SCROLL);

    mgrFirstName.add (FirstName);

    Add (mgrFirstName);

    / * Class TextField custom * /.

    SerializableAttribute public class TextField extends HorizontalFieldManager

    {

    public BasicEditField bEdit = null;

    Public TextField (long Style, long scrolling)

    {
    Super (Scroll);

    bEdit = new BasicEditField (Style);
    Add (bEdit);

    }

    }

    Here is a link to an article in the knowledge base that solves this problem. If you want to spruce up the gadget, make sure to read the comments:

    A scrolling line text entry field

  • Operation of TextField

    Hello

    I am wanting to write a paragraph of text and display it on screen in my application. I don't know, I read that the TextField creates a modifiable on-screen text box. How would you propose to create this paragraph? I simply would use much LabelFields?

    Thank you

    Yes, just add it to your manager for scrolling. It might look like this:

    TextField copyrightField = new TextField(TextField.FOCUSABLE | TextField.READONLY);
    copyrightField.setText(myCopyrightText);
    mainVFM.add(copyrightField);
    

    Simple but effective. In this particular case, if your text is too long and that your manager scrolls, the user will be able to scroll through all the regular text with navigationMovements (trackball / trackpad, slide / move on a touch screen).

  • textField.restrict - how just allow one decimal place

    Hello

    I read somewhere on the textField.restrict.

    I use it to limit user input to just the numbers and the decimal point.

    a.textField.restrict = '. '. 0-9 ";

    However, I find that the user can input more than one decimal place.

    Does anyone know how to limit user input to just one decimal place?

    Thanks for the help.

    This should work for you

    package
    {
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFieldType;
    import flash.events.TextEvent;
    
    public class Test extends Sprite
        {
        public function Test()
            {
            var tf:TextField = new TextField();
            tf.type = TextFieldType.INPUT;
            tf.border = true;
            tf.width = 200;
            tf.height = 16;
            tf.x = tf.y = 20;
            tf.restrict = ".0-9"
            tf.addEventListener(TextEvent.TEXT_INPUT, restrictOneDecimal);
    
            addChild(tf);
            }
    
        function restrictOneDecimal(evt:TextEvent):void
            {
            var matches:Array = evt.currentTarget.text.match(/\./g);
    
            if  (evt.text == "." && matches.length >= 1)
                evt.preventDefault();
            }
        }
    }
    

    or if you want to restrict to one decimal place, but also a number of digits after the decimal point:

    function restrictDecimalPlaces(evt:TextEvent):void
        {
        var matches:Array = evt.currentTarget.text.match(/\./g);
        var allowedDecimalPlaces:uint = 2;
    
        if  ((evt.text == "." && matches.length >= 1) ||
            (matches.length == 1 && (evt.currentTarget.text.lastIndexOf(".") + allowedDecimalPlaces < evt.currentTarget.text.length)))
            evt.preventDefault();
        }
    
  • Reading XML document

    Hey programmers,.

    I opened a thread yesterday regarding recovery code XML from a server (http://supportforums.blackberry.com/t5/Java-Development/How-to-retrieve-XML-from-server-response/m-p...) and got several nice answers and so I thought that the problem had disappeared. In fact, he only changed form.

    So I have another question for you: how to recover data from a Document and display it on the screen?

    Number of points:

    -J' tried function getType() as suggested in the post mentioned, I get a text/xml response.

    -J' have tried to use the getTextContent() on the document to put it in a TextField, it might be a rookie mistake.

    -J' I tried to put my stream to a string, but then I get something like "rim.blabla.blabla@812371".

    -J' tried to simply open a dialog with the document.getTextContent () method, but a dialog box empty is displayed.

    -J' read this post (http://supportforums.blackberry.com/t5/Java-Development/cannot-read-nodes-in-xml/m-p/324562), I would do something like this to read my XML?

    Here are some relevant parts of my code (_http is my connection):

    DocumentBuilderFactory plant = DocumentBuilderFactory.newInstance ();
    DocumentBuilder builder = factory.newDocumentBuilder ();
    Doc document = builder.parse (_http.openInputStream ());
    _HTTP. Close();

    If (doc! = null) Dialog.inform ("reading the document"); Which appears still, so I guess that is not null

    I don't really know much to XML and any help would be much appreciated.

    Yet once, I give a lot of congratulations!

    I got my answer, it works when adapt you the code in XMLDemo with the solution provided by Jcarty in the post mentioned in the original post.

    In the end, it came to this:

    -Open the connection http and everything

    -retrieve data with:

    DocumentBuilderFactory plant = DocumentBuilderFactory.newInstance ();
    DocumentBuilder builder = factory.newDocumentBuilder ();
    Doc document = builder.parse (_http.openInputStream ());
    _HTTP. Close();

    -change the constructor of the XMLDemoScreen class so there Document as an argument:

    public XMLDemoScreen (Document doc) {...}

    -change the document acquired the manufacturer as:

    Document document = doc;

    But I suspect that it worked because the XML was fairly simple.

    In any case, thank you very much for your help Simon, Bravo to you as promised...

  • APEX 5 icons inside Textfield

    Hello

    How can I include icons or checkmarks in textfields (password) with universal theme? Some of the new sample applications have it.

    see you soon,

    Bernhard

    Hi Bernard,.

    Please, read this Dimitri Gielis Blog (Oracle Application Express - APEX): APEX 5.0: pandering to the login page blogpost, then you will be wiser.

    Kind regards

    Pavel

  • Problem with TextField

    Hello

    I try to use TextField. I have windows 7.i have jdk 8u45. I try to use multiple text boxes. I wrote the following code:

    Javax.swing import. *;

    import java.awt.*. *;

    Class Avg5Nums {}

    int num1, num2, num3, num4 num5.

    Double Avg;

    Avg5Nums (int val1, val2, val3, val4, val5 int int int, int) {}

    NUM1 = val1;

    num2 = val2;

    NUM3 = val3;

    NUM4 = val4;

    NUM5 = val5;

    }

    Double getAvg() {}

    int sum = num1, num2, num3 + num4 + num5;

    Mean = sum/5;

    return Avg;

    }

    }

    class useAvg5Nums extends JFrame {}

    Public Shared Sub man (String [] args) {}

    TextField field1 = new JTextField();

    TextField Field2 = new JTextField();

    Field3 TextField = new JTextField();

    TextField field4 = new JTextField();

    TextField sphere5 = new JTextField();

    Message to object [] = {}

    "Enter the value 1: ', Field1,.

    "Enter the value 2:", Field2,.

    "Enter the value 3:", field3.

    "Entry of value 4: ', field4,.

    "Enter the value 5: ', sphere5.

    };

    int val1, val2, val3, val4, val5.

    val1 = 0; val2 = 0; val3 = 0; Val4 = 0; Val5 = 0;

    int option = JOptionPane.showConfirmDialog (null, null, 'Enter your values', JOptionPane.OK_CANCEL_OPTION);

    If (option is JOptionPane.OK_OPTION)

    {

    String value1 = field1.getText ();

    String value2 = field2.getText ();

    String value3 = field3.getText ();

    String value4 = field4.getText ();

    Value5 string = field5.getText ();

    val1 = Integer.parseInt (value1);

    val2 = Integer.parseInt (value2);

    val3 = Integer.parseInt (value3);

    Val4 = Integer.parseInt (value4);

    Val5 = Integer.parseInt (value5);

    }

    Avg5Nums obj = new Avg5Nums (val1, val2, val3, val4, val5);

    Double Avg = obj.getAvg ();

    JOptionPane.showMessageDialog (null, "average is" + Avg, 'results', JOptionPane.PLAIN_MESSAGE);

    System.Exit (0);

    }

    }

    I am getting following error:

    G:\Zulfi\java prog\2015\joptionPane > java useAvg5Nums

    Error: Main method not found in the useAvg5Nums class, please set the main method

    as:

    Public Shared Sub main (String [] args)

    or a JavaFX application class must extend to javafx.application.Application

    G:\Zulfi\java prog\2015\joptionPane >

    can some body please guide me.

    Zulfi.

    The error message is a missleading bit because you extended JFrame instead of just using it (which is a bad practice, but unfortunately many tutorials are...)

    The error you get should be

    "parent could not be resolved."

    You did not declare a variable named "parent".

    The good news is that you don't need.

    If you had looked in the documentation of the API you would have read that you can safely pass null as parent. Although this has some drawbacks you should do for now until you better understand differences of classes and objects.

    Good bye

    DPT

  • How to activate a field read-only for data entry.

    Dear all,

    In fact, I'm bring a form simply queries the table of database data and shows it. It presents the data in readonly textfields.

    There is a button that can create a new line. The problem is when the system is to create the line he is creating the messagefield readoly.

    In order to overcome the situation that I wrote the code below

    mainVO.last () .setAttribute ("IsTextReadable", Boolean.TRUE); To make the last row entrable for the user.

    But the system gives the error when the user is pressing the button create

    Details of the exception.

    oracle.apps.fnd.framework.OAException: oracle.jbo.NoDefException: Houston-25058:

    IsTextReadable of the type definition of that attribute is not found in XxphccamsfdbmstdtlrVO1

    Could you please suggest me how to make the textfield readonly can be changed dynamically.

    Concerning

    Rajat

    Dear Stephanie,

    Thanks for your reply. I solved the problem and it was pretty simple.

    I created a transient in the VO and attached attribute the transitional attribute to the property read-only from the field using SPEL (${oa.) XxamsfdbdtlrVO1.Viewenb}).

    Select the line that you want to update and run it.

    row.setAttribute ("Viewenb", Boolean.TRUE);

    Concerning

    Rajat

Maybe you are looking for

  • Display problems using Firefox with Windows 7, 64-bit

    Hi support them I have a new desktop computer running Windows 7, 64 bit.When I use Firefox version 3.6.8 to view my Web site, it displays everything out of alignment.If I use IE 8.0 it shows very well.If I use my laptop which is running Win XP site d

  • Sony music and album app does not find the files on the device,

    Like new the music app Sony Z5 found all the music on my SD card I downloaded now more through music amazon app, but they do not appear in the app sony music. Any ideas how to get new music appears in the application Sony Music? Never had this proble

  • Redirect to a site unwanted

    Hello Almost whenever I click on the web search results, I get redirected to the following address, which begins as follows: http://www.bywill.net/?search= and it takes me to an unwanted website. What should I do to fix this? Thank you

  • BSOD - need help :) .dmp file analysis

    Dump file:https://1drv.Ms/f/s! AsYeF_5YscTDgQmS-4MWCE1zNVvq Signature of the problem: Problem event name: BlueScreenOS version: 6.1.7601.2.1.0.256.48Locale ID: 1033 More information about the problem:BCCode: 1000007eBCP1: FFFFFFFFC0000005BCP2: FFFFF8

  • Update app appearing is not on BBWorld

    Hello Not sure if this is the correct subform to ask this. But I downloaded my new bar file (version 1.1.0.36) and he has not yet revealed on BBWorld. I downloaded the Sunday. It was approved (received an email) at the time of 12.45. It was about 17