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
Posts: 137
Registered: ‎02-04-2010
My Device: Tour 9630
My Carrier: verizon
Accepted Solution

KeywordFilterField inside scrolling vfm

I have a KeywordFilterField inside the scrolling VFM. The background image is displayed properly however when user searches the KeywordFilterField list & only a few list rows apper the background image is only displayed behind the rows. For example if there are only 3 rows displayed in the list then the image will only be displayed behind them & not on the full screen.

Any ideas?

Thanks

Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: KeywordFilterField inside scrolling vfm

A wild guess would be this - your scrolling VFM is created without USE_ALL_HEIGHT, and, when the field shrinks enough, it sets its own extent to use that field's height.  Since any field (and Manager is a Field) can only draw in its extent area, it draws the background behind the currently shown rows.

 

Notice - USE_ALL_HEIGHT is dangerous if you add your VFM to a default MainScreen.  I know you've read one of my posts that suggested passing NO_VERTICAL_SCROLL to MainScreen constructor - your case is the perfect example why.

 

So, to summarize:

1) Create new MainScreen(MainScreen.NO_VERTICAL_SCROLL)

2) Create new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR | Manager.USE_ALL_HEIGHT)

3) setBackground of your VFM if targeting 4.6+ phones; override the VFM's paintBackground() otherwise (explained in more detail in this knowledge base article - Use a background image in application screens; if you override paint/paintBackground, be sure to read the comment there)

4) add your VFM to your screen

5) add your KeywordFilterField to your VFM.

 

Good luck!

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
New Developer
Posts: 137
Registered: ‎02-04-2010
My Device: Tour 9630
My Carrier: verizon

Re: KeywordFilterField inside scrolling vfm

Perfect.

Thanks for your help.

New Developer
Posts: 137
Registered: ‎02-04-2010
My Device: Tour 9630
My Carrier: verizon

Re: KeywordFilterField inside scrolling vfm

encountered a strange problem with this.

Using drawListRow to draw 2 lines for each record. However the first row of the list initially shows one line only.

Any ideas?