Edit hangs

Hello,

I don`t know if anyone can confirm this but the edit function (e in the status area) stays active when I run a method.

Could this be something in my solution broke (a relation eg).

Has anyone experienced simular issues.

Newly installed Servoy version
Servoy Developer
Version R2 2.2.1-build 333
Java version 1.5.0_04-b05 (Windows XP)

It occurs on:
Localhost and remote
Developer and client

I copied the method into an older version and there it runs corectly.
Servoy Developer
Version R2 2.2rc7-build 325
Java version 1.5.0_04-b05 (Windows XP)

The method is triggered by an on data change event.
Which seem to trigger always since 2.2.1RC8 btw.
Purpose: Update treeview when the name property has been changed.

if (name && category)
	{
		var GT_Name = name
		var GT_OldName = arguments[0]
		controller.saveData()
		controller.relookup()
		application.updateUI()
		if (GT_OldName)
			{
				forms.Calltype.controller.find()
				forms.Calltype.calltypename = GT_OldName
				forms.Calltype.controller.search()
				forms.Calltype.calltypename = GT_Name
			}
		else
			{	
				if(hardwarename_to_calltypename.getSize()!= 0	) \\check if it realy is a data change (since 2.2.1 RC8)
					{
						return
					}
				else
					{
						forms.Calltype.controller.newRecord()
						forms.Calltype_Tree.calltypename = name
						forms.Calltype.calltypeparent_id = category
						forms.Calltype.creator = globals.CurrentUserName
					}
			}
		globals.GT_Application_Message = 'Please wait until Treeview has been updated this might take a while'
		elements.name.bgcolor ='#ff9999'
		application.updateUI()

		globals.Status_TreeViewInit = 0

		forms.Calltype_Tree.Sort_TreeView()
		forms.Calltype_Tree.InitTreeView()

		globals.GT_Application_Message = null
		elements.name.bgcolor = '#ebe9e9'
		controller.saveData()
		controller.relookup()		
		application.updateUI()
		
		if (!hardwarename_to_calltypename)//Check if Relation is valid
			{
				plugins.dialogs.showErrorDialog('Relational Error', 'Error in relation: \"hardwarename_to_calltypename\" with Old value: ' + GT_OldName + ' and New value: ' + GT_Name + '\nPerformed action: \"Add_Alter_TreeView_node_Hardware\"\n\nPlease Notify your system administrator', 'Continue')
			}
		globals.TreeView_Node_Selected(hardwarename_to_calltypename.calltype_id)

		controller.loadAllRecords()
		controller.find()
		name = GT_Name //Edit mode hangs mostly therefore no data is entered in the search 
		controller.search()
		
		if (foundset.getSize() == 0)//Check if Foundset is valid. When the relation is valid the record should be found 
			{
				plugins.dialogs.showErrorDialog('Find Error', 'Error in Find request with value: ' + GT_Name + '\nPerformed action: \"Add_Alter_TreeView_node_Hardware\"\n\nPlease Notify your system administrator', 'Continue')
			}

		forms.Hardware.elements.Button_Add_Hardware.visible = false
		forms.Hardware.elements.Button_Delete_Hardware.visible = true
		forms.Hardware.elements.assetnumber.requestFocus()

		controller.saveData()
		controller.relookup()
		application.updateUI()
	}

Kind regards Rene

Just to let you know I think I solved the problem.

This line caused the problem

globals.TreeView_Node_Selected(hardwarename_to_calltypename.calltype_id)

disabeling it from the method got it running (again).

To open the treeview I now have used the next lines.

var Tree_Position = forms.Calltype_Tree.elements.CallType_TreeView.selectionPath
blabla
forms.Calltype_Tree.elements.CallType_TreeView.selectionPath = Tree_Position

Great feature thanks.

Intersting to see that you seem to have the dbtreeview selectionpath method working?

a simple elements.dbtreeview.selectionPath = [1,2,3]
does not seem to work for me