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
adriangoh
Posts: 57
Registered: ‎07-27-2010
My Device: Bold 9700, 9000 and Storm 9520, 9500
My Carrier: SingTel
Accepted Solution

Moving Icons around in GridFieldManager

[ Edited ]

Hello,

 

Trying to develop an app which contains icons arranged in a grid using GridFieldManager.

 

Currently icons' positions are fixed once they are added to the grid.

 

Is there a way to make it such that users are able to rearrange the positions of icons within the grid? e.g. move to another blank spot within the grid.

 

A good example would be like the BB menu where we can highlight the icon, select "Move" and choose the new location.

 

Appreciate any help I can get.

 

Thanks a lot in advance!

Please use plain text.
Developer
haagmm
Posts: 178
Registered: ‎07-29-2008
My Device: Not Specified

Re: Moving Icons around in GridFieldManager

I am not very expericned with the GridFieldManager, but the basic solution is to to call Manager.delete() and then Manager.insert() where you want the fields to be

Please use plain text.
Regular Contributor
adriangoh
Posts: 57
Registered: ‎07-27-2010
My Device: Bold 9700, 9000 and Storm 9520, 9500
My Carrier: SingTel

Re: Moving Icons around in GridFieldManager

thank you for your answer. do i need to do a popscreen/pushscreen to update my screen? or to replace the fieldmanager?

Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Moving Icons around in GridFieldManager

You can call the invalidate method on your screen to force it to be redrawn.  You should not pop and push a screen just to have it redraw itself.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Regular Contributor
adriangoh
Posts: 57
Registered: ‎07-27-2010
My Device: Bold 9700, 9000 and Storm 9520, 9500
My Carrier: SingTel

Re: Moving Icons around in GridFieldManager

Got it.

Thanks Haagmm and MSohm for your answers!

Please use plain text.
Regular Contributor
adriangoh
Posts: 57
Registered: ‎07-27-2010
My Device: Bold 9700, 9000 and Storm 9520, 9500
My Carrier: SingTel

Re: Moving Icons around in GridFieldManager

Just as a follow up to anyone who is interested. I had to delete both the fields which i had to swap places and do a Manager.insert to insert into the corresponding index. Then i call Field.setFocus and moveFocus to complete this action.

Please use plain text.