BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-14-2008, 07:52 PM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Location: montreal
Model: 8100
PIN: N/A
Carrier: rogers
Posts: 70
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Why can't I enter data in a RichTextField?

Please Login to Remove!

I set up my screen with a grid of one horizontalfieldmanager and four verticalfieldmanagers. The first column contains checkboxfields and the rest contain richtextfields using this statement:

myArray[i] = new RichTextField("0", RichTextField.TEXT_ALIGN_HCENTER | RichTextField.EDITABLE);

As you can see, I did use the editable style. I tried removing the array variable and use a normal one and still no edit capabilty. The checkboxfields in the first column work fine.

The verticalfieldmanager is as follows:

Code:
       column2 = new VerticalFieldManager()
        {
            int cellWidth = 50;

            protected void sublayout(int maxWidth, int maxHeight)
                {
                    super.sublayout(cellWidth, maxHeight);
                    setExtent(cellWidth, getExtent().height);
                }

            public int getPreferredWidth()
                {
                    return cellWidth;
                }

           public void subpaint(Graphics graphics)
                {
                    graphics.setBackgroundColor(Color.AQUAMARINE);
                    graphics.clear();
                    super.subpaint(graphics);
                }
        };


Anyone have an idea what could be preventing this? Does it have something to do with my vfm?

Thanks
Offline  
Old 08-15-2008, 12:38 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Apr 2005
Model: 950
Carrier: T-Mobile
Posts: 185
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think RichTextField is only for display.
Offline  
Old 08-15-2008, 07:41 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Location: montreal
Model: 8100
PIN: N/A
Carrier: rogers
Posts: 70
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jonberry View Post
I think RichTextField is only for display.
I read somewhere that setting the EDITABLE style enables data entry. I'm using RichTextField because I wanted to center it in the column or right-justify it.

I guess I'm SOL if you're right since any other field won't let you do this.
Offline  
Old 08-15-2008, 08:09 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2008
Model: 8300
PIN: N/A
Carrier: O2
Posts: 17
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you tried FIELD_HCENTER and FIELD_RIGHT style to get centre and right justification on a BasicEditField? Unless the RTF does something else you want that BEFs don't, never used an RTF so I don't know.
Offline  
Old 08-15-2008, 08:30 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Location: montreal
Model: 8100
PIN: N/A
Carrier: rogers
Posts: 70
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by ilh3- View Post
Have you tried FIELD_HCENTER and FIELD_RIGHT style to get centre and right justification on a BasicEditField? Unless the RTF does something else you want that BEFs don't, never used an RTF so I don't know.
No, those don't work. RTF has the TEXT_ALIGN_HCENTER which seems to be the only style that aligns properly. My only goal is to center the input field so if I can get BEF to work that'll be OK.

Here's how I used BEF:

myArray[i] = new BaiscEditField("", "0", 3, BasicEditField.FIELD_RIGHT);

The result is "0" is placed at the left edge of my VFM.
Offline  
Old 08-16-2008, 12:42 PM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Apr 2005
Model: 950
Carrier: T-Mobile
Posts: 185
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can you center the VFM?
Offline  
Old 08-20-2008, 08:25 AM   #7 (permalink)
Thumbs Must Hurt
 
Join Date: Apr 2007
Location: Cincinnati, OH
Model: 8700c
PIN: N/A
Carrier: Cingular
Posts: 87
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi dynot,

I don't know if this will help or not, but another member of this forum (JFisher) built a custom field and shows the code on his web site:

Wikipedia Application for BlackBerry

I don't remember exactly how the code works since it's been a while since I tried it, but when I tried his code last time, I believe that it did indeed center the input text in the text field. (Even though the picture on the web site shows it left aligned).

Maybe something worth looking at, if you have the time to create a custom field.

Best of luck.

P.S. My condolences. It is frustrating that the functionality for such a simple thing like right or center aligning text in an input field isn't there or doesn't work.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.