Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    PortalLayout:getObjectField: no schema exists for: [PortalLayout ID:landingpagePortalLayout]

    Hi Everyone,

    I'm using the evaluation version of SmartClient.
    I'm trying to implement something like this example: https://smartclient.com/smartclient/...ortalDashboard
    However, I'm getting the following warnings:

    WARN:PortalLayout:landingpagePortalLayout:getObjectField: no schema exists for: [PortalLayout ID:landingpagePortalLayout]

    ISC_Core.js:29557 *14:46:17.004:WARN:EditContext:editPane_editContext:can't addNode: can't find a field in parent: [PortalLayout ID:landingpagePortalLayout] for a new child of type: PortalColumn, parent property:undefined, newNode is: {type: "PortalColumn", _constructor: "PortalColumn", idName: undef, idPrefix: undef, canDuplicate: undef, title: undef, icon: undef, iconSize: undef, showDropIcon: undef, useEditMask: undef, autoGen: undef, editProxyProperties: undef, ID: "PortalColumn0", liveObject: [PortalColumn ID:PortalColumn0], defaults: Obj{ID:PortalColumn0}}


    I have the following code in CoffeeScript:
    Code:
    isc.defineClass('LandingpagesPane', isc.SplitPane).addProperties
    ID: "splitPane"
    width: "100%"
    height: "100%"
    showLeftButton:true
    showRightButton:false
    initWidget: ->
    @Super("initWidget", arguments)
    defaultPalette = isc.ListPalette.create
    ID: 'listPalette'
    leaveScrollbarGap: false
    fields: [ {
    name: 'title'
    title: 'Component'
    } ]
    data: [{
    title: "Scope Items"
    type: "ItemsPortletGrid"
    defaults: {
    dataSource: isc.ItemsDataSource.create()
    autoFetchData: true
    showFilterEditor: true
    groupStartOpen:"all"
    groupByField: 'project_name'
    }
    }
    {
    title: "Cause / Consequences"
    type: "CauseConsequencesGrid"
    defaults: {
    dataSource: isc.CauseConsequencesDataSource.create()
    autoFetchData: true
    showFilterEditor: true
    groupStartOpen:"all"
    groupByField: 'project_name'
    }
    }
    {
    title: "Comments"
    type: "CommentsGrid"
    defaults: {
    dataSource: isc.CommentsDataSource.create()
    autoFetchData: true
    showFilterEditor: true
    groupStartOpen:"all"
    groupByField: ['commentable_project_name','commentable_code']
    }
    }
    {
    title: "Decisions"
    type: "DecisionsGrid"
    defaults: {
    dataSource: isc.DecisionsDataSource.create()
    autoFetchData: true
    showFilterEditor: true
    groupStartOpen:"all"
    groupByField: 'project_name'
    }
    }
    {
    title: "Issues"
    type: "IssuesGrid"
    defaults: {
    dataSource: isc.IssuesDataSource.create()
    autoFetchData: true
    showFilterEditor: true
    groupStartOpen:"all"
    groupByField: 'project_name'
    }
    }
    {
    title: "Risk Events"
    type: "EventsGrid"
    defaults: {
    dataSource: isc.EventsDataSource.create()
    autoFetchData: true
    showFilterEditor: true
    groupStartOpen:"all"
    groupByField: 'project_name'
    }
    }
    {
    title: "Risk Responses"
    type: "RiskAssessmentsGrid"
    defaults: {
    dataSource: isc.RiskAssessmentsDataSource.create()
    autoFetchData: true
    showFilterEditor: true
    groupStartOpen:"all"
    groupByField: 'project_name'
    }
    }
    {
    title: "Mitigating Controls"
    type: "MitigatingControlsGrid"
    defaults: {
    dataSource: isc.MitigatingControlsDataSource.create()
    autoFetchData: true
    showFilterEditor: true
    groupStartOpen:"all"
    groupByField: 'project_name'
    }
    }]
    isc.EditPane.create
    ID: "editPane"
    
    defaultPalette.setDefaultEditContext(editPane)
    editPane.setDefaultPalette(defaultPalette)
    initialPortalPaletteNode = {
    type: "PortalLayout"
    defaults: {
    ID: "landingpagePortalLayout"
    width: "100%"
    height: "100%"
    numColumns: 1
    canResizePortlets: true
    portletsChanged: ->
    console.log("test")
    }
    }
    editNode = editPane.addFromPaletteNode (initialPortalPaletteNode)
    editPane.getEditContext().defaultParent = editNode;
    @setNavigationPane(defaultPalette)
    @setDetailPane(editPane)
    return
    I have basically loaded every script to be sure (since I find it hard to determine what modules are required for what):

    <script src="/isomorphic/system/modules-debug/ISC_Core.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_Foundation.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_Containers.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_Grids.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_Forms.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_DataBinding.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_AceEditor.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_Calendar.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_ClassBrowser.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_Drawing.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_DSBrowser.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_EBay.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_Gmail.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_History.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_Kapow.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_PluginBridges.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_ReferenceDocs.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_RichTextEditor.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_SalesForce.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_Scheduler.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_SQLBrowser.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_SystemSchema.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_Workflow.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_Charts.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_VisualBuilder.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_AdminConsole.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_DocViewer.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_FileBrowser.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_FileLoader.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_SkinUtil.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_Analytics.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_RealtimeMessaging.js"></script>
    <script src="/isomorphic/system/modules-debug/ISC_Tools.js"></script>

    Note, I'm not using SmartGWT, we are building our application on Rails.

    I did notice the following line in the documentation:

    Any tools that work with hierarchies of system components or derivations of them will also need the system schema which can be loaded by either of the following:

    JSP tag:
    <script><isomorphic:loadSystemSchema /></script>
    HTML tag:
    <SCRIPT SRC="../isomorphic/DataSourceLoader?dataSource=$systemSchema"></SCRIPT> But I'm not sure what this does and how to get this working in a Rails based environment.

    Hope you can help me.

    #2
    The QuickStart Guide explains what modules to load for a normal application, and gives examples and templates.

    Do not add any additional modules unless and until the docs tell you to for some use case you are exploring. You have created a kind of "app soup" that doesn't make any sense and would break many things.

    Comment


      #3
      Hi,

      I reduced the loaded modules to the following, but I still have the same error

      <script src="/isomorphic/system/modules-debug/ISC_Core.js"></script>
      <script src="/isomorphic/system/modules-debug/ISC_Foundation.js"></script>
      <script src="/isomorphic/system/modules-debug/ISC_Containers.js"></script>
      <script src="/isomorphic/system/modules-debug/ISC_Grids.js"></script>
      <script src="/isomorphic/system/modules-debug/ISC_Forms.js"></script>
      <script src="/isomorphic/system/modules-debug/ISC_DataBinding.js"></script>
      <script src="/isomorphic/system/modules-debug/ISC_Drawing.js"></script>
      <script src="/isomorphic/system/modules-debug/ISC_Tools.js"></script>

      Thanks.

      Comment


        #4
        No really, just use the ones in the QuickStart (no Tools for example).

        Comment


          #5
          Hi,

          Ok, I'm a bit confused now. According to the API documentation https://www.smartclient.com/smartcli...e.downloadFile
          Tools is required for EditPane, EditNode, EditContext and ListPalette.
          Without the Drawing module I get the following error:

          Code:
          ISC_Core.js:50370 Uncaught TypeError: isc.isA.DrawItem is not a function
              at cons.saveCoordinates (ISC_DataBinding.js:75205)
              at cons.childResized (ISC_Core.js:82009)
              at cons._resized (ISC_Core.js:81864)
              at cons._completeResizeBy (ISC_Core.js:81825)
              at cons.moveBy (ISC_Core.js:80761)
              at cons.moveTo (ISC_Core.js:81343)
              at cons.setRect (ISC_Core.js:77183)
              at cons._resolvePercentageSize (ISC_Core.js:82775)
              at cons.parentResized (ISC_Core.js:82750)
              at cons._resolveChildPercentSizes (ISC_Core.js:82102)
              at cons.layoutChildren (ISC_Core.js:82094)
              at cons._completeResizeBy (ISC_Core.js:81796)
              at cons.resizeBy (ISC_Core.js:81751)
              at cons.resizeTo (ISC_Core.js:82153)
              at cons._setDetailPane (ISC_Foundation.js:34953)
              at cons.setDetailPane (ISC_Foundation.js:34972)
              at cons.initWidget (LandingpagesPane.source.coffee:124)
              at cons.init (ISC_Core.js:70739)
              at cons.completeCreation (ISC_Core.js:8414)
              at cons.create (ISC_Core.js:5707)
              at cons.getLandingTabSet (Application.source.coffee:92)
              at cons.initWidget (Application.source.coffee:103)
              at cons.init (ISC_Core.js:70739)
              at cons.completeCreation (ISC_Core.js:8414)
              at cons.create (ISC_Core.js:5707)
              at Object.action (en:880)
              at cons.handleEvent (ISC_Core.js:48830)
              at handleLoad (ISC_Core.js:50366)
          Without Tools, but with Drawing, I'm getting the same error.

          Thanks.

          Comment


            #6
            I found the answer.
            The following module was required:
            <script src="/isomorphic/system/modules/ISC_SystemSchema.js"></script>
            The problem was that I was using modules-debug:
            <script src="/isomorphic/system/modules-debug/ISC_SystemSchema.js"></script>
            But ISC_SystemSchema.js does not exist in modules-debug, just in modules.

            As to my question in the original post:
            JSP tag:
            <script><isomorphic:loadSystemSchema /></script>
            HTML tag:
            <SCRIPT SRC="../isomorphic/DataSourceLoader?dataSource=$systemSchema"></SCRIPT> But I'm not sure what this does and how to get this working in a Rails based environment.
            The answer is including ISC_SystemSchema.js is a way to replace the the above tags.
            This should be added to the API documentation. This is also not documented in the quickstart guide.

            Comment


              #7
              That's may not be the right solution...

              The approach you're taking right now is to use the Dashboards & Tools module, which allows you to build applications that end users can use to build other applications - it basically allows you to build development and design tools in a browser.

              This is part of the Enterprise edition of our product (see https://www.smartclient.com/product/) and you can learn about it here, which is also where it would explain that you need to load the Tools module and you need to loadSystemSchema. So it's all well documented.

              This is a really really powerful, heavy duty system - one of the other samples of this module shows the creation of something close to the mockup tool Balsamiq with very, very short code.

              If that's what you had in mind, great! Please read up on it and let us know if you have questions.

              On the other hand if what you wanted was just to have some portlets and save and restore the layout, and you expected to use the free (LGPL) product, start instead with these samples. You'll need to do the persistence yourself rather than use the Dashboards & Tools Module, but then again the Dashboards & Tools module is overkill if all you plan to make editable is positions and portlet types - again the Dashboards & Tools module is for people building web-based application builders.

              Comment


                #8
                Thank you for your concern. I imagine you have many users who make the mistake of using modules from the Enterprise edition, while expecting to use the LGPL version.

                But this is what we wanted and the reason why we are evaluating the Enterprise Edition. To us, our development time is more valuable than your licensing fee, but aside from the power and ease of your framework, the level and professionality of support you offer will ultimately determine whether we will choose your framework or not. Because if your level and professionality of your support is not up to par, we cannot deliver the level and professionality of support we require to our clients.

                I do hope we will come to better answers, now that the assumption that we are only interested in the LGPL product is out of the way, because we do like your framework.

                I'm running into the next problem.

                When I run the following command:

                test = editPane.serializeAllEditNodesAsJSON();
                editPane.addPaletteNodesFromJSON(test)

                I get the following error:
                ISC_Containers.js:6316 Uncaught TypeError: Cannot read property '_portlet' of undefined
                at ISC_Containers.js:6316
                at Array.map [as _nativeMap] (<anonymous>)
                at Array.map (ISC_Core.js:13371)
                at cons.addMembers (ISC_Containers.js:6314)
                at cons.addPortlets (ISC_Containers.js:6393)
                at cons.initWidget (ISC_Containers.js:5889)
                at cons.init (ISC_Core.js:70739)
                at cons.completeCreation (ISC_Core.js:8414)
                at cons.create (ISC_Core.js:5707)
                at Object.newInstance (ISC_Core.js:4860)
                at cons.createLiveObject (ISC_DataBinding.js:77239)
                at cons.makeEditNode (ISC_DataBinding.js:77018)
                at cons.makeEditNode (ISC_DataBinding.js:72510)
                at cons.addFromPaletteNodes (ISC_DataBinding.js:73679)
                at cons.addPaletteNodesFromJSON (ISC_DataBinding.js:73372)
                at cons.addPaletteNodesFromJSON (ISC_DataBinding.js:78019)
                at <anonymous>:1:10

                The variable test contains the following:
                [{"_defaultedAutoDraw":true,"autoDraw":false,"autoID":"ItemsPortletGrid0","dataSource":{"ID":"isc_ItemsDataSource_4","fields":[{"hidden":true,"name":"id","primaryKey":true,"type":"text","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true},"title":"Id","_titleAutoDerived":true},{"name":"active_activities","required":false,"canSort":false,"title":"translation missing: en.active_activities","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"activities","required":false,"canSort":false,"title":"translation missing: en.activities","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"children","required":false,"canSort":false,"title":"Sub Scope item","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"classification_cost","required":false,"canSort":true,"title":"Cost","length":255,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"classification_other","required":false,"canSort":true,"title":"Other","length":255,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"classification_scope","required":false,"canSort":true,"title":"Scope","length":255,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"classification_time","required":false,"canSort":true,"title":"Time","length":255,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"code","required":false,"canSort":true,"title":"WP Number","length":20,"type":"text","editorType":"WQMTextItem","treeField":true,"_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"comments","required":false,"canSort":false,"title":"translation missing: en.comments","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"contractor","required":false,"canSort":false,"title":"Contractor","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"defaultValue":false,"name":"contractor_led","required":false,"canSort":true,"title":"Contractor led?","type":"boolean","editorType":"WQMCheckboxItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isBoolean","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"equals","name":"boolean","_normalized":true}},{"canEdit":false,"name":"contractor_name","required":false,"canSort":true,"title":"Contractor","length":50,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"contractor_owner_name","required":false,"canSort":true,"title":"Owner","length":255,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"created_by","required":false,"canSort":false,"title":"Created by","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"created_by_full_name","required":false,"canSort":true,"title":"Created by","length":255,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"current_float","required":false,"canSort":true,"textAlign":"right","type":"localeInt","editorType":"WQMIntegerItem","_typeDefaultsAdded":true,"_simpleType":{"inheritsFrom":"integer","name":"localeInt","validators":[{"type":"isInteger","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":"Must be a whole number.","resultingValue":null}],"_normalized":true},"title":"Current Float","_titleAutoDerived":true},{"name":"decisions","required":false,"canSort":false,"title":"translation missing: en.decisions","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"events","required":false,"canSort":false,"title":"translation missing: en.events","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"finish_at","required":false,"canSort":true,"title":"Scheduled finish","format":"dd/MM/yyyy","type":"datetime","inputFormat":"DMY","useTextField":true,"editorType":"WQMDateTimeItem","_typeDefaultsAdded":true,"_simpleType":{"inheritsFrom":"date","name":"datetime","validators":[{"type":"isDate","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true}],"_normalized":true}},{"name":"hyperlinks","required":false,"canSort":false,"title":"translation missing: en.hyperlinks","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"defaultValue":false,"name":"isFolder","required":false,"canSort":true,"title":"translation missing: en.isFolder","type":"boolean","editorType":"WQMCheckboxItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isBoolean","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"equals","name":"boolean","_normalized":true}},{"name":"issues","required":false,"canSort":false,"title":"translation missing: en.issues","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"issues_cost","required":false,"canSort":false,"title":"translation missing: en.issues_cost","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"issues_other","required":false,"canSort":false,"title":"translation missing: en.issues_other","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"issues_scope","required":false,"canSort":false,"title":"translation missing: en.issues_scope","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"issues_time","required":false,"canSort":false,"title":"translation missing: en.issues_time","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"owner","required":true,"canSort":false,"title":"Owner","displayField":"user_full_name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true},"validators":[{"type":"required","errorMessage":null}]},{"canEdit":false,"name":"owner_user_full_name","required":false,"canSort":true,"title":"Owner","length":255,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"owner_user_reports_to","required":false,"canSort":false,"title":"Reports to","displayField":"full_name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"parent","required":false,"canSort":false,"title":"Parent Scope item","displayField":"code","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"defaultValue":0,"name":"physical_percentage_complete","required":true,"canSort":true,"title":"Phys. % compl.","textAlign":"right","validators":[{"type":"custom"},{"type":"custom"},{"type":"required","errorMessage":"Field is required","defaultErrorMessage":null}],"type":"localeInt","editorType":"WQMIntegerItem","_typeDefaultsAdded":true,"_simpleType":{"inheritsFrom":"integer","name":"localeInt","validators":[{"type":"isInteger","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":"Must be a whole number.","resultingValue":null}],"_normalized":true}},{"name":"predecessors","required":false,"canSort":false,"title":"translation missing: en.predecessors","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"procedure","required":false,"canSort":false,"title":"Process","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"procedure_name","required":false,"canSort":true,"title":"Name","length":100,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"project","required":false,"canSort":false,"displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true},"title":"Project","_titleAutoDerived":true},{"canEdit":false,"name":"project_name","required":false,"canSort":true,"title":"Project","length":50,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"sharepoint_site","required":false,"canSort":true,"title":"Sharepoint","length":255,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"start_at","required":false,"canSort":true,"title":"Scheduled start","format":"dd/MM/yyyy","type":"datetime","inputFormat":"DMY","useTextField":true,"editorType":"WQMDateTimeItem","_typeDefaultsAdded":true,"_simpleType":{"inheritsFrom":"date","name":"datetime","validators":[{"type":"isDate","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true}],"_normalized":true}},{"canEdit":false,"name":"status_code","required":false,"canSort":true,"title":"Status","allowEmptyValue":true,"displayField":"name","editorType":"WQMSelectItem","type":"text","optionDataSource":"ITEM_STATUS_ENUM","valueField":"code","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"steps","required":false,"canSort":false,"title":"translation missing: en.steps","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"successors","required":false,"canSort":false,"title":"translation missing: en.successors","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"target_status_code","required":false,"canSort":true,"title":"Target status","allowEmptyValue":true,"displayField":"name","editorType":"WQMSelectItem","type":"text","optionDataSource":"ITEM_STATUS_ENUM","valueField":"code","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"title","required":true,"canSort":true,"title":"Title","length":100,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true},"validators":[{"type":"required","errorMessage":"Field is required","defaultErrorMessage":null}]},{"name":"unit","required":false,"canSort":false,"title":"Unit","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"unit_name","required":false,"canSort":true,"title":"Name","length":25,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"updated_by","required":false,"canSort":false,"title":"Updated by","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"updated_by_full_name","required":false,"canSort":true,"title":"Updated by","length":255,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"user","required":false,"canSort":false,"title":"User","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"wbs","required":false,"canSort":false,"title":"WBS","displayField":"level","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"wbs_code","required":false,"canSort":true,"title":"Code","length":255,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"wbs_level","required":false,"canSort":true,"length":255,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true},"title":"Wbs Level","_titleAutoDerived":true},{"canEdit":false,"name":"wbs_p6_code","required":false,"canSort":true,"title":"Code","length":255,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"wbs_p6_name","required":false,"canSort":true,"title":"Name","length":255,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"workstream","required":false,"canSort":false,"title":"Workstream","displayField":"name","editorType":"WQMComboBoxItem","type":"text","valueField":"id","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"canEdit":false,"name":"workstream_name","required":false,"canSort":true,"title":"Workstream","length":50,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}},{"name":"workstream_reference","required":false,"canSort":true,"title":"Workstream reference","length":20,"type":"text","editorType":"WQMTextItem","_typeDefaultsAdded":true,"_simpleType":{"validators":[{"type":"isString","typeCastValidator":true,"_generated":true,"_typeValidator":true,"stopIfFalse":true,"defaultErrorMessage":null}],"defaultOperator":"iContains","name":"text","_normalized":true}}],"recordXPath":"/response/data"},"autoFetchData":true,"showFilterEditor":true,"groupStartOpen":"all","groupByField":"project_name","_constructor":"ItemsPortletGrid"},{"_defaultedAutoDraw":true,"autoDraw":false,"title":"Scope Items","autoID":"Portlet0","destroyOnClose":true,"_constructor":"Portlet","items":["ref:ItemsPortletGrid0"]},{"_defaultedAutoDraw":true,"autoDraw":false,"ID":"landingpagePortalLayout","width":"100%","height":"100%","numColumns":0,"canResizePortlets":true,"_constructor":"PortalLayout","left":0,"top":0,"portalColumns":[{"ID":"PortalColumn0","_constructor":"PortalColumn","portalRows":[{"_defaultedAutoDraw":true,"autoDraw":false,"autoID":"PortalRow0","_constructor":"PortalRow","portlets":["ref:Portlet0"]}]}]}]

                Note that I have a class ItemPortalGrid, which is subclass of ListGrid.
                I used the following datasource to have it recognized by editPane.serializeAllEditNodesAsJSON()

                isc.DataSource.create
                inheritsFrom:"ListGrid",
                Constructor:"ItemsPortletGrid",
                componentSchema:true,
                isServerDS:true,
                allowAdvancedCriteria:true,
                ID:"ItemsPortletGrid",
                fields:[
                ]

                I hope you can help me with this problem.

                Comment


                  #9
                  OK, great. Yes, we get a lot of people with no intention of buying the product who just copy and paste from the clearly marked enterprise samples, ignore the docs, and say something's not working. As you can imagine, we have to minimize time spent on such people. Now that we know you are a serious evaluator, things will indeed change.

                  Can you just verify: once you used loadSystemSchema, Portlet drag and drop began to work as expected with ISC_Tools.js loaded, and this block of data comes from building a screen via drag and drop (rather than, for example, by manual calls to add editNodes)?

                  There are two problems in your code right now:

                  1. you've got entire DataSources serialized into your editNodes. This is happening because you've provided the live instance of the DataSource in your defaults, which is not valid (for any kind of instance, including singletons). This would cause more than one instance of the DataSource to be created during deserialization, each clobbering the last. Provide the string ID of the DataSource instead and this will also greatly reduce the data required.

                  2. as shown, you are trying to test round-tripping without first destroying the existing widgets. This would cause ID collisions which likely explain your error. Simplest thing to property test round-tripping is to just add a call to destroyAll()

                  A few other points:

                  1. that stack trace lacks information that is normally provided (such as class names or arguments on the stack). How did you obtain it? You should see better stack traces in the SmartClient Developer Console, especially in Chrome.

                  2. we see you're using CoffeeScript. Just to let you know, we don't have anyone familiar with that variant, so that's going to slow down interactions. However, if you like JS variant languages, you may want to look at our TypeScript support. Rather than just brevity, it gives you type checking and code completion, even when you write in plain JavaScript.

                  3. please use CODE tags (with square brackets) around code samples to preserve indentation

                  4. you may also want to check out Reify, which is the Portals & Tools framework dialed up to 12. You could embed Reify in your product to, for instance, allow people to design custom portlets that they can then embed into your dashboard. Or you can just use yourselves it to build less dynamic parts of your UI. We've taken the liberty of giving you access to the private beta, just use your smartclient.com login.

                  Comment


                    #10
                    Hi,

                    Thank you for your reply. And pointers.

                    To verify, yes to all questions.

                    I have made a few changes and did some additional tests:

                    I did manually clean the json to the following:

                    Code:
                    [{
                     "_defaultedAutoDraw": true,
                     "autoDraw": false,
                     "autoID": "ItemsPortletGrid0",
                     "dataSource": {
                      "ID": "isc_ItemsDataSource_4"
                     },
                     "autoFetchData": true,
                     "showFilterEditor": true,
                     "groupStartOpen": "all",
                     "groupByField": "project_name",
                     "_constructor": "ItemsPortletGrid"
                    }, {
                     "_defaultedAutoDraw": true,
                     "autoDraw": false,
                     "title": "Scope Items",
                     "autoID": "Portlet0",
                     "destroyOnClose": true,
                     "_constructor": "Portlet",
                     "items": ["ref:ItemsPortletGrid0"]
                    }, {
                     "_defaultedAutoDraw": true,
                     "autoDraw": false,
                     "ID": "landingpagePortalLayout",
                     "width": "100%",
                     "height": "100%",
                     "numColumns": 0,
                     "canResizePortlets": true,
                     "_constructor": "PortalLayout",
                     "left": 0,
                     "top": 0,
                     "portalColumns": [{
                      "ID": "PortalColumn0",
                      "_constructor": "PortalColumn",
                      "portalRows": [{
                       "_defaultedAutoDraw": true,
                       "autoDraw": false,
                       "autoID": "PortalRow0",
                       "_constructor": "PortalRow",
                       "portlets": ["ref:Portlet0"]
                      }]
                     }]
                    }]
                    After starting the application, I run the following in the console:

                    Code:
                    editPane.destroyAll()
                    I then double check that the following objects do not exist:

                    ItemsPortletGrid0
                    Portlet0
                    _landingpagePortalLayout

                    I then run the following in the console:

                    Code:
                    editPane.addPaletteNodesFromJSON(test)
                    where test contains the JSON above.

                    I get the following warnings and errors:

                    Code:
                    ISC_Core.js:29557 *23:36:34.796:WARN:Log:ID 'ItemsPortletGrid0' for object '[ItemsPortletGrid ID:ItemsPortletGrid0]' collides with the ID of an existing object. This can occur when the specified ID for a new SmartClient Canvas is the same as a native attribute of 'window', or another variable already assigned in global scope. The global reference to this object will be replaced. Consider instead using a different ID to avoid this collision altogether, especially if the colliding ID is a native attribute of window.  Replacing such objects often has serious and unintended consequences. In this case, the current value of window['ItemsPortletGrid0'] is:
                    
                     {type: "ItemsPortletGrid",
                    defaults: Obj,
                    icon: undef,
                    iconSize: undef,
                    showDropIcon: undef,
                    hasParent: true}
                    
                    addToMasterLog @ ISC_Core.js:29557
                    addLogMessage @ ISC_Core.js:29522
                    log @ ISC_Core.js:29395
                    logMessage @ ISC_Core.js:27537
                    logWarn @ ISC_Core.js:27615
                    addGlobalID @ ISC_Core.js:4990
                    init @ ISC_Core.js:70575
                    invokeSuper @ ISC_Core.js:7174
                    Super @ ISC_Core.js:6992
                    init @ ISC_Grids.js:29681
                    invokeSuper @ ISC_Core.js:7174
                    Super @ ISC_Core.js:6992
                    init @ SRGrids.source.coffee:184
                    invokeSuper @ ISC_Core.js:7174
                    Super @ ISC_Core.js:6992
                    init @ Grids.source.coffee:95
                    completeCreation @ ISC_Core.js:8414
                    create @ ISC_Core.js:5707
                    newInstance @ ISC_Core.js:4860
                    createLiveObject @ ISC_DataBinding.js:77239
                    makeEditNode @ ISC_DataBinding.js:77018
                    makeEditNode @ ISC_DataBinding.js:72510
                    addFromPaletteNodes @ ISC_DataBinding.js:73656
                    addPaletteNodesFromJSON @ ISC_DataBinding.js:73372
                    addPaletteNodesFromJSON @ ISC_DataBinding.js:78019
                    (anonymous) @ VM10298:1
                    ISC_Core.js:29557 *23:36:34.853:WARN:Log:ID 'Portlet0' for object '[Portlet ID:Portlet0]' collides with the ID of an existing object. This can occur when the specified ID for a new SmartClient Canvas is the same as a native attribute of 'window', or another variable already assigned in global scope. The global reference to this object will be replaced. Consider instead using a different ID to avoid this collision altogether, especially if the colliding ID is a native attribute of window.  Replacing such objects often has serious and unintended consequences. In this case, the current value of window['Portlet0'] is:
                    
                     {type: "Portlet",
                    defaults: Obj{title:Scope Items},
                    hasParent: true}
                    
                    addToMasterLog @ ISC_Core.js:29557
                    addLogMessage @ ISC_Core.js:29522
                    log @ ISC_Core.js:29395
                    logMessage @ ISC_Core.js:27537
                    logWarn @ ISC_Core.js:27615
                    addGlobalID @ ISC_Core.js:4990
                    init @ ISC_Core.js:70575
                    completeCreation @ ISC_Core.js:8414
                    create @ ISC_Core.js:5707
                    newInstance @ ISC_Core.js:4860
                    createLiveObject @ ISC_DataBinding.js:77239
                    makeEditNode @ ISC_DataBinding.js:77018
                    makeEditNode @ ISC_DataBinding.js:72510
                    addFromPaletteNodes @ ISC_DataBinding.js:73656
                    addPaletteNodesFromJSON @ ISC_DataBinding.js:73372
                    addPaletteNodesFromJSON @ ISC_DataBinding.js:78019
                    (anonymous) @ VM10298:1
                    ISC_Core.js:29557 *23:36:34.857:WARN:Log:ID '_landingpagePortalLayout' for object '[PortalLayout ID:_landingpagePortalLayout]' collides with the ID of an existing object. This can occur when the specified ID for a new SmartClient Canvas is the same as a native attribute of 'window', or another variable already assigned in global scope. The global reference to this object will be replaced. Consider instead using a different ID to avoid this collision altogether, especially if the colliding ID is a native attribute of window.  Replacing such objects often has serious and unintended consequences. In this case, the current value of window['_landingpagePortalLayout'] is:
                    
                     {type: "PortalLayout",
                    defaults: Obj{ID:_landingpagePortalLayout},
                    hasParent: true}
                    
                    addToMasterLog @ ISC_Core.js:29557
                    addLogMessage @ ISC_Core.js:29522
                    log @ ISC_Core.js:29395
                    logMessage @ ISC_Core.js:27537
                    logWarn @ ISC_Core.js:27615
                    addGlobalID @ ISC_Core.js:4990
                    init @ ISC_Core.js:70575
                    completeCreation @ ISC_Core.js:8414
                    create @ ISC_Core.js:5707
                    newInstance @ ISC_Core.js:4860
                    createLiveObject @ ISC_DataBinding.js:77239
                    makeEditNode @ ISC_DataBinding.js:77018
                    makeEditNode @ ISC_DataBinding.js:72510
                    addFromPaletteNodes @ ISC_DataBinding.js:73656
                    addPaletteNodesFromJSON @ ISC_DataBinding.js:73372
                    addPaletteNodesFromJSON @ ISC_DataBinding.js:78019
                    (anonymous) @ VM10298:1
                    ISC_Containers.js:6316 Uncaught TypeError: Cannot read property '_portlet' of undefined
                        at ISC_Containers.js:6316
                        at Array.map [as _nativeMap] (<anonymous>)
                        at Array.map (ISC_Core.js:13371)
                        at cons.addMembers (ISC_Containers.js:6314)
                        at cons.addPortlets (ISC_Containers.js:6393)
                        at cons.initWidget (ISC_Containers.js:5889)
                        at cons.init (ISC_Core.js:70739)
                        at cons.completeCreation (ISC_Core.js:8414)
                        at cons.create (ISC_Core.js:5707)
                        at Object.newInstance (ISC_Core.js:4860)
                        at cons.createLiveObject (ISC_DataBinding.js:77239)
                        at cons.makeEditNode (ISC_DataBinding.js:77018)
                        at cons.makeEditNode (ISC_DataBinding.js:72510)
                        at cons.addFromPaletteNodes (ISC_DataBinding.js:73679)
                        at cons.addPaletteNodesFromJSON (ISC_DataBinding.js:73372)
                        at cons.addPaletteNodesFromJSON (ISC_DataBinding.js:78019)
                        at <anonymous>:1:10
                    However when I get the JSON by running test=editPane.serializeAllEditNodesAsJSON() on the example from https://smartclient.com/smartclient/...ortalDashboard
                    And copy and paste it in the console of our application and then run editPane.addPaletteNodesFromJSON(test) I'm getting collision errors as well, but nor errors and the listGrid does show. Again I checked that the objects don't exist before I run it in the console.

                    Code:
                    ISC_Core.js:29557 *00:00:27.574:WARN:Log:ID '_ListGrid1' for object '[ListGrid ID:_ListGrid1]' collides with the ID of an existing object. This can occur when the specified ID for a new SmartClient Canvas is the same as a native attribute of 'window', or another variable already assigned in global scope. The global reference to this object will be replaced. Consider instead using a different ID to avoid this collision altogether, especially if the colliding ID is a native attribute of window.  Replacing such objects often has serious and unintended consequences. In this case, the current value of window['_ListGrid1'] is:
                    
                     {type: "ListGrid",
                    defaults: Obj{ID:_ListGrid1},
                    hasParent: true}
                    
                    addToMasterLog @ ISC_Core.js:29557
                    observation @ ISC_Core.js:8102
                    addLogMessage @ ISC_Core.js:29522
                    log @ ISC_Core.js:29395
                    logMessage @ ISC_Core.js:27537
                    logWarn @ ISC_Core.js:27615
                    addGlobalID @ ISC_Core.js:4990
                    init @ ISC_Core.js:70575
                    invokeSuper @ ISC_Core.js:7174
                    Super @ ISC_Core.js:6992
                    init @ ISC_Grids.js:29681
                    completeCreation @ ISC_Core.js:8414
                    create @ ISC_Core.js:5707
                    newInstance @ ISC_Core.js:4860
                    createLiveObject @ ISC_DataBinding.js:77239
                    makeEditNode @ ISC_DataBinding.js:77018
                    makeEditNode @ ISC_DataBinding.js:72510
                    addFromPaletteNodes @ ISC_DataBinding.js:73656
                    addPaletteNodesFromJSON @ ISC_DataBinding.js:73372
                    addPaletteNodesFromJSON @ ISC_DataBinding.js:78019
                    (anonymous) @ VM12337:1
                    ISC_Core.js:29557 *00:00:27.593:WARN:Log:ID '_Portlet1' for object '[Portlet ID:_Portlet1]' collides with the ID of an existing object. This can occur when the specified ID for a new SmartClient Canvas is the same as a native attribute of 'window', or another variable already assigned in global scope. The global reference to this object will be replaced. Consider instead using a different ID to avoid this collision altogether, especially if the colliding ID is a native attribute of window.  Replacing such objects often has serious and unintended consequences. In this case, the current value of window['_Portlet1'] is:
                    
                     {type: "Portlet",
                    defaults: Obj{ID:_Portlet1},
                    hasParent: true}
                    
                    addToMasterLog @ ISC_Core.js:29557
                    observation @ ISC_Core.js:8102
                    addLogMessage @ ISC_Core.js:29522
                    log @ ISC_Core.js:29395
                    logMessage @ ISC_Core.js:27537
                    logWarn @ ISC_Core.js:27615
                    addGlobalID @ ISC_Core.js:4990
                    init @ ISC_Core.js:70575
                    completeCreation @ ISC_Core.js:8414
                    create @ ISC_Core.js:5707
                    newInstance @ ISC_Core.js:4860
                    createLiveObject @ ISC_DataBinding.js:77239
                    makeEditNode @ ISC_DataBinding.js:77018
                    makeEditNode @ ISC_DataBinding.js:72510
                    addFromPaletteNodes @ ISC_DataBinding.js:73656
                    addPaletteNodesFromJSON @ ISC_DataBinding.js:73372
                    addPaletteNodesFromJSON @ ISC_DataBinding.js:78019
                    (anonymous) @ VM12337:1
                    ISC_Core.js:29557 *00:00:27.599:WARN:Log:ID '_ListGrid3' for object '[ListGrid ID:_ListGrid3]' collides with the ID of an existing object. This can occur when the specified ID for a new SmartClient Canvas is the same as a native attribute of 'window', or another variable already assigned in global scope. The global reference to this object will be replaced. Consider instead using a different ID to avoid this collision altogether, especially if the colliding ID is a native attribute of window.  Replacing such objects often has serious and unintended consequences. In this case, the current value of window['_ListGrid3'] is:
                    
                     {type: "ListGrid",
                    defaults: Obj{ID:_ListGrid3},
                    hasParent: true}
                    
                    addToMasterLog @ ISC_Core.js:29557
                    observation @ ISC_Core.js:8102
                    addLogMessage @ ISC_Core.js:29522
                    log @ ISC_Core.js:29395
                    logMessage @ ISC_Core.js:27537
                    logWarn @ ISC_Core.js:27615
                    addGlobalID @ ISC_Core.js:4990
                    init @ ISC_Core.js:70575
                    invokeSuper @ ISC_Core.js:7174
                    Super @ ISC_Core.js:6992
                    init @ ISC_Grids.js:29681
                    completeCreation @ ISC_Core.js:8414
                    create @ ISC_Core.js:5707
                    newInstance @ ISC_Core.js:4860
                    createLiveObject @ ISC_DataBinding.js:77239
                    makeEditNode @ ISC_DataBinding.js:77018
                    makeEditNode @ ISC_DataBinding.js:72510
                    addFromPaletteNodes @ ISC_DataBinding.js:73656
                    addPaletteNodesFromJSON @ ISC_DataBinding.js:73372
                    addPaletteNodesFromJSON @ ISC_DataBinding.js:78019
                    (anonymous) @ VM12337:1
                    ISC_Core.js:29557 *00:00:27.606:WARN:Log:ID '_Portlet3' for object '[Portlet ID:_Portlet3]' collides with the ID of an existing object. This can occur when the specified ID for a new SmartClient Canvas is the same as a native attribute of 'window', or another variable already assigned in global scope. The global reference to this object will be replaced. Consider instead using a different ID to avoid this collision altogether, especially if the colliding ID is a native attribute of window.  Replacing such objects often has serious and unintended consequences. In this case, the current value of window['_Portlet3'] is:
                    
                     {type: "Portlet",
                    defaults: Obj{ID:_Portlet3},
                    hasParent: true}
                    
                    addToMasterLog @ ISC_Core.js:29557
                    observation @ ISC_Core.js:8102
                    addLogMessage @ ISC_Core.js:29522
                    log @ ISC_Core.js:29395
                    logMessage @ ISC_Core.js:27537
                    logWarn @ ISC_Core.js:27615
                    addGlobalID @ ISC_Core.js:4990
                    init @ ISC_Core.js:70575
                    completeCreation @ ISC_Core.js:8414
                    create @ ISC_Core.js:5707
                    newInstance @ ISC_Core.js:4860
                    createLiveObject @ ISC_DataBinding.js:77239
                    makeEditNode @ ISC_DataBinding.js:77018
                    makeEditNode @ ISC_DataBinding.js:72510
                    addFromPaletteNodes @ ISC_DataBinding.js:73656
                    addPaletteNodesFromJSON @ ISC_DataBinding.js:73372
                    addPaletteNodesFromJSON @ ISC_DataBinding.js:78019
                    (anonymous) @ VM12337:1
                    ISC_Core.js:29557 *00:00:27.609:WARN:Log:ID '_PortalLayout4' for object '[PortalLayout ID:_PortalLayout4]' collides with the ID of an existing object. This can occur when the specified ID for a new SmartClient Canvas is the same as a native attribute of 'window', or another variable already assigned in global scope. The global reference to this object will be replaced. Consider instead using a different ID to avoid this collision altogether, especially if the colliding ID is a native attribute of window.  Replacing such objects often has serious and unintended consequences. In this case, the current value of window['_PortalLayout4'] is:
                    
                     {type: "PortalLayout",
                    defaults: Obj{ID:_PortalLayout4},
                    hasParent: true}
                    Thanks!

                    Comment


                      #11
                      OK, multiple issues here:

                      1. your hand-edited JSON simplification for the dataSource property was not correct, use just dataSource:"stringId", no additional structure.

                      2. somehow your JSON is in inverted order, so the hierarchy can't be rebuilt correctly

                      3. you've hit a recent regression affecting JSON round-tripping only; it's a simple regression, but it's basically the source of all of these errors. We'll have this fixed very quickly, but you could just temporarily switch to the XML serialization and things would work.

                      Comment


                        #12
                        Thanks,

                        When I switch to XML serialization and run editPane.addPaletteNodesFromXML(test) I get the following error, which I suspect is due to us not using the build in webserver but our ruby on rails webserver:

                        Code:
                        ISC_Core.js:47352 POST http://localhost:3000/isomorphic/IDACall?isc_rpc=1&isc_v=v12.1p_2020-05-30&isc_xhr=1 404 (Not Found)
                        sendXmlHttpRequest @ ISC_Core.js:47352
                        _sendQueue @ ISC_DataBinding.js:45565
                        sendQueue @ ISC_DataBinding.js:45186
                        sendRequest @ ISC_DataBinding.js:43883
                        call @ ISC_DataBinding.js:50460
                        x @ VM26301:1
                        addPaletteNodesFromXML @ ISC_DataBinding.js:73316
                        addPaletteNodesFromXML @ ISC_DataBinding.js:78011
                        (anonymous) @ VM31032:1
                        ISC_Core.js:29557 *13:12:30.485:XRP3:WARN:Log:ReferenceError: response is not defined
                        Stack from error.stack:
                         cons.handleTransportError(<no args: exited>) on [Class RPCManager] @ Application.debug-312e305d8f71840fe37239ed8eeea97d7c876b0f82f341a29aa1cd49b8d66b68ad2da4.js:7906:132
                         cons.performTransactionReply(<no args: exited>) on [Class RPCManager] @ ISC_DataBinding.js:45782:35
                         eval(<no args: exited>) @ [no file]:3:16
                         cons.fireCallback(callback=>"isc.RPCManager.performTransactionReply(t..."[65], argNames=>"transactionNum,results,wd", args=>Array[2], target=>undef, catchErrors=>undef) on [Class Comm] @ ISC_Core.js:7437:36
                         cons.performXmlTransactionReply(transactionNum=>8, xmlHttpRequest=>[object XMLHttpRequest]) on [Class Comm] @ ISC_Core.js:47405:10
                         eval(xmlHttpRequest=>[object XMLHttpRequest]) @ [no file]:3:10
                         fireCallback(<no args: recursion>)  on [Class Class] @ ISC_Core.js:7437:36
                         cons._fireXMLCallback(request=>[object XMLHttpRequest], callback=>"isc.Comm.performXmlTransactionReply(8, x..."[54], delayedCall=>undef) on [Class Comm] @ ISC_Core.js:47051:15
                         XMLHttpRequest.loadFunc() @ ISC_Core.js:47292:26
                        
                        addToMasterLog @ ISC_Core.js:29557
                        observation @ ISC_Core.js:8102
                        addLogMessage @ ISC_Core.js:29522
                        log @ ISC_Core.js:29395
                        logMessage @ ISC_Core.js:27537
                        logWarn @ ISC_Core.js:27615
                        _reportJSErrorStack @ ISC_Core.js:27009
                        _reportJSError @ ISC_Core.js:27004
                        fireCallback @ ISC_Core.js:7439
                        _fireXMLCallback @ ISC_Core.js:47051
                        loadFunc @ ISC_Core.js:47292
                        XMLHttpRequest.send (async)
                        sendXmlHttpRequest @ ISC_Core.js:47352
                        _sendQueue @ ISC_DataBinding.js:45565
                        sendQueue @ ISC_DataBinding.js:45186
                        sendRequest @ ISC_DataBinding.js:43883
                        call @ ISC_DataBinding.js:50460
                        x @ VM26301:1
                        addPaletteNodesFromXML @ ISC_DataBinding.js:73316
                        addPaletteNodesFromXML @ ISC_DataBinding.js:78011
                        (anonymous) @ VM31032:1
                        ISC_Core.js:7442 Uncaught ReferenceError: response is not defined
                            at cons.handleTransportError (Application.source.coffee:153)
                            at cons.performTransactionReply (ISC_DataBinding.js:45782)
                            at eval (eval at isc__makeFunction (ISC_Core.js:2494), <anonymous>:3:16)
                            at cons.fireCallback (ISC_Core.js:7437)
                            at cons.performXmlTransactionReply (ISC_Core.js:47405)
                            at eval (eval at isc__makeFunction (ISC_Core.js:2494), <anonymous>:3:10)
                            at Object.fireCallback (ISC_Core.js:7437)
                            at cons._fireXMLCallback (ISC_Core.js:47051)
                            at XMLHttpRequest.loadFunc (ISC_Core.js:47292)
                        I did get a little further. If I change all the "AutoID" into "ID" I no longer get the Uncaught TypeError: Cannot read property '_portlet' of undefined

                        I am unsure why the editPane.serializeAllEditNodesAsJSON() generates "AutoID"s in my case, but in the example it generates "ID"s?

                        So the next problem I'm having is that my grid doesn't look as expected, it's an empty grid without columns. If I manually run ItemsPortletGrid0.initWidget() the columns show but are doubled and no data is loaded.

                        Thanks.


                        Comment


                          #13
                          To use the XML pipeline you would have to have our server present, but what you can do is just host your .html file with the SDK you downloaded, and still make calls to your Ruby on Rails environment (they are automatically proxed - see HttpProxyServlet).

                          That's the most productive path, since you'll be able to just switch to JSON and move your code over to the Ruby environment once you've got a working portal.

                          Messing around further with the JSON pipeline right now is useless - you'll be chasing phantoms. There's just one central regression, but it means the data is incorrect in several different ways.

                          Comment


                            #14
                            OK, this is all fixed now, and the tomorrow's builds (see smartclient.com/builds) will contain the patch.

                            Note that you should throw away any previously captured JSON serializations. The regression basically caused a whole processing chain to be skipped for JSON, so the captured data wasn't even properly set up as paletteNodes (you'll notice a new "defaults" sub-object, for example, matching how paletteNode is documented).

                            Just FYI, this was one of those subtle "two wrongs make a right" situations: the code broke, and the automated test cases were flawed as well, so the regression wasn't caught.

                            Comment


                              #15
                              Thanks! The error is gone now.

                              I have one more question:

                              Is there some documentation on how to properly build datasources like in ISC_SystemSchema.js?

                              I have a custom grid with some additional properties, which are not serialized, as well as a custom DataSource subclass which we use to communicate properly with ruby on rails.
                              I use the following code, which works fine for now, but would like to have a better understanding of all the possibilities.

                              Code:
                              isc.DataSource.create({
                                    inheritsFrom:"ListGrid",
                                    Constructor:"IssuesGrid",
                                    ID:"IssuesGrid",
                                    fields: [
                                      {
                                          name:"customProperty",
                                          title:"Custom Property",
                                          type:"string",
                                          validators:[
                                          ]
                                      }
                                    ]
                              })
                              
                              isc.DataSource.create ({
                                    inheritsFrom:"DataSource",
                                    Constructor:"SRDataSource",
                                    ID:"SRDataSource"
                              })

                              Thanks!

                              Comment

                              Working...
                              X