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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Trusted Contributor
babakar
Posts: 222
Registered: ‎05-29-2012
My Carrier: 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.

Please use plain text.
Trusted Contributor
babakar
Posts: 222
Registered: ‎05-29-2012
My Carrier: 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
Please use plain text.
Trusted Contributor
babakar
Posts: 222
Registered: ‎05-29-2012
My Carrier: 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
Please use plain text.
Regular Contributor
heretocode
Posts: 70
Registered: ‎12-19-2011
My Carrier: Airtel

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.

Please use plain text.
Developer
simon_hain
Posts: 13,754
Registered: ‎07-29-2008
My Carrier: O2 Germany

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
Please use plain text.
Trusted Contributor
babakar
Posts: 222
Registered: ‎05-29-2012
My Carrier: see later

Re: Listfield with button

what solution u offer simon_hain?
what heretocode said is good way to follow?
Please use plain text.
Developer
peter_strange
Posts: 17,655
Registered: ‎07-14-2008

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. 

Please use plain text.
Developer
simon_hain
Posts: 13,754
Registered: ‎07-29-2008
My Carrier: O2 Germany

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
Please use plain text.
Trusted Contributor
babakar
Posts: 222
Registered: ‎05-29-2012
My Carrier: 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.
Please use plain text.