lemonisdead Well-Known Member Licensed User Longtime User Nov 16, 2017 #1 Hello, I would like to know if it should be possible to store a CSBuilder into KeyValueStore2, please. My need is to prepare some sequences with their colors & links and then use them to easily feed Labels later. My trouble is that I can store them when converted to Strings (CSB.ToString) but I can't when passed as objects. java.lang.RuntimeException: Cannot serialize object: Click to expand... Code: Copy Sub PrepareDB Private CSB As CSBuilder CSB.Initialize CSB.Typeface(Typeface.MATERIALICONS) CSB.BackgroundColor(Colors.Blue).Color(Colors.White).Append(Chr(0xE84D)) If Not(KVS.ContainsKey("csb1")) Then KVS.Put("csb1",CSB) End If End Sub And when I store as string, of course I lost the formatting. Thanks Attachments csbkvsexample.zip csbkvsexample.zip 8.2 KB · Views: 521
Hello, I would like to know if it should be possible to store a CSBuilder into KeyValueStore2, please. My need is to prepare some sequences with their colors & links and then use them to easily feed Labels later. My trouble is that I can store them when converted to Strings (CSB.ToString) but I can't when passed as objects. java.lang.RuntimeException: Cannot serialize object: Click to expand... Code: Copy Sub PrepareDB Private CSB As CSBuilder CSB.Initialize CSB.Typeface(Typeface.MATERIALICONS) CSB.BackgroundColor(Colors.Blue).Color(Colors.White).Append(Chr(0xE84D)) If Not(KVS.ContainsKey("csb1")) Then KVS.Put("csb1",CSB) End If End Sub And when I store as string, of course I lost the formatting. Thanks
Cableguy Expert Licensed User Longtime User Nov 16, 2017 #2 From what I could figure, you could pass your CSB into a list, and pass that list to the kvs2, or create your own type based on CSB, and pass that to kvs2 Upvote 0
From what I could figure, you could pass your CSB into a list, and pass that list to the kvs2, or create your own type based on CSB, and pass that to kvs2
lemonisdead Well-Known Member Licensed User Longtime User Nov 16, 2017 #3 Thanks Cableguy. It was a good idea but produces the same error as above. Well, it seems that I will have to use types and generate the labels on the fly so. Upvote 0
Thanks Cableguy. It was a good idea but produces the same error as above. Well, it seems that I will have to use types and generate the labels on the fly so.
Cableguy Expert Licensed User Longtime User Nov 16, 2017 #4 I never used kvs so I just took it from introductory post... Since kvs is a class, can't you try to create your own methods inside it to work with your object type? Upvote 0
I never used kvs so I just took it from introductory post... Since kvs is a class, can't you try to create your own methods inside it to work with your object type?
lemonisdead Well-Known Member Licensed User Longtime User Nov 16, 2017 #5 Cableguy said: can't you try to create your own methods inside it to work with your object type? Click to expand... Absolutely and I had try but the problem is with the char to serialize. It is the char that generates the error and I did not found any workaround, reason why I did ask Upvote 0
Cableguy said: can't you try to create your own methods inside it to work with your object type? Click to expand... Absolutely and I had try but the problem is with the char to serialize. It is the char that generates the error and I did not found any workaround, reason why I did ask