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

Adobe AIR Development

Reply
Contributor
oznawab
Posts: 30
Registered: ‎02-20-2011
My Device: 9700

periodically pulling messages

Hi Guys,

 

In my app I have a messages section, which displays new events,service calls assigned to the agent.

 

I want to periodically check for new messages by querying webservice.

 

I am displaying this messages in a roundlist so how can I change the datasource on the fly to be able to display new messages?

 

Regards,

 

Developer
JohnPinkerton
Posts: 350
Registered: ‎01-21-2011
My Device: Curve 8900 (Personal) / Bold 9650 (Work)

Re: periodically pulling messages

I don't think we have the abilities to run a "service" in the background to do this. The app would need to be open, and if the app were open couldn't you just have a timer set to trigger the function that checks for updates?

Contributor
oznawab
Posts: 30
Registered: ‎02-20-2011
My Device: 9700

Re: periodically pulling messages

Hi,

 

Accept my apologies if I couldn't explain it better.

 

I have been checking the messages periodically but how would I reflect them in the list by changine the dataprovider.

 

Changing dataprovider doesn't do anything to list, I mean it doesn't refresh, so am I missing something here?

 

let's say the list was loaded with dataprovider dp1 while loading the app. Then new cases were assigned to the user and now these new messages have to be in the list but it doesn't update after I assign dp2 to the list.

 

I hope I am explaining right.

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: periodically pulling messages

What type of control is the data provider assigned to?

Can you supply ample code of the issue?

Contributor
oznawab
Posts: 30
Registered: ‎02-20-2011
My Device: 9700

Re: periodically pulling messages

Hi,

 

Its a RoundList control.

 

Code is some what like

//constructor

app()

{

        list.dataProvider=new DataProvider(messages);

}

then a function which check for update every 300 seconds and update the messages array and assigns update array to dataProvider of the list.

 

But it doesn't work and I am sure I am missing something here but don't know what.

 

Thanks in advance.

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: periodically pulling messages

Try just the QNX List class.  I have lots of issues with the RoundList and having it update properly.  One of those item you may need to change back after 1.0.

Developer
tensioncore
Posts: 326
Registered: ‎12-13-2010
My Device: Bold 9900/Z10 Special Edition

Re: periodically pulling messages

The way I get new information into lists and updating them is by using URLLoader and parsing the output of the web page the app downloaded (which is an API for my app, and outputs data similar to JSON)...then the app puts the parsed info into the dropdown list.
CEO/Lead Developer - Tensioncore™ Design Studios
http://tncr.ws/ - ShortenThis!™ for Blackberry Playbook | ShortenThis!™ for BlackBerry® 10
The Periodical Toe A highly informative Table of Elements
DrawThis! A fun drawing app for the BlackBerry® PlayBook™!
http://www.tensioncore.com/ - Tensioncore™ Web Hosting