Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

mojitProxy.config not being updated after mojtiProxy.refreshView #1046

denchen opened this Issue Mar 23, 2013 · 1 comment


None yet
2 participants

denchen commented Mar 23, 2013

When setting ac.instance.config. after a call to mojitProxy.refreshView(), mojitProxy.config does not get updated to reflect new variable.

The relevant portions of my test code:


index: function(ac) {
    var refresh = ac.params.getFromMerged("refresh", undefined);
    if (refresh) {
        Y.log("Setting 'Refreshed!'", "debug", NAME);
        ac.instance.config.refreshtext = "Refreshed!";
    } else {
        Y.log("Setting 'Unrefreshed'", "debug", NAME);
        ac.instance.config.refreshtext = "Unrefreshed";
    Y.log("Calling ac.done with ac.instance.config.refreshtext = " + ac.instance.config.refreshtext, "debug", NAME);

=== BINDER ===

bind: function(node) {
    var me = this,

    this.node = node;

    Y.log("Setting input field text to: " + this.mojitProxy.config.refreshtext, "debug", NAME);
    inputfield = node.one("#inputfield");
    inputfield.set('value', this.mojitProxy.config.refreshtext);

    Y.log("Adding button", "debug", NAME);
    button = new Y.Button({
    srcNode: "#refreshbutton",
        on: {
            'click': function () {
                Y.log("Button clicked!", "debug", NAME);
                    "params": {
                        "url": {
                            "refresh": 1
                    "rpc": true
                }, function(err, data) {
                    Y.log("Refresh view successful", "debug", NAME);

onRefreshView: function (node, element) {
    Y.log("onRefreshView() called", "debug", NAME);
    this.bind(node, element);

=== VIEW ===

<div id="{{mojit_view_id}}">
<input id="inputfield" name="inputfield" />
<button id="refreshbutton" name="refreshbutton">Refresh Page</button>

@ghost ghost assigned caridy Mar 23, 2013


caridy commented Mar 23, 2013

Workaround, from Yi:

In controller: ac.done(data, Y.mix(meta, {yourVar: xxx}));
In binder: 
mojitProxy.refreshView(params, function(data, meta) {
    var yourVar = meta.yourVar;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment