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
spring_suvarna
Posts: 330
Registered: ‎02-25-2009
My Device: Not Specified
Accepted Solution

row column struture in blackberry application

Hi everyone

 

I want row column structure in my application.

 

Any ideas?

 

Thanks in advance.

Please use plain text.
Developer
simon_hain
Posts: 16,113
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: row column struture in blackberry application

if you mean the layout that the native mail application uses (for example): it is an objectlistfield. you have full control over the painted content using drawListRow.
Take a look at these classes and the Graphics class to see how you can paint bitmaps, text or forms.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
spring_suvarna
Posts: 330
Registered: ‎02-25-2009
My Device: Not Specified

Re: row column struture in blackberry application

there are going to be 10 columns and 15 rows.

 

and one more question is. as there are many columns all will not fit in one screen so for that i need to use horizontalfieldmanager scroll bar? but m not successful in using it..

 

Thanks in advance

Please use plain text.
Developer
spring_suvarna
Posts: 330
Registered: ‎02-25-2009
My Device: Not Specified

Re: row column struture in blackberry application

can you give code snippet for using ObjectFieldList

 

 

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

Re: row column struture in blackberry application

Once you have displayed your columns and rows, do you expect the user to be able to focus on individual cells, like a spreadsheet?

Please use plain text.
Developer
spring_suvarna
Posts: 330
Registered: ‎02-25-2009
My Device: Not Specified

Re: row column struture in blackberry application

nopes .

 

entire row should get selected.

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

Re: row column structure in blackberry application

I suggest the ListField Field.  You will find samples of in in the samples, in the Developer Guide, in this forum and the KnowledgeBase.  As an example from the KB, look at this:

 

How To - Create a color ListField
Article Number: DB-00472
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800345/...

However you will need to do a bit of work to manage the left and right scrolling.  To do this on trackball devices you basically need to:

1) override navigationMovement to detect horizontal movement

2) have a 'currentcolumn', and increment/decrement that when the focus moves left and right, then invalidate the ListField

3) in your drawListRow() method, draw your columns starting with the 'currentcolumn'.

 

I've done something very similar, this code should work fine on all trackball devices except the Storm. 

 

I'm sorry I'm not sure what you need to do for the Storm to detect the horizontal scroll.  But once you have detected and updated the 'currentcolumn', the rest of the processing above should still work OK.

 

Hope this helps

Please use plain text.
Developer
spring_suvarna
Posts: 330
Registered: ‎02-25-2009
My Device: Not Specified

Re: row column struture in blackberry application

hey Thanks for the solution :smileyhappy:

 

i used ListField for creating list, and i am able to select entire row .. 

 

but now the problem of navigating horizantly is still there.. as there are more columns.. m able to view only 4 columns and there are about 10 columns..

 

any reason .. any answer?

 

Thanks in advance .

 

 

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

Re: row column structure in blackberry application

Did you understand the step

3) in your drawListRow() method, draw your columns starting with the 'currentcolumn'.

 

Basically you did a horizontal movement, decide which is the next column to display, call invalidate to redraw the ListField, then in your drawListRow(), you start your drawing at the 'currentcolumn' ignoring preceding ones.

 

As an example, assume you have a ListField that is displaying Strings, which you draw using graphics.grawText(..).  Each scroll increased or decreased the start position in the Strings.  If the current position was 4 (so in the ListField display, you were skipping the first 4 characters) and the person scrolled right, then they want to see more of the righthand end of the Strings.  So in the navigiationMovement() you increment the currentcolumn by 1 to 5.  Then in drawListRow() you draw all the Strings starting at character 5.

 

So ListField doesn't scroll by itself - you have to scroll for it.

 

Is this clear?

Please use plain text.
Developer
spring_suvarna
Posts: 330
Registered: ‎02-25-2009
My Device: Not Specified

Re: row column structure in blackberry application

Hey Thanks for the solution..

 

got success for List creation and Horizontal movement. 

 

but now i am not able to move to next record.

 

 

Please use plain text.