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

Reply
Developer
Posts: 148
Registered: ‎04-08-2013
My Device: Blackberry 10
My Carrier: Blackberry

Count of groupDataModel record

[ Edited ]

Iam putting a listView inside a scrollView.So to avoid infinite scroling (Which is an issue with listView inside a ScrollView)Iam trying to set the 'preferredHeight' of the listView.But Iam getting 0 as height.

 

Below is my code

Page
{ ScrollView { Container
{ Label
{ text:"hello" } } ListView { preferredHeight: homeDataModel.size()*395 //here Iam trying to set the height of ListView id: homeList layout: GridListLayout {} dataModel: homeDataModel listItemComponents: [ ListItemComponent { Label { text: ListItemData.title } } ] } } attachedObjects: [ GroupDataModel { id: homeDataModel grouping: ItemGrouping.None }, // The data source that fills the above model with the articles DataSource { id: homeDataSource source: "sql/duDatabase.db" query: "SELECT title,isActive,imagePath FROM how_to" onDataLoaded: { homeDataModel.clear(); homeDataModel.insertList(data); } } ]

 Where Iam wrong Iam getting the height as 0.Plz help me out guys Smiley Sad

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Count of groupDataModel record

Have ytou checked to see if your size() function is returning non-zero?


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 148
Registered: ‎04-08-2013
My Device: Blackberry 10
My Carrier: Blackberry

Re: Count of groupDataModel record

I didnt try that.Thanks for your time.

 

Now I logged the size then it shows 16Smiley Happy

 But again the problem is when I get the preferredHeight then the list view data is not appearing,onle white space appears in the place of list view and Iam not able to scroll on that space.Plz help me out how to solve this

Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: Count of groupDataModel record

One doubt... Why you using ScrollView?
Developer
Posts: 148
Registered: ‎04-08-2013
My Device: Blackberry 10
My Carrier: Blackberry

Re: Count of groupDataModel record

Actually My page contains elements as follows

 

 1)scrollView

 2)Inside scrollView Iam having An advertisement image (which is some what big)

 3)Then I have several Tile like views. - for this tiles Iam using listView,These tiles are dynamic their number and text in them depends upon the data from the server.so I think listView is the easier way to Implement this

 

Now the problem is scrollView scrolls infinity.

 

Highlighted
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Count of groupDataModel record

Change the colour of the scrollview and I bet that white space changes colour you're basically pushing the ListView of the screen.

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.