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
New Developer
Raime910
Posts: 16
Registered: ‎09-04-2008
My Device: Not Specified
Accepted Solution

How to empy and replace the Buttons inside the Horizontal Field Manager

[ Edited ]

Hi! So basically, I have 2 buttons at the top of the screen and a set of buttons inside a HorizontalFieldManager (let's call is Set 1 and 2). Now, when I click on the first button it should show up a Set 1 and then show up Set 2 and remove the Set1 on screen. How do I do this? Thanks!

 

- Ryan

Message Edited by Raime910 on 10-17-2008 03:46 PM
Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to empy and replace the Buttons inside the Horizontal Field Manager

Not 100% clear on your requirements.  But review this thread for options:

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=5214

New Developer
Raime910
Posts: 16
Registered: ‎09-04-2008
My Device: Not Specified

Re: How to empy and replace the Buttons inside the Horizontal Field Manager

It's like this

 

When button1 is clicked hide HFMgr2 and show HFMgr1;

[BUTTON1] [BUTTON2]

[ [bSET1a] [bSET1b] [bSET1c] ] <--- HFMgr1

 

 

When button2 is clicked hide HFMgr1 and show HFMgr2;

[BUTTON1] [BUTTON2]

[ [bSET2a] [bSET2b] [bSET2c] ] <--- HFMgr2


Thanks!

 

- Ryan

 

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to empty and replace the Buttons inside the Horizontal Field Manager

The details in the referenced Thread should get you going.

 

Basically you add and delete Fields.

 

I would suggest you have a Manager for Set 1 and a Manager for Set 2.  Add both Managers to the Screen, with nothing in them, 

Make sure Manager 2 is empty (deleteAll) and add the Fields associated with Set 1 to the Manager for Set 1, when these should be displayed - i.e. trigger this with the press of Button 1. 

Remove the Fields in Manager 1 and add the Fields associated with Set 2 to the Manager for Set 2, when these should be displayed - i.e. trigger this with a press of Button 2. 

 

Hope this helps.

 

New Developer
Raime910
Posts: 16
Registered: ‎09-04-2008
My Device: Not Specified

Re: How to empty and replace the Buttons inside the Horizontal Field Manager

That worked well. Thanks Peter.