Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7783711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:55:05+00:00 2026-06-01T19:55:05+00:00

I am using following code for a listing. I have used RichTextField for items

  • 0

I am using following code for a listing. I have used RichTextField for items of list.

public class ListScreen extends MainScreen {

    private UiApplication application;
    private VerticalFieldManager listManager;

    /**
     * 
     */
    public ListScreen() {
        super(NO_VERTICAL_SCROLL | NO_HORIZONTAL_SCROLL | USE_ALL_HEIGHT
                | USE_ALL_WIDTH);
        // TODO Auto-generated constructor stub

        this.application = UiApplication.getUiApplication();

        LabelField screenHeading = new LabelField("Category",
                FIELD_HCENTER) {
            protected void paint(net.rim.device.api.ui.Graphics g) {
                g.setColor(Color.WHITE);
                super.paint(g);
            }
        };
        final VerticalFieldManager labelMngr = new VerticalFieldManager(USE_ALL_WIDTH);
        labelMngr.setBackground(BackgroundFactory
                .createBitmapBackground(LangValue.labelbg));
        labelMngr.add(screenHeading);
        labelMngr.setPadding(5, 0, 5, 0);
        add(labelMngr);

        try {

            listManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL
                    | Manager.VERTICAL_SCROLLBAR) {

                protected void sublayout(int maxWidth, int maxHeight) {
                    int width = Display.getWidth();
                    int height = Display.getHeight()
                            - labelMngr.getHeight();

                    super.sublayout(width, height);
                    setExtent(width, height);
                }
            };

            listManager.setPadding(5, 0, 5, 0);

            int i=0;
            RichTextField rtf;
            Background background = BackgroundFactory
                    .createSolidBackground(Color.WHITE);
            Border border = BorderFactory.createSimpleBorder(new XYEdges(0, 0,
                    2, 0));

            CategoryHelper categoryHelper = new CategoryHelper();
            final String[][] cetegoryList = categoryHelper.getCategoryList();
            for(; i < cetegoryList.length ; i++) {

                rtf = new RichTextField(cetegoryList[i][1], Field.FOCUSABLE) {
                    protected boolean navigationClick(int status, int time) {

                        fieldChangeNotify(1);

                        return true;
                    }

                    protected boolean touchEvent(
                            net.rim.device.api.ui.TouchEvent message) {
                        if (TouchEvent.CLICK == message.getEvent()) {
                            FieldChangeListener listener = getChangeListener();
                            if (null != listener)
                                listener.fieldChanged(this, 1);
                        }
                        return super.touchEvent(message);
                    }

                };
                rtf.setBackground(Field.VISUAL_STATE_NORMAL, background);
                rtf.setBorder(border);
                rtf.setPadding(1, 2, 1, 3);
                rtf.setCookie(new Category(Integer.parseInt(cetegoryList[i][0]),cetegoryList[i][1]));
                rtf.setChangeListener(new FieldChangeListener() {
                    public void fieldChanged(Field field, int context) {
                        // Dialog.alert("play the video");
                        // System.out.print("play the video");
                        // code for play video
                    }
                });
                listManager.add(rtf);
            }
            if (i == 0) {
                listManager.add(new RichTextField("No word found."));
            }

            add(listManager);

        } catch (Exception e) {
            System.out.println(e.getMessage());
            e.printStackTrace();
        }
    }    

}

It is working fine for simulator. I can scroll the list and can set the focus on any item by scrolling and focused item get blue mark. But when I am testing BB device, the item is focused, but the focused state is not visible and unchanged in color which means the user cannot identify which one is focused. What is problem in my code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:55:07+00:00Added an answer on June 1, 2026 at 7:55 pm

    I have added the following code in anonymous class of RichTextField.

    protected void onFocus(int direction){
            super.onFocus(direction);
            this.setBackground(BackgroundFactory.createSolidBackground(0x001865D6));
            invalidate();
        }
    
        protected void onUnfocus(){
            super.onUnfocus();
            this.setBackground(BackgroundFactory.createSolidBackground(Color.WHITE));
            invalidate();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following class ( entity ) @Entity public class Magazine { private int
Using following code I try to get updated list of checkbuttons' corresponding text values,
I have the following controller and view. It is listing the values correctly using
I using following code: var search = 'test'; if ($('#sku').find(search) ){ //alert(search); $(document).find(search).css('color','red'); <TABLE>
I am using following code in rowdatabound function. Protected Sub gvwMileStone_RowDataBound(ByVal sender As System.Object,
I am using following code to check whether a check box on my website
I am using following code to design my home page. The output (as shown
I'm using following code but cannot return data from MySQL. This is the output:
I am using following code to create new wifi access point and to connect
i am using following code. <RelativeLayout android:layout_width=310dp android:layout_height=70dp android:layout_below=@+id/UIReportView android:layout_marginLeft=4dp android:layout_marginTop=2dp android:background=@drawable/small_corners > small_corners

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.