Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: [1]
1  PureMVC Manifold / Bug Report / Re: Bug in mediator and views components on: February 19, 2009, 08:37:35
I have found the difference between ASC3 view component and JS view component "Role Panel"

In ASC3, you have :
        <!-- Add Role Button -->
        <mx:Button label="Add" click="sendEvent( ADD )"
            enabled="{roleCombo.selectedItem != RoleEnum.NONE_SELECTED}"/>

In JS :
document.getElementById('addRoleButton').onclick = Relegate.create(this,this.__onAdd);

In JS you should rather use something like :
document.getElementById('addRoleButton').onclick = sendEvent( ADD );

And then adapt the PureMVC JS framework to work that way.
2  PureMVC Manifold / Bug Report / [Deprecated port] Bug in mediator and views components on: February 19, 2009, 07:39:14
I may have found a bug of conception in this PureMVC javascript port :

I found it by following one specific action in the EmployeeAdmin sample.

In the ApplicationFacade.startup method, the app object is given : it is the Dom node of id="application" with 3 properties :
application.userForm, application.userList and application.rolePanel. I followed the rolePanel component.

application.rolePanel is the Dom node of id="roleListPanel".

I followed the reference into the PureMVC code, and found it finally used in the RolePanelMediator (that seems logic).

The problème is, in RolePanelMediator, an eventListener is binded like this :

rolePanel.addEventListener( RolePanel.ADD, Relegate.create(this,this._onAddRole) );

Where rolePanel is the Dom node of id="roleListPanel".
This action does nothing to me : you add an eventListener on a "div" Dom node. The equivalent action is in fact done in the RolePanel view component by :

document.getElementById('addRoleButton').onclick = Relegate.create(this,this.__onAdd);

Which is not the right place in the PureMVC philosophy to bind event listeners.

Unless I am totally wrong, there is a problem somewhere.

I think there is 2 solutions :
1) removing the Mediator role for binding event listeners, and every unused arguments (starting with argument app in ApplicationFacade.startup).
2) removing the bindings in views components and finding a solution to keep the Mediator role.

The 2nd solution follows PureMVC philosophy but seems harder to proceed.

I hope that I'm right, and that this post will be useful !
Pages: [1]