Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry® World™ Development

Reply
Trusted Contributor
Posts: 242
Registered: ‎03-16-2010
My Device: 9530

Problem with CustomLabelField

 

Hello,

 

   I wanted a button without any spacing or border. I created a customLabelField, which handles fieldChanged event (which I want to). The problem is once I click the label, dialog appears whereever I click. On adding setMuddy, setDirt to false, now I am not able to click on any other component, not even the button that washandled so far. The code is :

// In Main Screen class
        arwLbl = new ArrowLabel();
        arwLbl.setChangeListener(this);
    public void fieldChanged(Field f, int context) {
       if (f == closeBtn) {
               system.exit(0);
         } else if (f == arwLbl) {
            Dialog.alert("Arrow Lable clicked");
            arwLbl.setDirty(false);
            arwLbl.setMuddy(false);                   
        }
    }

    class ArrowLabel extends LabelField {
        private Font lblFont;
        public ArrowLabel() {
            super(">", Field.FOCUSABLE);
            lblFont = getFont().derive(Font.UNDERLINED, 14);
            setFont(lblFont);            
        }
        
        protected boolean navigationClick(int status, int time)
        {
            fieldChangeNotify(1);
            return true;
        }
        
        protected void onFocus(int direction) {
            setFont(getFont().derive(Font.BOLD));
        }
        
        protected void onUnfocus() {
            setFont(lblFont);
            setMuddy(false);
        }
    }   // End of class ArrowLabel

 

  Can anyone tell what is wrong and how to correct it. I want a field or button (without border or spacing), it should be able to catch click events / fieldChanged.

 

I need to figure out asap.

 

Thanks.


--------------------------------------------------------------------------------
For any helpful answers give kudo's (star) to the helper.
Trusted Contributor
Posts: 242
Registered: ‎03-16-2010
My Device: 9530

Re: Problem with CustomLabelField

 

OOPS again I ahve added in wrong forum. If you can help me, kindly add your reply at

http://supportforums.blackberry.com/t5/Java-Development/Problem-with-CustomLabelField/td-p/468946

 

Thanks & Sorry


--------------------------------------------------------------------------------
For any helpful answers give kudo's (star) to the helper.