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

Java Development

Reply
Developer
zaratustraelimp
Posts: 171
Registered: ‎03-04-2009
My Device: Not Specified
Accepted Solution

anything similar to FocusChangedListener???

Hi, I have a problem. In my application I am trying to do that when I click a button on my screen load certain values in a LabelField​​. I've tried to do with the FocusChangedListener, but these changes only occur when changing the focus, is there anything that changes occur when I press the button? sorry for my poor English

Please use plain text.
Developer
simon_hain
Posts: 15,870
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: anything similar to FocusChangedListener???

http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/ui/FieldChangeListener.html
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
zaratustraelimp
Posts: 171
Registered: ‎03-04-2009
My Device: Not Specified

Re: anything similar to FocusChangedListener???

I've tried FielChangeListener and does not work, this is my code:

 

...

ayudaButton = new BitmapButtonField(iconoPlayFocus, iconoPlayUnfocus);

//      ayudaButton.setFocusListener(this);
        ayudaButton.setChangeListener(this);


.....

 

public void fieldChanged(Field field, int eventType) {
        
        if(field != ayudaButton){
               return;
        }
        
        clienteInput.setText(controller.getClienteActual().getId());
        nombreInput.setText(controller.getClienteActual().getNombre());

 

}

Please use plain text.
Developer
simon_hain
Posts: 15,870
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: anything similar to FocusChangedListener???

you have to trigger the fieldchanged event manually most likly, as the BitmapButtonField class does not do it.
classic approach is to overwrite keyChar(enter key) and navigationclick.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
tommy20
Posts: 249
Registered: ‎05-18-2011
My Device: Curve 9300, BB10 Dev Alpha C, Z10

Re: anything similar to FocusChangedListener???

If you are using the BitmapButtonField class from RIM Advanced UI Samples, then you would use this:

ayudaButton = new BitmapButtonField(iconoPlayFocus, iconoPlayUnfocus){
public void clickButton() {
clienteInput.setText(controller.getClienteActual().getId());
nombreInput.setText(controller.getClienteActual().getNombre());
}
};

 

--tom
Please use plain text.
Developer
zaratustraelimp
Posts: 171
Registered: ‎03-04-2009
My Device: Not Specified

Re: anything similar to FocusChangedListener???

The problem is that in the initial screen, there is a object with anythingvalues ​​and if you click on the BitmatButtonField, we go to another screen and updates the value of the object, and I want to do this, regenerate or paint it screen again with updated data object, is it possible??

Please use plain text.
Developer
zaratustraelimp
Posts: 171
Registered: ‎03-04-2009
My Device: Not Specified

Re: anything similar to FocusChangedListener???

Finally I added an element in a common class to all screens (class controller) to solve.

Please use plain text.