TextInput is missing the last character

My code includes a textinput coded in this way:

               inWeightField.setPosition(650,240);
               inWeightField.width = 300;
               inWeightField.height = 30;
               inWeightField.textField.restrict="0-9."
               inWeightField.textField.maxChars=7;
               //
               var temp:String = inWeightField.text;

The issue I see is that the last charater in temp is chopped, i.e. If 50.23 is entered, the temp = 50.2

Why the last char is chopped and how this can be fixed?

Hey Rita,.

I think that you run in a kind of race condition. what you do in your listener function? If you set the temp string then most likely, you must use the KeyboardEvent.KEY_UP event instead. I think that the TEXT_INPUT event fires BEFORE any character is placed in the TextInput object. the KeyboardEvent.KEY_UP occurs after the character is displayed in the TextInput object. try to change the event and see what happens. Good luck!

Tags: BlackBerry Developers

Similar Questions

  • Delete the last character in the input field

    How to remove the last character of an input field?

    It deletes all

    When you click on:

    SYM.$("textfield"). Empty();

    Thank you!

    Try this:

    var inputTxt = sym.$("textfield").text ();

    var truncatedTxt = inputTxt.slice (0, -1);

    SYM.$("textfield"). Text (truncatedTxt);

    HTH,

    Vivekuma

  • Retrieve the Position of the last character of Textlayer

    Dear script Experts!

    I wonder if there is a way to get the properties of the position of the last character in a text layer.
    For example, I used this in ActionScript: txt.getCharBoundaries (txt.length - 1);

    Thanks for any help

    Mike

    Available properties for a text layer are:

    applyFill

    applyStroke

    Dialoguegeneral

    boxTextSize

    fillColor

    Police

    fontSize

    Justification

    pointText

    strokeColor

    strokeOverFill

    strokeWidth

    text

    follow-up

    Last I saw, by the data type character recovery was still not available. Even in AE CC. Any extraction layer text property is based on the first character in the text string. So if each character used a font, point size, kerning, etc. only the values of the first character could be found.

    Re: Is it possible to access the text by character properties via script?

    Some other posts here that speak of the location of the text layer:

    Attribute boxTextSize ADBE Text Document

    Get a text box anchor point after scaling

    You can always ask too.

    Adobe - feature request/Bug Report Form

  • TextBox multiline missing the first character after the new line

    Hello, I do a pdf report that swaps 2 pages back (the content is the same except for one table), essentially what happens when you click on the button 'page swap' is:

    1. get all the values of the fields in the page that will be deleted in a table "buffer".
    2. delete the page
    3. Insert the other page
    4. Fill out all field values values in the buffer

    So the thing is that in line with several text boxes is missing the first character each new line after this process if I change the content, if I do not change the content, while I share the pages and transfer field values, it makes it ok, it doesn't matter what line change it and how many lines I change in the text box together multiline each new line, I get a character less at the beginning of a new line (except for the first character of the first line).

    I'll try to work program autour with text.replace ('\n', '< br >') or something if I miss a few key configuration for this.

    I use Acrobat Pro 11.0.06 on a Windows 7 Professional client on a 20(3.13.10-200.fc20.x86_64) of Fedora host.

    Thanks in advance

    If you remove the option of formatting rich text for the field, it works fine. "In addition, I don't understand why you need the whole thing to replace line breaks with.
    "tags...". It is not at all necessary.

  • Apply the last character of line color

    Hi all

    I'm newbie in Javascript.

    Question: I want to apply the color to the last character in the line. It does not work.

    My lines are:

    myDocument var = app.activeDocument;

    myLine var = myDocument.stories.everyItem ().lines.everyItem () .getElements ();

    for (i = 0; i < myLine.length; i ++)

    {

    myLine [i] .characters. item(-1). fillColor = "SS";

    }

    I think that the error which was held in the item(-1) only occurance.

    Can someone give the solution?

    / * But if I want to apply the color at the beginning of the line, it works.

    This is the line i follow:

    myDocument var = app.activeDocument;

    myLine var = myDocument.stories.everyItem ().lines.everyItem () .getElements ();

    for (i = 0; i < myLine.length; i ++)

    {

    myLine [i].characters.item (0) .fillColor = "SS";

    }*/

    Hello X,

    You must check the end doubled characters is undesirable space, enter brand, shift enter, etc...

    Please try the JS code below.

    var myDocument = app.activeDocument;
    var myLine = myDocument.stories.everyItem().lines.everyItem().getElements();
    for(i=0; i
    

    THX

    csm_phil

  • Select the last character of a string

    Hello
    I want to select the last character of a string address. "For example, as a result of select ' 165 John Ave W '-'W '. I tried to use the RIGHT but it does not work. I am using sqlplus.

    SELECT RIGHT(ADDRESS,1) FROM addresses;
    ORA-00904: "RIGHT": invalid identifier

    I can't find that any select statement to get the result I want. Ideas?

    Thank you!

    You want: SUBSTR (, - 1).

  • Select from the table where the last character of the string is numeric

    Hello
    I have a table of STREETS with a field called ADDRESS. I want to select all the records in streets where the last character in the address is a number.
    Select ADDRESS of STREETS where regexp_like (substr (address,?,?,), '[0-9]');
    --? means that I don't know what to put here!

    I don't know if substr is the best approach to do this, because I want only the last character and the records are of different lengths.

    Thank you!

    Hello

    If you want to use regular expressions:

    WHERE     REGEXP_LIKE ( address
                  , '[0-9]$'
                  )
    

    You can get the same results, no doubt more effectively, without regular expressions:

    WHERE     INSTR ( '0123456789'
               , SUBSTR (address, -1)
               )     > 0
    
  • Find the last character in a string aplhanumreic

    Hi guys first time poster long time hiding in the shadows, I hope someone can help me

    I put the stored username and I need to find the last character before the number, for example

    ABC123 that I would like to find c
    AB123 I would find b

    suggestions as to how I could do this?
    Thanks in advance

    Here's one way:












  • How can I return my product key for Windows 7, when I lost the last character (letter) of it?

    I got a product key for win7 professional to Network MSDN, but unfortunately I do not have type last character check. Is it possible to get it back?

    Can I use a key of win 7 for win 7 SP1?

    (1) simply log in to your MSDN account and check your keys here.

    (2) Yes - the key is which on any level of SP.

  • Select before the last character.

    I have some URLS in a picture like this

    http://test.com/ABC/ghgh.html

    http://test.com/BCD/

    http://test.com/FFF/default.aspx

    http:// test2.com/a

    I want to select all the items before the last.

    But if the last / is it after the .com can get just how it is.

    so before should translate into

    http://test.com/ABC

    http://test.com/BCD

    http://test.com/FFF

    http:// test2.com/a

    create table soqs2)

    URL varchar2 (50)

    );

    insert into soqs2 values ('http://test.com/abc/ghgh.html');

    insert into soqs2 values ('http://test.com/bcd/');

    insert into soqs2 values ('http://test.com/fff/default.aspx');

    insert into soqs2 values ('http:// test2.com/a "");

    SQL and PL/SQL are the same forum...

    Check my last response to your original thread select prior to last character /

  • To remove the last "/" character

    I need to remove ' / ' character and string comes after him. I'll give an example.

    CREATE TABLE TAB (COL1 VARCHAR2 (50));

    INSERT INTO VALUES TAB ("IHA/SS/TTTT/FFFF');

    INSERT INTO TAB VALUES (' hDFF/AA/S/AAAAAAAA");

    I would remove the last "/" and chain comes after him then when I ask, I should get the result that

    IHA/SS/TTTT
    hDFF/AA/S

    Please help me
    with testdata as (
      select 'hDFF/AA/S/AAAAAAAA' s from dual union all
      select 'hIA/SS/TTTT/FFFF'     from dual
    )
    
    select
     substr( s
            ,1
            ,instr(s, '/', -1) - 1
     ) r
    from testdata        
    
    R
    hDFF/AA/S
    hIA/SS/TTTT
    
  • the last character to jump printjoins

    My version of oracle is 10.2.0.4.0. I defined the special characters in the printjoins. Therefore, special characters are now stored in the chips, but this isn't the last special character.
    Steps to reproduce:
    create table mywords
    (text varchar2(200));
    insert into mywords values ('HELLO P.L.C.');
    insert into mywords values ('WORLD H.M.');
    -- I define lexer as follows: 
    BEGIN
       --ctx_ddl.DROP_PREFERENCE('my_lexer');
       ctx_ddl.create_preference('my_lexer','BASIC_LEXER');
       ctx_ddl.set_attribute('my_lexer','printjoins','-_~!@#$%^&*(){}[]=?\;><.+');
    END;
    /  
    CREATE INDEX MYWORDS_CTX ON mywords(text) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS ('lexer my_lexer SYNC(ON COMMIT)');
    Now I'm waiting for the symbolic text to store P.L.C. and H.M. but it only stores P.L.C & hadil
    I won't be able to define the join end as '.' because it is already defined in print join.
    sql> SELECT TOKEN_TEXT FROM DR$MYWORDS_CTX$I WHERE TOKEN_TEXT LIKE 'H.%' or TOKEN_TEXT LIKE 'P.L.%';
    TOKEN_TEXT
    ----------------------------------------------------------------
    P.L.C
    H.M
    All the solutions to store the last special character also?
    Thanks for your time.

    The period is a sign of punctuation by default, as well as the question mark and exclamation mark. When you have the period as a printjoin and a punctuation, punctuation is a priority. Although the last period will not be part of your token, it won't affect your research. You can reset your punctuation to just the question mark and exclamation mark, without the period and which will cause the last period to include in the token, but it will be another problem. If you do this, then once you are looking for the last word of a sentence before a period, you will need to include this period or you won't find it. Please see the demo below shows first what you have with the research work as planned, and then removes the punctuation period, so that the last period is included in the token, but then a search for the last word in a sentence without a period is not found. Thus, it is best to leave things as they are.

    SCOTT@orcl_11gR2> create table mywords
      2    (text varchar2 (200))
      3  /
    
    Table created.
    
    SCOTT@orcl_11gR2> insert into mywords values ('HELLO P.L.C.')
      2  /
    
    1 row created.
    
    SCOTT@orcl_11gR2> insert into mywords values ('WORLD H.M.')
      2  /
    
    1 row created.
    
    SCOTT@orcl_11gR2> insert into mywords values ('This is a test.')
      2  /
    
    1 row created.
    
    SCOTT@orcl_11gR2> BEGIN
      2       ctx_ddl.create_preference
      3         ('my_lexer',
      4          'BASIC_LEXER');
      5       ctx_ddl.set_attribute
      6         ('my_lexer',
      7          'printjoins',
      8          '-_~!@#$%^&*(){}[]=?\;><.+');
      9  END;
     10  /
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> CREATE INDEX MYWORDS_CTX
      2  ON mywords (text)
      3  INDEXTYPE IS CTXSYS.CONTEXT
      4  PARAMETERS
      5    ('lexer        my_lexer
      6        SYNC        (ON COMMIT)
      7        STOPLIST  CTXSYS.EMPTY_STOPLIST')
      8  /
    
    Index created.
    
    SCOTT@orcl_11gR2> SELECT TOKEN_TEXT
      2  FROM   DR$MYWORDS_CTX$I
      3  /
    
    TOKEN_TEXT
    ----------------------------------------------------------------
    A
    H.M
    HELLO
    IS
    P.L.C
    TEST
    THIS
    WORLD
    
    8 rows selected.
    
    SCOTT@orcl_11gR2> SELECT * FROM mywords
      2  WHERE  CONTAINS (text, 'P.L.C.') > 0
      3  /
    
    TEXT
    --------------------------------------------------------------------------------
    HELLO P.L.C.
    
    1 row selected.
    
    SCOTT@orcl_11gR2> SELECT * FROM mywords
      2  WHERE  CONTAINS (text, 'H.M.') > 0
      3  /
    
    TEXT
    --------------------------------------------------------------------------------
    WORLD H.M.
    
    1 row selected.
    
    SCOTT@orcl_11gR2> SELECT * FROM mywords
      2  WHERE  CONTAINS (text, 'test') > 0
      3  /
    
    TEXT
    --------------------------------------------------------------------------------
    This is a test.
    
    1 row selected.
    
    SCOTT@orcl_11gR2> DROP INDEX mywords_ctx
      2  /
    
    Index dropped.
    
    SCOTT@orcl_11gR2> BEGIN
      2    CTX_DDL.SET_ATTRIBUTE
      3        ('my_lexer',
      4         'punctuations',
      5         '?!');
      6  END;
      7  /
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> CREATE INDEX MYWORDS_CTX
      2  ON mywords (text)
      3  INDEXTYPE IS CTXSYS.CONTEXT
      4  PARAMETERS
      5    ('lexer        my_lexer
      6        SYNC        (ON COMMIT)
      7        STOPLIST  CTXSYS.EMPTY_STOPLIST')
      8  /
    
    Index created.
    
    SCOTT@orcl_11gR2> SELECT TOKEN_TEXT
      2  FROM   DR$MYWORDS_CTX$I
      3  /
    
    TOKEN_TEXT
    ----------------------------------------------------------------
    A
    H.M.
    HELLO
    IS
    P.L.C.
    TEST.
    THIS
    WORLD
    
    8 rows selected.
    
    SCOTT@orcl_11gR2> SELECT * FROM mywords
      2  WHERE  CONTAINS (text, 'P.L.C.') > 0
      3  /
    
    TEXT
    --------------------------------------------------------------------------------
    HELLO P.L.C.
    
    1 row selected.
    
    SCOTT@orcl_11gR2> SELECT * FROM mywords
      2  WHERE  CONTAINS (text, 'H.M.') > 0
      3  /
    
    TEXT
    --------------------------------------------------------------------------------
    WORLD H.M.
    
    1 row selected.
    
    SCOTT@orcl_11gR2> SELECT * FROM mywords
      2  WHERE  CONTAINS (text, 'test') > 0
      3  /
    
    no rows selected
    
    SCOTT@orcl_11gR2> 
    
  • CSS to force the last character of a paragraph to align differently?

    I have a CSS problem. Let's say I have a paragraphy of 450 pixels wide, text - align left (default). The last line of the paragraph ends at a place which is about three quarters of the total paragraph width. Now, I want to add a span encompassing a last character that is a different color than the text of the previous paragraph and also positions on the side over to the right of the 450 pixels.

    I tried two things that did not work. One was text-align: right and the other was including a couple of spaces before the final character and using tracking to lie, he. Absolutely no effect during each test.

    Help?

    HealthcareHelper wrote:

    Osgood, I just tried your first suggestion and it works! I might have to play with him, because he did exactly as said: go to the right side complete paragraph width and none of the text is going well. It looks like a little isolated.

    I assumed the description you gave in your original post you wanted that he isolated on the far right of the container?

    HealthcareHelper wrote:

    is there a particular reason that offers on a simple float, or was it based on your experience?

    Floating of the seemed to be the logical way to go (I guess on the basis of experience) BUT if you notice that the character is not on the same line as the last line of the point. If this isn't a problem, then it is a possible soultion to consider using.

    HealthcareHelper wrote:

    In addition, was the possible problem of browsers with the second suggestion because of the limited for inline-block support?

    No, inline-block is supported in all browsers I know. I was just being cautious as I had not tested under IE. However this solution with the character on the same line as the last line of the paragraph, I provided it as an alternative.

  • Special character is the last character.

    Hi all, I am under Oracle 11 g and I am relying on the Oracle text. I understand how to use printjoins and how interrogate via "contains". I can successfully query for a period and get the desired result, if the period is integrated chain mid: for example) "john.paul.jones". However, when a deadline is the last characters: for example) "john.paul.jones." I can't get the query to return the desired folder. I looked in the I$ table and did not find the token "john.paul.jones.", what was there was 'john.paul.jones '. It seems that Oracle Text has not persisted to the chain with the Terminal period? Any help would be greatly appreciated.

    L

    Look at the punctuation of the lexer attribute in the text of reference [http://download.oracle.com/docs/cd/B28359_01/text.111/b28304/cdatadic.htm#CCREF0218].
    If the global nature of your collection of texts is not ordinary worth, then you can delete periods as a punctuation character - in other words, if your collection of text is something like e-mail addresses, where periods do not mean what they mean usually.
    If your collection is mainly regular penalties, and you don't want the period to include part of the token in the majority of cases, you will probably have to think in terms of processing of user input - that is to say, something like removing the end point of the input search to match what the php code Analyzer is plain text.

  • delete the last character of line break

    How can I remove the newline character from the end of a string? (Note: there are several line break characters in the string). Thank you!

    This may or may not work, but it is worth it.

    If (right (Votrechaine, 1) is 10)
    Votrechaine = left (Votrechaine, 1, len (yourstring)-1);

Maybe you are looking for