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
Trusted Contributor
Posts: 121
Registered: ‎01-19-2011
My Device: Not Specified
My Carrier: engineer
Accepted Solution

GridFieldManager

Hello friends

well my doubt is that, I try to manage a grid field manager and add one field the problem is that my gridfieldmanager  i create

 

mesaManager = new GridFieldManager(2,5, Field.FIELD_HCENTER){  
               protected void sublayout(int width, int height) {
                   width = 300;
                   height = 140;
                   setExtent(width, height);
                   //super.sublayout(width, height);

                }
            };

and when i try to do mesaManager.add i cant because give a error index bound, how i can add elements (Fields)to my gridfieldmanager?

 

sorry my bad english

please i'm waiting your help

Developer
Posts: 466
Registered: ‎03-04-2009
My Device: 8520
My Carrier: some

Re: GridFieldManager

as you're overriding sublayout method you should take care of laying out the fields yourself.

try something like this:

 

  protected void sublayout(int width, int height) {
                   width = 300;
                   height = 140;
                   super.sublayout(width, height);
                   setExtent(width, height);
                  

                }

 

 

Got resolved! Press kudo icon!
Trusted Contributor
Posts: 121
Registered: ‎01-19-2011
My Device: Not Specified
My Carrier: engineer

Re: GridFieldManager

ican't do that because when i try to add this line" super.sublayout(width, height);" have this error messages "Cannot directly invoke the abstract method sublayout(int, int) for the type Manager"

Developer
Posts: 17,011
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: GridFieldManager

It does not make much sense to use a special layout manager and overwrite its layout.

 

Check this link about custom layout managers:

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800508/...

 

if you want to use a GridFieldManager use it without overwriting the layout.

 

----------------------------------------------------------
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
Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: GridFieldManager

Then how to set width for GridFieldmanager?
Developer
Posts: 17,011
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: GridFieldManager

please open an own thread for your question
----------------------------------------------------------
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
Highlighted
Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: GridFieldManager