// "labelText is a global variable where I can put the name of the label
var form = solutionModel.getForm('contacts_profile')
var label = form.newLabel(labelText,0,10,80,20)
label.transparent = true
label.name = labelText
var name = label.name
forms.contacts_profile.controller.recreateUI()
Then I want to retrieve the name of the label in a onDrop method
var name = elem.getElementName()
var x = elem.getX()
var y = elem.getY()
application.output(name)
thanks for the reply.
Basically I generate a new label with the solutionModel, when I drop the label it should return the name, the x and y position.
What I noticed is that in nonDesignMode it is no problem to get the name, but when the form is in clientDesignMode it doesn’t remember it anymore. I tried the same with a “normal” button and it’s the same story. So I guess that the designMode doesn’t allow the getElementName() function right?
I also tried the getName() function, but it returns an error: cannot find function getName.
Strange is that the event.getX() and event.getY() returns a right value.
CODE: SELECT ALL
// "labelText is a global variable where I can put the name of the label
var form = solutionModel.getForm('contacts_profile')
var label = form.newLabel(globals.labelText,0,10,80,20)
label.transparent = true
label.name = globals.labelText
forms.contacts_profile.controller.recreateUI()
and this is the on Drop function
function onDrop(event)
var name = event.getElementName()
var x = event.getX()
var y = event.getY()
application.output(name)
Before I used “elem” just in the place of “event”, it shouldn’t be a problem right? Whatever I use “name” returns null.