1. #1
    Sencha User mono blaine's Avatar
    Join Date
    Jul 2008
    Location
    Turkey
    Posts
    123
    Vote Rating
    8
    mono blaine will become famous soon enough

      0  

    Default [3.1.0.239] Sencha Cmd Could not Handle Alternate Class Names

    [3.1.0.239] Sencha Cmd Could not Handle Alternate Class Names


    [ExtJS 4.2.0.663]

    Sencha Cmd makes false presumptions about the location of the source file of a class if alternate class names are used and thus fails desperately.

    For instance, if

    Code:
    Ext.form.DisplayField
    is used in a "requires" config, Sencha Cmd tries to load a file located in

    Code:
    ../../ext/src/form/DisplayField.js

  2. #2
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,295
    Vote Rating
    122
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    That behavior is more how the dynamic loader processes a namespace/class when it does not have any metadata to tell it otherwise.

    Sencha Cmd parses the source and makes a map of declared classes by source file. So there may be an issue here, but it is not likely as you due to that...

    Can you provide some details on what you have in your code that is not working as expected and the error messages you get? See also http://www.sencha.com/forum/showthre...ith-Sencha-Cmd
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  3. #3
    Sencha User mono blaine's Avatar
    Join Date
    Jul 2008
    Location
    Turkey
    Posts
    123
    Vote Rating
    8
    mono blaine will become famous soon enough

      0  

    Default


    You're absolutely right

    Yes there's a problem but it probably has nothing to do with Sencha Cmd. I have created a class Foo:

    Code:
    Ext.define("Test.view.panel.Foo", {
        extend: "Ext.panel.Panel",
        alias: "widget.foopanel",
        requires: [
            "Ext.form.DisplayField"
        ]
    });
    app.js:

    Code:
    // ...
    Ext.application({
        // ...
        views: [
            // ...
            "panel.Foo"
        ],
        
        // ...
    })
    With these configurations, when the standard index.html (created by Sencha Cmd) is viewed in a browser, we get the error:

    Code:
    Uncaught Error: [Ext.Loader] Failed loading 'ext/src/form/DisplayField.js', please verify that the file exists
    So it should be a bug in Ext.Loader.

  4. #4
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,295
    Vote Rating
    122
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    What ext file are you loading for your page? The alternate name metadata is present in ext-dev.js and ext-debug.js but seems to not be present in ext.js (this may be a bug but easily worked around).

    In Cmd generated apps you get something like this:

    PHP Code:
    <!DOCTYPE HTML>
    <
    html>
    <
    head>
        <
    meta charset="UTF-8">
        <
    title>App1</title>
        <!-- <
    x-compile> -->
            <!-- <
    x-bootstrap> -->
                <
    link rel="stylesheet" href="bootstrap.css">
                <
    script src="../../ext/ext-dev.js"></script>
                <script src="bootstrap.js"></script>
            <!-- </x-bootstrap> -->
            <script src="app/app.js"></script>
        <!-- </x-compile> -->
    </head>
    <body></body>
    </html> 
    The important part there is inside the "x-bootstrap" section - we load "ext-dev.js" for doing dev mode since it is readable and contains diagnostic assistance. You don't need to use this generated file, I just mention it to show what Cmd generates as a reference.
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  5. #5
    Sencha User mono blaine's Avatar
    Join Date
    Jul 2008
    Location
    Turkey
    Posts
    123
    Vote Rating
    8
    mono blaine will become famous soon enough

      0  

    Default


    I was using ext-dev.js. Investigating as you suggest led me here:

    During initialization phase,

    Code:
    [11078] Loader.require(dependencies, /* ... */);
    is called. The parameter "dependencies" array has "Ext.form.DisplayField" in it.

    Then for each dependency,

    Code:
    [10689] possibleClassNames = Manager.getNamesByExpression(expression);
    is called. Following that,

    Code:
    [9048] possibleName = this.getNameByAlias(expression);
    And finally,

    Code:
    getNameByAlias: function(alias) {
        return this.maps.aliasToName[alias] || '';
    }
    where "alias" is "Ext.form.DisplayField".

    The closest (but not exact) match to this alias in object "this.maps.aliasToName" is

    Code:
    Ext.form.DisplayField,Ext.form.Display: "Ext.form.field.Display"
    So this function returns an empty string, causing the loader the think that "Ext.form.DisplayField" is really a class name, not an alias.

    I think those fields are not supposed to be stored together, comma-separated. Shouldn't that be the following instead?

    Code:
    Ext.form.DisplayField: "Ext.form.field.Display",
    Ext.form.Display: "Ext.form.field.Display"
    There are also other fields like this.

  6. #6
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,295
    Vote Rating
    122
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    I will have to look in to what you are describing because this name should not appear in the aliases map at all let alone in the incorrect form you show there.

    This name should appear in the Ext.ClassManager.maps.alternateToName (and nameToAlternates) collection keyed by just one name.
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  7. #7
    Sencha User mono blaine's Avatar
    Join Date
    Jul 2008
    Location
    Turkey
    Posts
    123
    Vote Rating
    8
    mono blaine will become famous soon enough

      0  

    Default


    Ok, you're gonna hate me. I was wrong about the "getNameByAlias" part. That method is called, returns nothing, and then "getNameByAlternate" is called and there it seems the Ext.ClassManager.maps.alternateToName is weird. Here is what it looks like:

    Code:
    Ext.AbstractSelectionModel: "Ext.selection.Model"
    Ext.BoundList: "Ext.view.BoundList"
    Ext.Button: "Ext.button.Button"
    Ext.ButtonGroup: "Ext.container.ButtonGroup"
    Ext.ButtonToggleManager: "Ext.button.Manager"
    Ext.ColorPalette: "Ext.picker.Color"
    Ext.ComponentMgr: "Ext.ComponentManager"
    Ext.CompositeElement: "Ext.dom.CompositeElement"
    Ext.CompositeElementLite: "Ext.dom.CompositeElementLite"
    Ext.Container: "Ext.container.Container"
    Ext.CycleButton: "Ext.button.Cycle"
    Ext.DataView: "Ext.view.View"
    Ext.DatePicker: "Ext.picker.Date"
    Ext.Direct.Transaction: "Ext.direct.Transaction"
    Ext.Element: "Ext.dom.Element"
    Ext.FlashComponent: "Ext.flash.Component"
    Ext.FocusMgr: "Ext.FocusManager"
    Ext.FormPanel,Ext.form.FormPanel: "Ext.form.Panel"
    Ext.History: "Ext.util.History"
    Ext.KeyMap: "Ext.util.KeyMap"
    Ext.KeyNav: "Ext.util.KeyNav"
    Ext.Layer: "Ext.dom.Layer"
    Ext.ModelMgr: "Ext.ModelManager"
    Ext.MonthPicker: "Ext.picker.Month"
    Ext.PagingToolbar: "Ext.toolbar.Paging"
    Ext.Panel: "Ext.panel.Panel"
    Ext.Perf: "Ext.perf.Monitor"
    Ext.PluginMgr: "Ext.PluginManager"
    Ext.PropGridProperty: "Ext.grid.property.Property"
    Ext.QuickTip: "Ext.tip.QuickTip"
    Ext.QuickTips: "Ext.tip.QuickTipManager"
    Ext.Resizable: "Ext.resizer.Resizer"
    Ext.Slider,Ext.form.SliderField,Ext.slider.SingleSlider,Ext.slider.Slider: "Ext.slider.Single"
    Ext.SplitButton: "Ext.button.Split"
    Ext.StoreManager: "Ext.data.StoreManager"
    Ext.StoreMgr: "Ext.data.StoreManager"
    Ext.StoreMgr,Ext.data.StoreMgr,Ext.StoreManager: "Ext.data.StoreManager"
    Ext.TabPanel: "Ext.tab.Panel"
    Ext.TaskManager: "Ext.util.TaskManager"
    Ext.Tip: "Ext.tip.Tip"
    Ext.ToolTip: "Ext.tip.ToolTip"
    Ext.Toolbar: "Ext.toolbar.Toolbar"
    Ext.Toolbar.Fill: "Ext.toolbar.Fill"
    Ext.Toolbar.Item: "Ext.toolbar.Item"
    Ext.Toolbar.Separator: "Ext.toolbar.Separator"
    Ext.Toolbar.Spacer: "Ext.toolbar.Spacer"
    Ext.Toolbar.TextItem: "Ext.toolbar.TextItem"
    Ext.Viewport: "Ext.container.Viewport"
    Ext.Window: "Ext.window.Window"
    Ext.WindowGroup: "Ext.ZIndexManager"
    Ext.chart.Axis: "Ext.chart.axis.Axis"
    Ext.chart.BarChart: "Ext.chart.series.Bar"
    Ext.chart.BarSeries: "Ext.chart.series.Bar"
    Ext.chart.BarSeries,Ext.chart.BarChart,Ext.chart.StackedBarChart: "Ext.chart.series.Bar"
    Ext.chart.CartesianChart: "Ext.chart.series.Cartesian"
    Ext.chart.CartesianSeries: "Ext.chart.series.Cartesian"
    Ext.chart.CartesianSeries,Ext.chart.CartesianChart: "Ext.chart.series.Cartesian"
    Ext.chart.CategoryAxis: "Ext.chart.axis.Category"
    Ext.chart.ColumnChart: "Ext.chart.series.Column"
    Ext.chart.ColumnSeries: "Ext.chart.series.Column"
    Ext.chart.ColumnSeries,Ext.chart.ColumnChart,Ext.chart.StackedColumnChart: "Ext.chart.series.Column"
    Ext.chart.LineChart: "Ext.chart.series.Line"
    Ext.chart.LineSeries: "Ext.chart.series.Line"
    Ext.chart.LineSeries,Ext.chart.LineChart: "Ext.chart.series.Line"
    Ext.chart.NumericAxis: "Ext.chart.axis.Numeric"
    Ext.chart.PieChart: "Ext.chart.series.Pie"
    Ext.chart.PieSeries: "Ext.chart.series.Pie"
    Ext.chart.PieSeries,Ext.chart.PieChart: "Ext.chart.series.Pie"
    Ext.chart.StackedBarChart: "Ext.chart.series.Bar"
    Ext.chart.StackedColumnChart: "Ext.chart.series.Column"
    Ext.chart.TimeAxis: "Ext.chart.axis.Time"
    Ext.core.Element: "Ext.dom.Element"
    Ext.data.AjaxProxy: "Ext.data.proxy.Ajax"
    Ext.data.ArrayReader: "Ext.data.reader.Array"
    Ext.data.Association: "Ext.data.association.Association"
    Ext.data.BelongsToAssociation: "Ext.data.association.BelongsTo"
    Ext.data.ClientProxy: "Ext.data.proxy.Client"
    Ext.data.DataProxy: "Ext.data.proxy.Proxy"
    Ext.data.DataProxy,Ext.data.Proxy: "Ext.data.proxy.Proxy"
    Ext.data.DataReader: "Ext.data.reader.Reader"
    Ext.data.DataWriter: "Ext.data.writer.Writer"
    Ext.data.DataWriter,Ext.data.Writer: "Ext.data.writer.Writer"
    Ext.data.DirectProxy: "Ext.data.proxy.Direct"
    Ext.data.HasManyAssociation: "Ext.data.association.HasMany"
    Ext.data.HasOneAssociation: "Ext.data.association.HasOne"
    Ext.data.HttpProxy: "Ext.data.proxy.Ajax"
    Ext.data.HttpProxy,Ext.data.AjaxProxy: "Ext.data.proxy.Ajax"
    Ext.data.JsonReader: "Ext.data.reader.Json"
    Ext.data.JsonWriter: "Ext.data.writer.Json"
    Ext.data.LocalStorageProxy: "Ext.data.proxy.LocalStorage"
    Ext.data.MemoryProxy: "Ext.data.proxy.Memory"
    Ext.data.PagingMemoryProxy: "Ext.ux.data.PagingMemoryProxy"
    Ext.data.Proxy: "Ext.data.proxy.Proxy"
    Ext.data.Reader: "Ext.data.reader.Reader"
    Ext.data.Reader,Ext.data.DataReader: "Ext.data.reader.Reader"
    Ext.data.Record: "Ext.data.Model"
    Ext.data.RestProxy: "Ext.data.proxy.Rest"
    Ext.data.ScriptTagProxy: "Ext.data.proxy.JsonP"
    Ext.data.ServerProxy: "Ext.data.proxy.Server"
    Ext.data.SessionStorageProxy: "Ext.data.proxy.SessionStorage"
    Ext.data.StoreMgr: "Ext.data.StoreManager"
    Ext.data.WebStorageProxy: "Ext.data.proxy.WebStorage"
    Ext.data.Writer: "Ext.data.writer.Writer"
    Ext.data.XmlReader: "Ext.data.reader.Xml"
    Ext.data.XmlWriter: "Ext.data.writer.Xml"
    Ext.dd.DDM: "Ext.dd.DragDropManager"
    Ext.dd.DragDropMgr: "Ext.dd.DragDropManager"
    Ext.dd.DragDropMgr,Ext.dd.DDM: "Ext.dd.DragDropManager"
    Ext.dd.PanelProxy: "Ext.panel.Proxy"
    Ext.form.Action: "Ext.form.action.Action"
    Ext.form.Action.DirectLoad: "Ext.form.action.DirectLoad"
    Ext.form.Action.DirectSubmit: "Ext.form.action.DirectSubmit"
    Ext.form.Action.Load: "Ext.form.action.Load"
    Ext.form.Action.Submit: "Ext.form.action.Submit"
    Ext.form.BasicForm: "Ext.form.Basic"
    Ext.form.Checkbox: "Ext.form.field.Checkbox"
    Ext.form.ComboBox: "Ext.form.field.ComboBox"
    Ext.form.DateField,Ext.form.Date: "Ext.form.field.Date"
    Ext.form.DisplayField,Ext.form.Display: "Ext.form.field.Display"
    Ext.form.Field,Ext.form.BaseField: "Ext.form.field.Base"
    Ext.form.FileUploadField,Ext.ux.form.FileUploadField,Ext.form.File: "Ext.form.field.File"
    Ext.form.Hidden: "Ext.form.field.Hidden"
    Ext.form.HtmlEditor: "Ext.form.field.HtmlEditor"
    Ext.form.NumberField,Ext.form.Number: "Ext.form.field.Number"
    Ext.form.Picker: "Ext.form.field.Picker"
    Ext.form.Radio: "Ext.form.field.Radio"
    Ext.form.Spinner: "Ext.form.field.Spinner"
    Ext.form.TextArea: "Ext.form.field.TextArea"
    Ext.form.TextField,Ext.form.Text: "Ext.form.field.Text"
    Ext.form.TimeField,Ext.form.Time: "Ext.form.field.Time"
    Ext.form.TriggerField,Ext.form.TwinTriggerField,Ext.form.Trigger: "Ext.form.field.Trigger"
    Ext.form.VTypes: "Ext.form.field.VTypes"
    Ext.grid.ActionColumn: "Ext.grid.column.Action"
    Ext.grid.BooleanColumn: "Ext.grid.column.Boolean"
    Ext.grid.Column: "Ext.grid.column.Column"
    Ext.grid.DateColumn: "Ext.grid.column.Date"
    Ext.grid.Lockable: "Ext.grid.locking.Lockable"
    Ext.grid.LockingView: "Ext.grid.locking.View"
    Ext.grid.NumberColumn: "Ext.grid.column.Number"
    Ext.grid.PropertyColumnModel: "Ext.grid.property.HeaderContainer"
    Ext.grid.PropertyGrid: "Ext.grid.property.Grid"
    Ext.grid.PropertyStore: "Ext.grid.property.Store"
    Ext.grid.TemplateColumn: "Ext.grid.column.Template"
    Ext.layout.AbsoluteLayout: "Ext.layout.container.Absolute"
    Ext.layout.AccordionLayout: "Ext.layout.container.Accordion"
    Ext.layout.AnchorLayout: "Ext.layout.container.Anchor"
    Ext.layout.BorderLayout: "Ext.layout.container.Border"
    Ext.layout.BoxLayout: "Ext.layout.container.Box"
    Ext.layout.CardLayout: "Ext.layout.container.Card"
    Ext.layout.ColumnLayout: "Ext.layout.container.Column"
    Ext.layout.ContainerLayout: "Ext.layout.container.Container"
    Ext.layout.FitLayout: "Ext.layout.container.Fit"
    Ext.layout.FormLayout: "Ext.layout.container.Form"
    Ext.layout.HBoxLayout: "Ext.layout.container.HBox"
    Ext.layout.TableLayout: "Ext.layout.container.Table"
    Ext.layout.VBoxLayout: "Ext.layout.container.VBox"
    Ext.layout.boxOverflow.Menu: "Ext.layout.container.boxOverflow.Menu"
    Ext.layout.boxOverflow.None: "Ext.layout.container.boxOverflow.None"
    Ext.layout.boxOverflow.Scroller: "Ext.layout.container.boxOverflow.Scroller"
    Ext.layout.component.AbstractDock: "Ext.layout.component.Dock"
    Ext.list.ListView,Ext.ListView,Ext.grid.GridPanel: "Ext.grid.Panel"
    Ext.menu.MenuMgr: "Ext.menu.Manager"
    Ext.menu.TextItem: "Ext.menu.Item"
    Ext.slider.MultiSlider: "Ext.slider.Multi"
    Ext.tree.TreePanel,Ext.TreePanel: "Ext.tree.Panel"
    Ext.ux.CheckColumn: "Ext.grid.column.CheckColumn"
    Ext.ux.ItemSelector: "Ext.ux.form.ItemSelector"
    Ext.ux.Multiselect: "Ext.ux.form.MultiSelect"
    Ext.ux.StatusBar: "Ext.ux.statusbar.StatusBar"

Thread Participants: 1