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
Super Contributor
Posts: 273
Registered: ‎11-23-2010
My Device: 9800 torch
My Carrier: Software Programmer

Re: Problem while detecting the scrolling data using ScrollChangeListener.

[ Edited ]

Hi Peter,

 

It's working peter,

 

and i have a small problem it returns top positions of the screen so i can paint handle only that  position of the field and few more fields on the screen that are visible but  can't handle those fields how can i get the visible posistions of the fields. if it's not focused

 

Can you please help me on this.

 

Thank you,

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Problem while detecting the scrolling data using ScrollChangeListener.

I am glad it is working. 

 

But I am sorry tpo say that I am not clear on what you are asking.

 

"it returns top positions of the screen "  What returns this?  And do you mean the position of the top of the screen, or, do you mean that when you getVerticalScroll(), the value is the scroll position of the first part of the Manager that is visible on the screen?,

 

"i can paint handle only that  position of the field and few more fields on the screen that are visible "

I don't know what you mean by "paint handle".  Normally Fields will paint themselves.

 

"how can i get the visible posistions of the fields"

Again not sure what you mean, do you mena the position within the Mnager or the physical position on the screen?  But look at getExtent() and the various getContent methods, perhaps they answer your question?

 

It might be interesting to know why you are gong to this sort of trouble, as there may be alternative and simpler approaches to achieve what you want. 

Super Contributor
Posts: 273
Registered: ‎11-23-2010
My Device: 9800 torch
My Carrier: Software Programmer

Re: Problem while detecting the scrolling data using ScrollChangeListener.

Thanks peter,

 

Thanks for the replay.

 

While Scrolling down at the bottom i am sending the request to the server after getting the response am not able to display the data and the application was struck.

 

do u have any idea why it was happending

 

Can you please help me on this.

 

Thank you,

 

bh1r1th

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Problem while detecting the scrolling data using ScrollChangeListener.

"While Scrolling down at the bottom i am sending the request to the server after getting the response am not able to display the data and the application was struck.

 

do u have any idea why it was happening"

 

Remember that you can't do blocking operations while on the Event Thread and processing scrolling operations is very much a UI think so will run on the UI Thread.

 

So in you scroll change listener, when you decide that you need more data, you need to start a separate Thread to get the data.

 

That of course means that you have to do something non blocking with the Ui while the data is coming.  

 

One option is to put a Field at the bottom on the scrolling data that you then remove when the new data arrives.  This Field could say something like 'Loading, please wait'.

 

Another option is to put up a "loading" popup screen that blocks until the data has arrived. 

 

There is no simple option, and your choice will depend on what your design requires. 

Highlighted
Super Contributor
Posts: 273
Registered: ‎11-23-2010
My Device: 9800 torch
My Carrier: Software Programmer

Re: Problem while detecting the scrolling data using ScrollChangeListener.

Thank you peter,

 

it was really helpfull.