Announcement

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

    lastIndexOf is not a function

    Hi,

    Im currently trying out SmartGWT (version: v8.3) for a future project and experiencing an error while trying to display a smartgwt tree with jpa integration.
    It works fine until i try to extend the second node within the tree. Then i get the following error:

    Code:
    15:14:27.575:MUP2:WARN:Log:TypeError: _1.lastIndexOf is not a function
    Stack from error.stack:
        unnamed(.startsWit) @ JPADS_js/sc/modules/ISC_Core.js:613
        unnamed(isc_c_DataSource_getDataSourc) @ JPADS_js/sc/modules/ISC_DataBinding.js:209
        unnamed(isc_c_DataSource_ge) @ JPADS_js/sc/modules/ISC_DataBinding.js:219
        unnamed(isc_ResultTree_getNodeDataSourc) @ JPADS_js/sc/modules/ISC_DataBinding.js:1792
        unnamed(isc_ResultTree_getChildDataSourc) @ JPADS_js/sc/modules/ISC_DataBinding.js:1788
        unnamed(isc_ResultTree_getTreeRelationshi) @ JPADS_js/sc/modules/ISC_DataBinding.js:1787
        unnamed(isc_ResultTree_loadChildre) @ JPADS_js/sc/modules/ISC_DataBinding.js:1797
        unnamed(isc.A.changeDataVisibilit) @ JPADS_js/sc/modules/ISC_Grids.js:111
        unnamed(anonymou) @ JPADS_js/sc/modules/ISC_Core.js:60
        unnamed(isc_Tree_openFolde) @ JPADS_js/sc/modules/ISC_Grids.js:111
        unnamed(isc_ListGrid_animateOpe) @ JPADS_js/sc/modules/ISC_Grids.js:777
        unnamed(isc_ListGrid_openFolde) @ JPADS_js/sc/modules/ISC_Grids.js:777
        unnamed(isc_ListGrid_toggleFolde) @ JPADS_js/sc/modules/ISC_Grids.js:776
        unnamed(isc_TreeGridBody_clic) @ JPADS_js/sc/modules/ISC_Grids.js:2162
        unnamed(isc_Canvas_handleClic) @ JPADS_js/sc/modules/ISC_Core.js:2126
        unnamed(isc_c_EventHandler_bubbleEven) @ JPADS_js/sc/modules/ISC_Core.js:1175
        unnamed(isc_c_EventHandler_handleClic) @ JPADS_js/sc/modules/ISC_Core.js:1052
        unnamed(isc_c_EventHandler__handleMouseU) @ JPADS_js/sc/modules/ISC_Core.js:1043
        unnamed(isc_c_EventHandler_handleMouseU) @ JPADS_js/sc/modules/ISC_Core.js:1035
        unnamed(isc_c_EventHandler_dispatc) @ JPADS_js/sc/modules/ISC_Core.js:1205
        unnamed(anonymou) @ JPADS_js/sc/modules/ISC_Core.js:58
        unnamed() @

    The Code for the tree creation is derived from the examples and works fine so far.
    My Beandefinition is as follows:
    Code:
    @Entity
    @Table (name="Nodes")
    public class MyTreeNode{
    	
    	@Id
    	@Column (nullable = false)
    	@GeneratedValue (strategy = GenerationType.IDENTITY)
    	private Long id;
    
    	@Column (nullable = false)
    	private String name;
    
    	@ManyToOne
    	@JoinColumn(name="parentId", referencedColumnName="id")
    	private MyTreeNode parent = null;
    
    
    	@Column (nullable = false)
    	private int nodeType;
    	
    	@OneToOne  
        @JoinColumn(name="toolId", referencedColumnName="id")
        private Tool tool;
    	
    	// Getters and Setters
    
    }
    Code:
    @Entity
    @Table (name="Tool")
    public class Tool{
    	
        @Id
        @Column (nullable = false)
        @GeneratedValue (strategy = GenerationType.IDENTITY)
        private Long id;
        
    
        @Column (nullable = false)
        private int position;
    
    	//Getters and Setters
    
    }


    Code:
    <DataSource
        ID="mytreenode_DataSource"
        serverType="jpa"
        beanClassName="com.smartgwt.sample.server.MyTreeNode"
        schemaBean="com.smartgwt.sample.server.MyTreeNode"
        >
        <fields>
            <field name="id"        type="sequence"                        title="ID"      hidden="true"     primaryKey="true" />
            <field name="nodeType"  type="integer"                         title="Type"    canEdit="false"  required="true"      />
            <field name="name"      type="text"                            title="Name"    required="true"   />
            <field name="parent"    foreignKey="mytreenode_DataSource.id"  title="Parent"  canEdit="false"  />
            <field name="tool"      foreignKey="tool_DataSource.id"        title="Tool"    canEdit="false"  />
        </fields>
    </DataSource>
    Code:
    <DataSource
        ID="tool_DataSource"
        serverType="jpa"
        beanClassName="com.smartgwt.sample.server.Tool"
        schemaBean="com.smartgwt.sample.server.Tool"
        >
        <fields>
            <field name="id"    title="ID"    type="sequence" hidden="true"      primaryKey="true" />
            <field name="position"  type="integer"  title="Position"   required="true"   />
        </fields>

    #2
    Be sure to test with the latest patched build (see smartclient.com/builds). If you already are, be sure to post your full version (not just 8.3).

    Comment

    Working...
    X