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
New Developer
sudhirispl
Posts: 17
Registered: ‎08-18-2008
My Device: Not Specified

Re: Problem while moving focus horizontally in GridControl

Hi Mark and All,

 

Thanks for Reply.

 

columnHeadingHolder = new HorizontalFieldManager(HorizontalFieldManager.NO_HORIZONTAL_SCROLL
 | HorizontalFieldManager.NO_VERTICAL_SCROLL | HorizontalFieldManager.USE_ALL_WIDTH){
    public void paint(Graphics graphics)
    {
 super.paint(graphics);
 XYRect xy = getExtent();
 hieghtVFM = xy.Y2();
    }
};

columnHeadingHolder HorizontalFieldManager uses paint() which gets the (x,y) point of this Manager.

 

dataScroller = new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL
 | VerticalFieldManager.VERTICAL_SCROLLBAR ){
    protected void sublayout(int width, int height){
 super.sublayout(width, height);
 //overides the width and height
 setExtent(widthVFM, graphics.getScreenHeight()- hieghtVFM);
    }
};

dataScroller VerticalFieldManager uses sublayout() which is turn uses setExtent() method.
sublayout() method sets the width and height of visible rows of Grid.
In this process sublayout() method is called first and then the paint() method.
But I want to call first paint() method of HorizontalFieldManager and then sublayout() method.
Is it possible? If yes then how do it.or Is there any other way?       

 

Thanks

Please use plain text.
New Developer
sudhirispl
Posts: 17
Registered: ‎08-18-2008
My Device: Not Specified

Re: Problem while moving focus horizontally in GridControl

[ Edited ]

 Hi All,

            Please give the suggestion. it is urgent, thanks in advance

 

Message Edited by sudhirispl on 09-08-2008 11:20 AM
Message Edited by sudhirispl on 09-08-2008 11:21 AM
Please use plain text.
Administrator
MSohm
Posts: 14,296
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Problem while moving focus horizontally in GridControl

The sublayout a method is called before paint to allow fields and managers to calculate their positions accordingly.

 

If you need to find the XYRect of a field you can call the getManager().getContentRect() methods on the field 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.
New Developer
sudhirispl
Posts: 17
Registered: ‎08-18-2008
My Device: Not Specified

Re: Problem while moving focus horizontally in GridControl

Hello Mark and all,

Thanks for your reply,
I tried to use getContentRect() on the Main Manager in sublayout and it returned xy co-oridanate as 0.

I just try to explain my problem once again,
Actually I just want to restrict the height of the Grid Control to some fixed limit let us say upto only 5 rows.
But, when my screen contains some other fields labelField, editfields at top.
And below that if I placed my Grid Control, let's say at middle of screen, first time it looks OK, but when I try to
scroll it vertically, eventually it takes the area of entire screen.
I just dont want this to happen. So, If I am placing my Grid Control at center of screen then when I scroll it vertically
it should go only till 5 rows and its base position should not change, i.e. it should remain at center of screen.

I am using sublayout method here to do this task. But, not able to got it working.

So,I want to get XY co-ordinates of the columnHeadingHolder(according the above code) manager and from that I want
to fix the height of the Grid Control.


Thanks and waiting for your replys....

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

Re: Problem while moving focus horizontally in GridControl

You can fix certain screen and allow others to be scrollable by putting them in different managers.  Your manager at the top of the screen could use the Manager.NO_VERTICAL_SCROLL and Manager.NO_HORIZONTAL_SCROLL to prevent it from scrolling.  Then, create the manager that holds your grid with a style that enabled scrolling (Manager.VERTICAL_SCROLL or Manager.HORIZONTAL_SCROLL).
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.
New Developer
sudhirispl
Posts: 17
Registered: ‎08-18-2008
My Device: Not Specified

Problem to fix the height of the Grid Control

Hello Mark,

Thanks for you reply..

I tried to apply the Manager.NO_VERTICAL_SCROLL and Manager.NO_HORIZONTAL_SCROLL style to the Manager which is on top of the Grid Control, but it doesn't work for me, when I try to scroll down in the Grid Control my grid control takes the entire screen and the fields which are on top of the Grid control get disappeared. I just want to fixed the height of Grid Control to some fix limit(let us say upto 5 rows)and when I try to scroll vertically, only 5 rows should be visible at atime in Grid, and rows in Grid should be seen accordingly. I tried to use layout method to fixed the height, but not having success with it.

 

Can anyone please guide me here?....

 

Thanks and keenly waitng for you replys....:smileysad:

 

 

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

Re: Problem to fix the height of the Grid Control

Where are you adding your GridControl to, a manager or a screen?  If you are using a MainScreen or FullScreen are you creating them with the no scroll styles?
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.
New Developer
sudhirispl
Posts: 17
Registered: ‎08-18-2008
My Device: Not Specified

Re: Problem to fix the height of the Grid Control

Hello Mark,

     Thanks for reply.

 I am adding GridControl to Manager after that Manager is added to screen.i have no scroll styles in sceeen.
 I can not apply the style to screen, I need to apply it in Grid Control itself, it should not depend on the Screen.
 So please give me any suggestion

 

Thanks

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

Re: Problem to fix the height of the Grid Control

Are you creating a custom Screen that extends the Screen class, or are you using a FullScreen or MainScreen?
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.