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
Highlighted
New Developer
Posts: 169
Registered: ‎04-12-2010
My Device: Storm
My Carrier: Verizon

load listview with xml created at runtime

[ Edited ]

I know the model stuff and have done it on other sections of my code,

 

BUT I always wonder this as it is less cumbersome to setup. I receive data and can create a XML file and would like to use it as the source to a listView at runtime , but the data doesn't seem to update with the one just created and the Listview loads with the static xml. I'm overwriting the xml to the assets folder .. is that allowed??? I'm thinkimg may be I should use the documents folder instead???? but that one also is not working for me. Any hints?????

 

Edit: Playing around it go it to work using this path /accounts/1000/shared/documents/myFile.xml not sure if it is the proper way , the Absolute path din't like me... but since the GUI stuff is in a QML it seems lime it loads the previous copy, how to push it to reload the xml????

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

Re: load listview with xml created at runtime

I'm struggling to understand your problem but part of it I think I understood.

 

You won't be able to write to the assets folder, if you move your xml file to a shared folder then that is fine as long as you don't mind it being accessible to all.

 

If you'd rather keep it private then copy or write it to the data folder.

 

The 'reload' part needs some further explanation?

 


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.
New Developer
Posts: 169
Registered: ‎04-12-2010
My Device: Storm
My Carrier: Verizon

Re: load listview with xml created at runtime

Thanks ... the reloading issue seems to be due to the way my QML is setup which seems to preload stuff , I have a tab based with a bunch of sheets/dialogs.  

 

I did manage to write to assets but same issue, it loads the previous value not the one generated on the fly. Have quite a few sections where this would make life easier and quicker than setting a model and blah blah balh ...I'm experimenting with Datasource.load() / clear() to see if this can somehow cover this.

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

Re: load listview with xml created at runtime

Okay under debug you can write to the assets folder on a release you will not be able to.
So it's no surprise that the values are unchanged.

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.
New Developer
Posts: 169
Registered: ‎04-12-2010
My Device: Storm
My Carrier: Verizon

Re: load listview with xml created at runtime

It also does it with a xml in documents ... even tried a CreateObject  to recreate the section on the fly still does not  pick up the current xml so it is looking like a lost case .... it is a real pain to have to create itemProvider and a bunch of other annoying things just to repopulate a simple ListView ... there is always a way I' m pretty sure but the documentation doesn't cover my setup as the dataSource.load() technique doesn't seem to work in a Dialog all samples are in  Page ... of course .. so back to shooting darts in the dark until it hits ...  kind of a pain.