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
Posts: 298
Registered: ‎05-02-2010
My Device: Bold 9700
My Carrier: Verizon
Accepted Solution

A design question using custom Fields in custom Managers.

A design question, what is a good implementation of the following?

 

I've read the Knowledge Base articles "Create custom fields" and "Create a custom layout manager for a screen" and what I want to do is control any arbitrary custom field - in a custom manager.

 

For example, if I have the following Fields:

 

  1. Field
  2. Field
  3. Field
  4. Field
  5. Field

I want the second and fifth Fields to have a different margin, padding or width than the first, third and forth Fields, I would do that by layout() and paint() methods for the second and fifth Fields - that should override the custom Manager sublayout() method logic?

 

Or do I add logic in the custom Manager, I find the fields with the getField() method to get the second and fifth Fields and modify the margin, padding or width with logic in the custom Manager?

 

Which is the correct place to put the logic?

 

Thanks.

--Todd

Windows 7 Enterprise 64-bit (6.1 Build 7600) | Java SE Runtime Environment (build 1.6.0_24-b07) | Eclipse Version: 3.6.2 [M20110210-1200] | BlackBerry Eclipse Plug-in: 1.3.0.201102031007-19 | Java Compiler level: 1.3 | Targeting devices running OS 5 | Simulators: JDE 5.0 packaged 9700, 9630, 9300
Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: A design question using custom Fields in custom Managers.

you can do this in the sublayout method of the manager when you assign all fields their size and position.

----------------------------------------------------------
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: 208
Registered: ‎08-04-2009
My Device: Not Specified

Re: A design question using custom Fields in custom Managers.

In Method sublayout you have all the options to give position of  a component, and if you use paint method for this purpose, you can only alter compont's displaying area/style, but component will use same size.

Developer
Posts: 298
Registered: ‎05-02-2010
My Device: Bold 9700
My Carrier: Verizon

Re: A design question using custom Fields in custom Managers.

To be absolutely clear, a Manager's sublayout() method logic takes precedence over aa Field's layout() method logic?

--Todd

Windows 7 Enterprise 64-bit (6.1 Build 7600) | Java SE Runtime Environment (build 1.6.0_24-b07) | Eclipse Version: 3.6.2 [M20110210-1200] | BlackBerry Eclipse Plug-in: 1.3.0.201102031007-19 | Java Compiler level: 1.3 | Targeting devices running OS 5 | Simulators: JDE 5.0 packaged 9700, 9630, 9300
Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: A design question using custom Fields in custom Managers.

the field can only work with the space assigned by the manager. how it uses this space is up to the field, it could display itself smaller, for example.

----------------------------------------------------------
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: 298
Registered: ‎05-02-2010
My Device: Bold 9700
My Carrier: Verizon

Re: A design question using custom Fields in custom Managers.

Thank you, I appreciate your help - kudos to you.

--Todd

Windows 7 Enterprise 64-bit (6.1 Build 7600) | Java SE Runtime Environment (build 1.6.0_24-b07) | Eclipse Version: 3.6.2 [M20110210-1200] | BlackBerry Eclipse Plug-in: 1.3.0.201102031007-19 | Java Compiler level: 1.3 | Targeting devices running OS 5 | Simulators: JDE 5.0 packaged 9700, 9630, 9300