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
BB_Develpoer
Posts: 130
Registered: ‎10-26-2010
My Device: Blackberry Bold 9700
Accepted Solution

Setting virtual extent of manager makes whole screen scrolable

Hi to all , 

 

My original was what is posted in this thread

http://supportforums.blackberry.com/t5/Java-Development/Fields-Alignment-in-manager/m-p/1297121

 

I got a solution for that if dont make the last field added to VFM in focus my repainting issue is solved :smileyhappy:

 

But  now I am having another problem :smileysad: 

Thats is i had to give my vfm a specified area on the screen,

I found two ways

setExtent()  and setVirtualExtent()

 

if I use setExtent() prblm it gives my is that , a kind of hardcoded area is the for VFM on the screen , if fields the area its ok.But if field are less than the assigned area there is empty space below them , which is kind of not good.

 

So it made me to use setVirtualExtent() , it sorted the problm setExtent() was given but raised a new one , Now if added fields consume more than the VFM area my whole screen is set scrolable, but in actually  only the VFM should scroll.

 

so, kindly please help me to sort out one of the issue either the emptyspace issue so that i can use the setExtent()

or the screen scroll issue so the i can use setVirtualExtent()

 

A big thanks in advance to everyone.

Regard

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Setting virtual extent of manager makes whole screen scrollable

[ Edited ]

In theory, you should set both setVirtualExtent() and setExtent().

 

setExtent() determines the actual space on screen that your Manager will use, this is he "window" through which you view your Manager.  setVirtualExtent() is the space that Manager actually requires to display everything it has.

 

If setVirtualExtent is bigger than setExtent, then your Manager should scroll, otherwise you are not going to see everything.

 

Normally most people don't want their Manager to scroll, they want the Screen to scroll, so they set setExtent to the total space required (which defaults setVirtualExtent to that space too I think).

 

You may find the code and explanation in here more useful in explaining this:

http://supportforums.blackberry.com/t5/Java-Development/Implementing-a-standard-style-scrollbar-on-a...

 

A quick nod to arkadyz, who wrote the article I  have referenced above and to whom I owe my understanding of this concept. 

Please use plain text.
Developer
BB_Develpoer
Posts: 130
Registered: ‎10-26-2010
My Device: Blackberry Bold 9700

Re: Setting virtual extent of manager makes whole screen scrollable

Thanks @peter for your reply.

I have to clone the default send sms screen of Balckberry in my app.From that prespective I have to scroll the to Number field area, any suggestion wil help to achieve the target

 

Regards

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Setting virtual extent of manager makes whole screen scrollable

If you set a Field in focus, the processing will automatically attempt to scroll the user there.  That is how I think I would do it in this case.  So set the Number Field in focus (using setFocus).

Please use plain text.
Developer
BB_Develpoer
Posts: 130
Registered: ‎10-26-2010
My Device: Blackberry Bold 9700

Re: Setting virtual extent of manager makes whole screen scrollable

Thanks peter for your replies.

 

My problm is solved now. I just made a check in subLayout() of my VFM on basic of field count to adjust the height in setExtent() .Now my feild are added in VFM but below feild 1 is always on top new fields are added below and i have to scroll to access them . but my repainting and other issues are solved now.

(No idea what is going on in particulr but Thank God my problm is solved now)

 

Regards

Please use plain text.