View Full Version : Design View and Viewmode Links: Invalid Model name

10 Nov 2017, 8:10 AM
I define a model, view and a viewModel as follow using Architect:

Ext.define('MyApp.view.FormPanel', {
extend: 'Ext.form.Panel',
alias: 'widget.formpanel',

requires: [

viewModel: {
type: 'formpanel'
title: 'My Form'


Ext.define('MyApp.view.FormPanelViewModel', {
extend: 'Ext.app.ViewModel',
alias: 'viewmodel.formpanel',

links: {
theUser: {
type: 'User',
create: true


Ext.define('MyApp.model.User', {
extend: 'Ext.data.Model',
alias: 'model.user',

requires: [

fields: [
name: 'firstname'
name: 'lastname'


Every time I go to Design View to look at the form, I get the following error in the log:


I tried setting type to 'MyApp.model.User' , 'model.User' or simply 'user' in the links config and I get the same error.

Any ideas what I am doing wrong or is this a bug?

16 Nov 2017, 10:44 AM
Not gathering a lot of replies to my question...

Was hoping someone from Sencha would pick it up to see if this is an issue, so I will post it in the bugs forum.

But to add to this, Architect cannot render a view that has Links in the ViewModel. This is annoying to me right now as I am using links in many forms and views to download/upload server data. None of them are showing up in the Design view which sorts of defeats the purpose of using Architect as a visual desing tool.

However, even if Architect has a issue dealing with links config in viewmodels, the code works perfectly fine and as expected.

Here's an archive of a small test project to show this problem. The project is using the modern toolkit.


(Could not figure out how to upload a xda file on the forum although it is supposed to be allowed...)

29 Nov 2017, 6:25 PM
I just want to confirm that I see the same error. I specified the full name of the model, and it doesn't make any difference. The form is not rendered anymore in SA which is very annoying.

Another way to do it is to simply add the record (theUser) to the data property (data: {theUser: null}) and create the User model in the override for the ViewModel - you'd have to select the ViewModel and click the CreateOverride button:

constructor: function() {
var me = this;
me.data.theUser = Ext.create('MyApp.model.User');
// debugger;

19 Mar 2018, 10:23 PM
My solution:
1. Add function initComponent (component template method)
2. Create link from code


var user = {
type: 'MyApp.model.User',
create: {
firstName: 'John',
lastName: 'Smith'

var vm = this.getViewModel();
vm.linkTo('newUser', user);