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

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 62
Registered: ‎11-30-2012
My Device: BlackBerry Z10
My Carrier: Telus

How can I show a button at the end of a listview?

I know there is leadingVisual and I am already using it, but I need a button at the end of my list and there doesn't seem to be a trailingVisual component. I have heard about infinite scrolling but that isn't what I want. I do need this button however to load more items into the list when pressed. Anyway to implement this in JUST cascades?

__________________________________________________________

If my post helped, click the like button!

Developer of Reader|YC , an open source Hackernews client
Developer
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: How can I show a button at the end of a listview?

There are a few options for doing this, theres this http://blackberry.github.io/Cascades-Samples/pageddatamodel.html

 

then you could also listen in a listscrollstatehandler for the onEnd signal, and then when thats hit, flip the visiblity on the button that makes it show up at the bottom outside the list view.

Like all of my posts
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: How can I show a button at the end of a listview?

Hi,
As a workaround you could return a different itemType for last indexPath (for example 'loadMore') and create a ListItemComponent for this item type with embedded "Load more" button.

You'll need to add an extra item to dataModel for this to work (in custom data model just return actual item count + 1).

Andrey Fidrya, @zmeyc on twitter
Developer
Posts: 62
Registered: ‎11-30-2012
My Device: BlackBerry Z10
My Carrier: Telus

Re: How can I show a button at the end of a listview?

Hey thanks guys! I was considering having two item types, but I wasn't sure how to make so only the last index used it.
__________________________________________________________

If my post helped, click the like button!

Developer of Reader|YC , an open source Hackernews client
Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: How can I show a button at the end of a listview?


madkristoff wrote:
Hey thanks guys! I was considering having two item types, but I wasn't sure how to make so only the last index used it.

in a GroupedDataModel you can give the item the highest possible value - then it's always the last one

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 62
Registered: ‎11-30-2012
My Device: BlackBerry Z10
My Carrier: Telus

Re: How can I show a button at the end of a listview?

Give what the highest possible value? Is there any sample apps that do something like this? (Other than the pagemodel one already posted)?
__________________________________________________________

If my post helped, click the like button!

Developer of Reader|YC , an open source Hackernews client
Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: How can I show a button at the end of a listview?

if you have a GroupedDataModel and your sorting key is an int then add your special button-Item with this attribute set to gighest value possible or if your sorting key is City set the City to 'Zzzzzzzzz' or so

 

then this item will be the last one

 

and you can ask your Headeritem if 'Zzzzzzzz' and don#t display the header

 

only some ideas you can play with

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 62
Registered: ‎11-30-2012
My Device: BlackBerry Z10
My Carrier: Telus

Re: How can I show a button at the end of a listview?

Alright thanks for the clarification. I actually think I have a solution, I'm just going to append an button item to the end of the list and then delete it when pressed, then reappend it to the end. Your idea is also good and may be faster so I'll try that if this doesn't work out.
__________________________________________________________

If my post helped, click the like button!

Developer of Reader|YC , an open source Hackernews client