Aaaaah, I had a scope issue, sorry about that. Now everything works as it's
supposed to :)

var that = this;
function myCallBack(result) {
    var model = qx.data.marshal.Json.createModel(result);
    that.__treeController.setModel(model);
}



Dr. Flink wrote:
> 
> This wont work either:
> 
> function myCallBack(result) {
>     var model = qx.data.marshal.Json.createModel(result);
>     alert(model); // alerts: 'qx.data.model.folders"icon"id"name"type[fj]'
>     this.__treeController.setModel(model);
> }
> 
> 
> Dr. Flink wrote:
>> 
>> Hi Martin!
>> 
>> I tried doing this:
>> 
>> var store = new qx.data.controller.Object();
>> function myCallBack(result) {
>>     var model = qx.data.marshal.Json.createModel(result); // result from
>> rpc-call
>>     store.setModel(model);
>>     store.bind("model", this.__treeController, "model");
>> }
>> 
>> ...I thought this could work, but nothing seems to happen. Have I
>> misunderstood something?
>> 
>> 
>> MartinWittemann wrote:
>>> 
>>> Hi Rickard,
>>> we don't have such a store build in so far. But it depends on what you
>>> want to do with the store. If you only want to access some JSON data
>>> delivered by a RPC, you can subclass the JSON store and override the
>>> _createRequest method. In that, you can create the RPC. If you want to
>>> have some more interaction with the RPC server, you maybe have to write
>>> your own store. But thats not too hard either because the store only
>>> needs to take care of getting the data into a JavaScript object. The
>>> rest can handle the marshaler (qx.data.marshal.Json) for you.
>>> Best,
>>> Martin
>>> 
>>> 
>>> Dr. Flink wrote:
>>>> 
>>>> Hi, I would like to know the easiest way to create a store from a RPC
>>>> call? The store is going to bind to the tree controller.
>>>> 
>>>> Something like:
>>>> var myStore = new myRPCRequester('service', 'service:operation');
>>>> myStore.bind(treeController);
>>>> 
>>>> Is this possible some how? Or do I need to iterate the response to
>>>> create a model?
>>>> 
>>>> 
>>>> Best regards
>>>> Rickard
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Bind-tree-controller-to-a-composite-container-tp4255140p4398111.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to