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
Regular Contributor
juszczec2
Posts: 59
Registered: ‎05-10-2012
My Device: 8800
My Carrier: verizon

changing Field context menu after drawing screen

Hello all

 

I've got a VerticalFileManager into which I'm adding a bunch of TextFields.

 

I am overriding the TextFields' default context menu and replacing it with one of my own creation.

 

Before I add the the TextField to the VerticalFileManager, I also add it to a Vector.  What I'd like to do is go thru the Vector,  grab each TextField, modify its context menu again (replace the existing context menu item with a new context menu) and cause the TextFields with the new context menu to be displayed.

Is this even possible?  Do I have to delete all the TextFields and re-add them?

 

Mark

Please use plain text.
Developer
moniko17
Posts: 216
Registered: ‎08-23-2012
My Device: Javelin 8900
My Carrier: Axis

Re: changing Field context menu after drawing screen

what's mean you replacing it with my own creation, this mean you use your own TextFields??
Please use plain text.
Guru I
Xandrex
Posts: 18,382
Registered: ‎07-29-2008
My Device: Z10 10.1.0.2312 / Playbook 2.1 / 8900 5.0
My Carrier: Vodafone France (SFR) & B&You

Re: changing Field context menu after drawing screen


juszczec2 wrote:

Hello all

 

I've got a VerticalFileManager into which I'm adding a bunch of TextFields.

 

I am overriding the TextFields' default context menu and replacing it with one of my own creation.

 

Before I add the the TextField to the VerticalFileManager, I also add it to a Vector.  What I'd like to do is go thru the Vector,  grab each TextField, modify its context menu again (replace the existing context menu item with a new context menu) and cause the TextFields with the new context menu to be displayed.

Is this even possible?  Do I have to delete all the TextFields and re-add them?

 

Mark



hello Mark,

 


deleting a textField element then readding it will not erase its contect menu.

You need to look at the contextMenu class and see if you can override it, or if you have to create a regular Field element and create the contextMenu.

 

You can find more information:

http://www.blackberry.com/developers/docs/4.2.1api/net/rim/device/api/ui/component/TextField.html

 

http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/component/TextField.html#ma...

 

http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/ContextMenu.html




The search box on top-right of this page is your true friend, and the public Knowledge Base too:
Please use plain text.