09-11-2011 09:55 AM
Hi to all ,
My original was what is posted in this thread
http://supportforums.blackberry.com/t5/Java-Develo
I got a solution for that if dont make the last field added to VFM in focus my repainting issue is solved ![]()
But now I am having another problem
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
Solved! Go to Solution.
09-11-2011 07:54 PM - edited 09-12-2011 04:33 AM
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:
A quick nod to arkadyz, who wrote the article I have referenced above and to whom I owe my understanding of this concept.
09-12-2011 01:37 AM
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
09-12-2011 04:31 AM
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).
09-12-2011 09:02 AM
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