BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-09-2007, 10:44 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8800
PIN: N/A
Carrier: t-mobile
Posts: 44
Post Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb Persistable objects

Please Login to Remove!

I'm using persistent objects in my project. So far in my classes which implement Persistable only contained primitive data types, like String, int ...
But now i want to add a TreeField. So it should it look something like this.

Code:
public final class DataStorage implements Persistable{
	private String st1, st2, st3;
	
	private TreeField treefield;

         ....
         ....
This will not compile because of the TreeField. If i set the Treefield static it works. But i don't want to do that in the first place and im not clear about whats the difference for the persistent object whether the TreeField is static or not.

My main intention is to store a TreeField persistently.

So if someone could bring some light on this, i would be grateful.
Offline  
Old 08-09-2007, 11:19 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2006
Model: 8300
Carrier: Cingular
Posts: 35
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

The problem probably occurs because TreeField does not implement Persistable. All primitive types already implement Persistable which is why they are not a problem.


Code:
public class MyTreeField extends TreeField implements Persistable{
    // etc
}
Offline  
Old 08-10-2007, 01:26 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8800
PIN: N/A
Carrier: t-mobile
Posts: 44
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have tried the following

Code:
public class MyTreeField extends TreeField implements Persistable{

	MyTreeField(TreeFieldCallback callback,long style){
		super(callback, style);
	}
	
}
unfortunatly this also results in an error message:

MyTreeField marked Persistable by interface: net.rim.device.api.util.Persistable is not Persistable: base Class net.rim.device.api.ui.component.TreeField does not implement net.rim.vm.Persistable

So what do i have to do, to implement the Persistable interface?
Offline  
Old 08-13-2007, 04:00 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8800
PIN: N/A
Carrier: t-mobile
Posts: 44
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i really could use some ideas and suggestions on this
Offline  
Old 08-13-2007, 08:50 AM   #5 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

One idea would be to store whatever data you are storing as persistent objects (String, Object even) and dynamically craete the treefields with those data points using beans or some business logic.
Offline  
Old 08-13-2007, 10:04 AM   #6 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8800
PIN: N/A
Carrier: t-mobile
Posts: 44
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i think this will be the only solution.
As there seems no way to store a TreeField persistently. I really tried hard the last two days. Also there is no object serialization provided, so that you can fetch the Treefield over the net.
I would have liked to build the TreeField once and then simply use it, and not always rebuild it, with every start of the application.
But we have to work with what we got from RIM - so this solution will do.

Thx for helping.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.