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
Contributor
Posts: 15
Registered: ‎04-07-2013
My Device: blackberry z10
My Carrier: blackberry z10
Accepted Solution

\n in ListView

hey im trying to put serval data in lines in one line og a listview but whan i put the "\n" it dosent show mi anything in the app so who can i do that??

 

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

Re: \n in ListView

Can you post your code.

 

Have you set your label to multiline?

Could you perhaps use a custom layout and place several lables instead?

 


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.
Contributor
Posts: 15
Registered: ‎04-07-2013
My Device: blackberry z10
My Carrier: blackberry z10

Re: \n in ListView

its without labels ist only the litview 

    ListView {
        
            dataModel: listdayswork

        }

 and here i try to put the data

QString s="Name work:"+listwork.front().name+"\n"+" Date work:"+listwork.front().date.toString("dd/MM/yyyy")+"\n Start hour:"+listwork.front().start.toString("HH:mm")+"\n end hour:"+listwork.front().end.toString("HH:mm")+"\n Total time worked: "+QString::number(std::abs(listwork.front().start.secsTo(listwork.front().end)/60)/60,10)+"\n Total money:"+QString::number(listwork.front().toalmoney,10)+"\n";

listdayswork->append(s);

 

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

Re: \n in ListView

Your data model needs to be of a certain type (i.e. Group, XML, etc.), how is yours defined?

 

http://developer.blackberry.com/cascades/documentation/ui/lists/data_models.html


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.
Contributor
Posts: 15
Registered: ‎04-07-2013
My Device: blackberry z10
My Carrier: blackberry z10

Re: \n in ListView

as ArrayDataModel

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

Re: \n in ListView

I think the standard template for the ListItemComponant doesn't support multiline.

 

Try this...

 

            listItemComponents: [
                ListItemComponent {
	             Container {
	                    Label {
	                        text: ListItemData
	                        multiline: true
	                    }
	             }
	        }
            ]

 


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.