Part of the cursor remains in the custom field

Hello, guys!

I have a problem.

In the custom field that extends EditField, I want to draw in the text and the image and draw an appropriate in the cursor position. Then, we thought it would only calculate in advance of the police and the width of the image in the paint method to display the text and image and to the similar development and I tried. However, the cursor drawing is wrong. When the cursor moves from right to left, a part of the slider to the position immediately before the rest.

Y at - it a good solution?

JDE component package: 4.6.0

I solved by myself.

'FocusChangeListener' is mounted with EditField. And "invalidate()" has been called in the method "focusChanged().

It became a great result for me.

Thank you.

Tags: BlackBerry Developers

Similar Questions

  • Question regarding setExtent and getPreferredWidth for the custom field

    I am trying to understand the difference between getPreferredWidth and setExtent, which relate to the width of a custom field.

    I create a field that may be greater than the width of the screen. The field is made up of cells (for example columns and lines or cells, such as a table). The cells contain text, shapes, lines, color, etc. When I display the field I only paint the visible columns on the screen and allow the user to use the trackball to accomplish the columns out of the screen.

    At present, getPreferredWidth returns the total width of the field without all the empty columns, is longer than the width of the screen. I use the same value in setExtent for width. GetPreferredWidth must return the size of the field that is painted on the screen - the total width less the width of the columns out of the screen? I have the same question about setExtent - width either in total, longer than the screen width or the width of the part of the field that is painted on the screen?

    If I use the width of what is painted on the screen or the other of these methods, then the width changes when the user scrolls through the field. As the user scrolls, I calculate the number of columns will agree to a width of the screen and paint these columns. Is it a problem to have the PreferredWidth and the setExtent change width? I read that setExtent is called only when the Manager sets this field, so that the changes will not be recognized.

    It seems to work in two ways in a few simple tests, but I was just curious as the value of width that is right.

    Thank you!

    Mark

    When a field has changed in a way that requires the update of the screen (for example, after scrolling offset changes), simply call invalidate() from this area. That will eventually lead to paint (Graphics) for the field. At this point, you return the update field. (If only part of a field - as a single cell - needs to be updated, there invalidate() versions that accept arguments where, for efficiency, you can limit the update for just this part.)

    If I understand your needs, you can achieve the effect desired in the paint method. You can use the current dimensions of the field, the cutting of the graphics area, and your internal roll compensates to decide what to paint and what to delete. Let your custom field leave white space where you decide of doesn't make is not part of a cell. There is no need to change the scope of the field.

    If you go about it by changing the dimensions of the field, and then you ask the system to play much more work he has to do. If the custom field is the only field on the screen, it won't make much difference in the behavior (although there may be performance). With more than one field, it can be weird effects. For example, suppose that your custom field is one of several fields in a HorizontalFieldManager and you change the field width. When the HorizontalFieldManager recalculates its own layout, it will change the horizontal position of the fields to the right. The effect on the user, I think, would be really confusing: as the custom field parade, parties to the right of the screen could bounce left and right as the changed width field. I can't imagine that's what you want.

    Here's another way to think about this: absent some bit of style, your custom field would prefer be exactly wide and high enough to show all without scrolling. So the width and height would be based on adding the appropriate cell widths and heights, regardless of what actually is on the display. (It's also a long time that you do not have something fanciful.) If the optimum height is a function of the width available - as with sheathed on the line of text - you would implement this logic in the layout method. You then have no use for autonomous preferred width and height).

  • Two sliders in the custom field definition

    Hi guys,.

    First of all, I want to thank all those who helped me to this day. This forum has been essential for blackberry dev work I do, and I would be screwed without you guys. That being said, I'm having a problem. I install a custom like this text entry field.

    (1) creates a vertical field Manager, assigned a background and resized image with setExtent(). (works fine)

    (2) created a new type of field and inserted in the vertical field Manager to make native look (almost works)

    The problem I have is that two sliders are appearing. Cursor #2 is dynamically updated as it should be, but the #1 cursor seems to be a "flawed slider. Please see the image below for details.

    The custom field is defined using the following code. If I remove the custom field, or cursors comes, so I am positive that it is the source of the problem.

        public class JustifiedEditField extends HorizontalFieldManager implements FieldChangeListener {
            BasicEditField ef;
    
            public JustifiedEditField(long style) {
                super(USE_ALL_WIDTH);
                ef = new BasicEditField(style) {
    
                    protected void onDisplay() {
                        setPosition(10, 17);
                        update(0);
                        //invalidate();
                    }
    
                    protected void update(int d) {
                        super.update(d);
                        setPosition(10, 17);
                        //invalidate();
                    }
    
                    protected void paint(Graphics graphics) {
                        graphics.setColor(Color.WHITE);
                        getFocusRect(new XYRect());
                        drawFocus(graphics, true);
                        super.paint(graphics);
                    }
    
                    protected void onUnfocus() {
                        invalidate();
                    }
    
                    protected void onFocus(int direction) {
                        invalidate();
                    }
    
                    /**
                     * Intercepts ESCAPE key.
                     * @see net.rim.device.api.ui.component.TextField#keyChar(char,int,int)
                     */
                    protected boolean keyChar(char ch, int status, int time) {
                        switch(ch) {
                            case Characters.ESCAPE:
                                // Clear keyword.
                                if(super.getTextLength() > 0)
                                {
                                    setText("");
                                    return true;
                                }
                        }
                        return super.keyChar(ch, status, time);
                    }
                };
                add(ef);
            }
    
            protected void sublayout(int width, int height) {
                super.sublayout(width, height);
                setExtent(width, 57);
            }
    
            public BasicEditField getEditField() {
                return ef;
            }
    
            public String getText() {
                return ef.getText();
            }
    
            public void setText(String value) {
                ef.setText(value);
                invalidate();
            }
    
            public void setChangeListener(FieldChangeListener changer ){
                ef.setChangeListener(changer);
            }
    
            public void fieldChanged(Field field, int context) {
                invalidate();
            }
        }
    

    I am totally stuck on this issue, any help would be really appreciated. TIA!

    I came up with an alternative solution. It turns out that I can use a transparent border to set the offsets to where the edit field must be located within the input Manager; thus eliminating the need to use setPosition.

  • How long does it take for the custom field created in SFDC appears in the list of field mapping?

    How long does it take for the custom field created in SFDC appears in the list of field mapping? I hit the refresh field button, but it does not appear after 5 min. I just need to have patience?

    I had the same problem yesterday, I think it took about 10-15 minutes to appear.

  • All of a sudden received part of the customer as winmail.dat

    Suddenly, over the last week, I can't open attachments to my client. It is a big problem for me.

    Send invitations now arrive as winmail.dat attachments so I have to write and ask the customer to send me the information manually (not good).

    Today she sent a blast e-mail formatted with graphics for the replay. I can't open it.

    I downloaded of TNEF enough on the App Store. It's that open its cover note, I can already read email. He does not even recognize that there is an attachment in email.

    I downloaded Winmail Reader Pro from the App Store. Again, he opens his cover note, that I can already read email. It also recognizes a second document, but when I open it, it is simply a code page (which is the breath of email I'm supposed to do to reread).

    I have several projects per month with this customer and be invited to many meetings. As a freelancer, I'm proud of myself by taking things OUT of my client, not adding task list does not. I talked to technical support to his company and they say it's due to the incompatibility with the e-mail and calendar PC and Mac programs. On the Internet, I see that it is caused by a lack of willingness to Apple to integrate a simple fix in the Mail for Mac program. I really don't like making it, I just need to find a solution.

    Has anyone found a reliable application that opens the Winmail.dat file?

    Who is your email provider? Have you tried to check the email directly on the web portal? (for example going to mail.yahoo.com if Yahoo! e-mail)

  • How can I display the custom field in Office Communicator so that everyone can see?

    In OCS, on your personal page, there is an option for the current location - create the custom location, I want to display the "custom" location instead of the busy, can someone help on how it works?

    Hello PK,.

    This forum is the right forum for this type of question:
  • Background color of the custom field

    Hello

    I create a custom field that is as shown in the attached display a bar graph.

    I don't want to change the background color of the field of another color. I tried to overridding method paintBackground of the field as shown below:

    protected void paintBackground(Graphics arg0) {
            arg0.setColor(Color.DARKGRAY);
            super.paintBackground(arg0);
        }
    

    but it seems to have no effect. Could someone kindly help me with this. Thanks in advance.

    Kind regards

    S.A.Norton Stanley

    Try this...

    Create a class that extends the scope and implements DrawStyle

    and override its Paint method... to set the background color

    Draw the shape you want with the graphics object and either fill the area or set the background color.

    THX

    Rabi Ray

  • Drawing Bitmap on the custom field

    If I have a custom component that extends the scope I am able to draw Bitmap on it?

    I try to shoot in object overrided method in this way.

     protected void paint(Graphics g)    {         Bitmap = Bitmap.getBitmapResource("test.bmp");        if(picture != null)            g.drawBitmap(getPreferredWidth()+5,                          getPreferredHeight() + 5,                          picture.getWidth(),                          picture.getHeight(),                         picture,                          0,                          0);
    
        }
    

    But no picture on my component.  Specified test.bmp exists as a resource and object Bitmap appears correctly. No exceptions occur.

    Any comments? Maybe it's impossible to draw a bitmap on component expanded in such a way?

    Thanks in advance.

    Thanks for your suggestion. The problem wasn't in extention but in the region of destination, top and left. X and there were calculated with respect to the top and left of the main screen instead of top and left of the custom my field.

    Your message dropped a hint on how to survey. Thank you very much!

  • typed letters are not visible after the end of the custom field in editfield

    class CustomEditField extends EditField {}

    CustomEditField (String text) {}

    Super("",Text);

    }

    public void layout (int width, int height) {}

    Super.Layout (getPreferredWidth (), getPreferredHeight ());

    setExtent (getPreferredWidth (), getPreferredHeight ());

    }

    public int getPreferredHeight() {}

    Return super.getPreferredHeight ();

    }

    public int getPreferredWidth() {}

    return (Display.getWidth () * 2/3);

    }

    }

    It's my edit custom field.

    When I type on this field and reached end of the field, can't see the letters after that, but I can type (the only thing is to type letters are not visible after the end of the field)

    What is the solution

    I'm sure that you must explicitly enable scrolling. See Manager javadocs.

    In addition, you limit the scope of your field, which may also fail to scroll.

  • Create the custom field on vm creation

    Hi all!

    Does anyone know if there is a way to create a custom field in each new virtual machine with the news of creation (Date/time and user)? I was thinking about a trigger in the vCenter but still lost in this...

    See Alan poster called runs a scheduled job PowerCLI

  • How to set the custom fields in the form submission email?

    Here's what I mean...

    Here is a screenshot of the form online for my client. Most of these fields are "custom".

    Screen Shot 2015-02-27 at 9.41.50 AM.png

    Here's an email from test of what the email looks like when it come in.

    Screen Shot 2015-02-27 at 9.41.25 AM.png

    As you can see all my custom fields list as just that, custom.

    When a patient fills this out it is difficult to say what it applies to that.

    How do I change these fields that say "customized" to say what really is the field?

    Hello

    It appears that you have disabled the 'label' for each custom field.

    Please select the field and go voluntarily, as shown in the screenshot.

    Please check the 'label' > shoe, this will be you the label to the form field as "Custom", rename it according to your requirement and disable the label again.

    Re-upload the site and you should be all set.

    Concerning

    Vivek

  • PowerCLI script retrieve vmname based on the value of the custom field

    I want to retrieve a set of virtual machine based on a custom attribute names.  I have a custom field called alert level and I want to list only servers with an alert level of 4 so that I can automatically turn them off during a power failure.

    That's what I have so far:

    Get - VM | Select Name -ExpandProperty CustomFields | {$_.key -eq "Alert Level"} | {$_.value -eq 4}

    This seems to me the namem, field and value but all I want is the name.

    Any ideas?

    Try this

    Get - VM | where {$_.} {CustomFields ["warning level" ""]- eq 4} | Select the name of


  • Automate snapshots based on the custom field

    I am a newbie to scripting and can't creating a Powershell script that will automatically create snapsht based on a custom attribute that is specified on the virtual computer. I got so far:

    Get - VM | Select the custom name fields - ExpandProperty | Where {$_.value - eq "takesnapshot"} | Select name

    This gives me a list of virtual machine names that have the specified "takesnapshot" custom field, however, I don't know how to use the output with the Get - VM | New snapshot command to create a new snapshot. Any help would be appreciated.

    OK, the key is "Ministry" and the value is "instant".

    With the attached line, you should get in the market.

    Your test had a few typos: it should be $_ and you should leave out the test to white before the brackets.

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Displacement of the custom fields of one vCenter to another

    Hello

    I need to move my vcenter (or all esx hosts) of my new vsphere vcenter. I connect just 3.5 esx host for my new vcenter.

    as for this nice guide iam able to move old vcenter custom fields to my vcenter vsphere using export-csv.

    http://www.virtu-al.NET/2009/05/29/PowerCLI-on-steroids-custom-attributes/

    -


    Snip-


    Snip
    Snip

    Snip
    -.

    1. The export of all the attributes that have been customized in a CSV (backup)

    $list = @)

    $vmArray.GetEnumerator () | %{

    $vmName = $_. Name

    $_. Value.Custom.getenumerator () | %{

    $row = New-Object psobject

    $row | Add-Member - memberType noteproperty-name VmName-value $vmName

    $row | Add-Member - memberType noteproperty-name NomAC-value $customKeyLookup [http://$_.Name|http://$_.Name]

    $row | Add-Member - memberType noteproperty-name CAValue-value of $_. Value

    $list = $row

    }

    }

    $liste | Export-Csv "C:\CA-backup.csv" - noTypeInformation

    -


    Snip-


    Snip
    Snip

    Snip

    Snip
    -.

    so I connect vi PowerCli to my old vcenter 'connect-viserver' and export all of the CF, "reconnect" all the esx 3.5 to my vsphere vcenter server, connect to my new vcenter and import them accordingly:

    -


    Snip-


    Snip
    Snip

    Snip

    Snip
    -.

    1. Import all custom from a CSV (restore) file attributes

    Import-Csv "C:\CA-backup.csv" | %{

    $vmArray [http://$_.VmName|http://$_.VmName]. Object.setCustomValue ($_.) NomAC, $_. CAValue( )

    }

    -


    Snip-


    Snip
    Snip

    Snip

    Snip
    -.

    I can't run this code as a script itself snippets and my PS skills are limited, so here's my Question: could someone help me to get started?

    I guess I need to plug my vCenter first... as "Connect-VIServer vcserver.

    your help is very appreciated. Thank you

    rgrds uxmax

    Hi, thanks for the link

    Yes, you will need to connect to your server of VI using the cmdlet connect-viserver, something like this should do:

    to connect-viserver MYVISERVER

    Or if you need to move from other credentails as the account that you are using this as a use:

    SE connect-viserver MYVISERVER-user "myuser" - pass "myP@ssword"

    Once you have done this, you can run the export and then use the same cmdlet to connect to the other server of VI before importing the details.

    I hope this helps.  As a no, I also activated on my blog comments, it's a good way for everyone to see, too, how solve us problems.

    If you found this information useful, please consider the allocation of points for correct or helpful.

    Alan Renouf

    http://Virtu-al.NET

  • Adding to the custom field hyperlink _blank

    Hello

    I set up a custom field type = LIEN_HYPERTEXTE, this load an anchored in my text. By clicking on this hyperlink opens a new window of the browser as with target = _blank. I can add this property to the tag somehow, like {tag_customfield, _blank} or something?

    Best regards, Dennis

    Nope. You can do it with javascript or a text field and create your own link.

Maybe you are looking for