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.
10-08-2013 07:14 PM
expandableMessage.headerTextVisible.visible = true;
expandableMessage.bodyTextVisible.visible = false;
in ListItem.onDataChanged and adding to expandablelabel
property alias headerTextVisible: lblTitle.visible
property alias bodyTextVisible: lblBody.visible
doesn't fix it, I'm at a loss. I am not getting any qml errors in the console when ondatachnaged is called.
10-08-2013 07:29 PM - edited 10-08-2013 07:39 PM
Could you verify that onDataChanged is getting called at all? (by adding a console.log() statement to it)
It will work only when defined at top level item of ListItemComponent.
By the way, directly modifying ListItemComponent properties such as
lblBody.visible = true;
won't work because ListView reuses these ListItemComponents as it sees fit. It will rearrange them during scrolling and their state will be lost.
How many items do you need to display? Sometimes it's easier to simply add them to a Container without using ListView at all.
When using ListView, it's better to create a model with all the needed flags (isExpanded etc) and map visual components state to model properties. When state has to be changed, modify the model accordingly. ListView will display the new state. This has some limitations though. I had problems with updating DropDown component using this approach.
UPD: thread with some sample code. Works for 'title' property, but I was unable to update DropDown's values:
I don't know if it will work when binding to 'visible' property.
10-08-2013 07:37 PM
onDataChanged is definatly being called.
lblBody.visible is being set through an alias I added to explanablelabel when ondatachanged is called - is that wrong?
The ListView is populated dynamically and needs to load more and more items when it reaches the end of the data.
10-08-2013 07:47 PM
10-08-2013 07:51 PM
Ok thanks, I'm starting to realise this - I just thought something as simple as editing the text or visibility wouldnt require an update to the actual object in the model, that thought cost me hours of wasted time!