Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Adobe AIR Development

Reply
Contributor
oznawab
Posts: 30
Registered: 02-20-2011
My Carrier: 3 Australia

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,

 

Please use plain text.
Developer
JohnPinkerton
Posts: 335
Registered: 01-21-2011
My Carrier: Regional

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?

Please use plain text.
Contributor
oznawab
Posts: 30
Registered: 02-20-2011
My Carrier: 3 Australia

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.

Please use plain text.
Developer
jtegen
Posts: 4,247
Registered: 10-27-2010
My Carrier: Verizon

Re: periodically pulling messages

What type of control is the data provider assigned to?

Can you supply ample code of the issue?

Please use plain text.
Contributor
oznawab
Posts: 30
Registered: 02-20-2011
My Carrier: 3 Australia

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.

Please use plain text.
Developer
jtegen
Posts: 4,247
Registered: 10-27-2010
My Carrier: Verizon

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.

Please use plain text.
Developer
tensioncore
Posts: 303
Registered: 12-13-2010
My Carrier: Rogers

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
The Periodical Toe A highly informative Table of Elements
http://www.tensioncore.com/ - Tensioncore Web Hosting
Please use plain text.