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
babakar
Posts: 770
Registered: ‎05-29-2012
My Device: see later

Listfield with button

I want on listfield, in case user clicks on this to go to new page

 

graphics.drawBitmap(5, yPos, image.getWidth(), image.getHeight(), image, 0, 0);

{

navigationclick

}

 

 

but there is no navigationclick, how can i on click of image go to new page...and send the selected row index.

Developer
babakar
Posts: 770
Registered: ‎05-29-2012
My Device: see later

Re: Listfield with button

also do note, i have written on click of row a function
protected boolean navigationClick(int status, int time) {
fieldChangeNotify(0);

so in case it clicks on row, i play a music.but in case it clicks on a certain picture in the row i want to go to new page.hopw can i do it
Developer
babakar
Posts: 770
Registered: ‎05-29-2012
My Device: see later

Re: Listfield with button

http://postimage.org/image/mm0tgh7kn/


thats picture, on row click i play music...but the arrow icon u see on the side, on click of it i want to go to new page..how can this be done?

thank you
Regular Contributor
heretocode
Posts: 70
Registered: ‎12-19-2011
My Device: Bold 9780

Re: Listfield with button

Hi

 

Here you need to create your own row.

 

for example:create a horizontal manager and your images and text on this.And add this manager in a loop on a vertical field manager.it will behave as a list and now you can override click event for each part of the list.

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Listfield with button

that is not possible with a listfield, it controls only rows, you cannot assign two click actions to different parts of a row.
----------------------------------------------------------
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
Developer
babakar
Posts: 770
Registered: ‎05-29-2012
My Device: see later

Re: Listfield with button

what solution u offer simon_hain?
what heretocode said is good way to follow?
Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: Listfield with button

The method suggested by heretocode is a good start.  You may have performance issues if you are displaying a large number of rows because this approach is significantly more processor intensive than ListField. 

 

Another approach is display a choice popup screen and let the user choose the image or music function. 

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Listfield with button

we usually decide for a main action available via click, and put other actions in the context menu.
sometimes we also assign actions to keys (focus a row, press 'a' etc)
----------------------------------------------------------
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
Developer
babakar
Posts: 770
Registered: ‎05-29-2012
My Device: see later

Re: Listfield with button

I am using blackberry jdk 7.0.0. I am using tablelayoutmanager, to start working that way about this.because i need a button inside row.

i will see where i reach thru it.