I have a problem in my method by using the function ‘controller.search()’:
var vUserName = arguments[0];
var vUID = security.getUserUID(user_name);
var vID = uid_user;
//Fehlermeldung, wenn das Feld leer ist. Setzt alten Wert zurueck.
if (!user_name)
{
var vIndex = plugins.dialogs.showErrorDialog( i18n.getI18NMessage('88+.dialog.titel.error'), i18n.getI18NMessage('88+.dialog.msg.error.username'), i18n.getI18NMessage('88+.dialog.btn.ok'));
forms.user_edit_tab.user_name = vUserName;
}
//Ueberprueft den eindeutigen Benutzernamen
else if (user_name)
{
var vUserName_1 = user_name;
forms.user_edit_tab.controller.find();
forms.user_edit_tab.user_name = vUserName_1;
var vFound = forms.user_edit_tab.controller.search();
//Wenn mehr als ein DS gefunden, wird Wert zurueck gesetzt
if (vFound > 1)
{
var vIndex = plugins.dialogs.showErrorDialog( i18n.getI18NMessage('88+.dialog.titel.error'), i18n.getI18NMessage('88+.dialog.msg.error.unique_username'), i18n.getI18NMessage('88+.dialog.btn.ok'));
forms.user_edit_tab.controller.find();
forms.user_edit_tab.uid_user = vID;
forms.user_edit_tab.controller.search();
forms.user_edit_tab.user_name = vUserName;
}
//Setzt den Benutzernamen in Security
else if (vFound == 1 && user_name != vUserName)
{
security.changeUserName(vUID, user_name);
}
}
elements.user_group.requestFocus();
The method stops at the first ‘controller.search();’ and is not working the arguments afterwards!? I checked my methode many times, but always with the same result. Please help me!
Servoy Developer
Version 3.1.6-build 410
Java version 1.6.0_01-b06 (Windows XP)```
Are you running the method in a Form In Dialog?
Have you checked if the form actually enters find mode?
Have you checked if there’s a method hooked up to the onSearch event?
The method is running in a tabpanel form. The Formproperties ‘onFindCmd’ and ‘onSearchCmd’ are ‘-none-’. But it seems the problem was the ‘onRecordSelection’ or ‘onLoad’ method. I tried without this methods… and how wonder it works. Ok, now I have to check this methods.
Thank you very much for your ideas!!
I tried now lot, but the problem still exists if i have set an onRecordSelection method in the form properties! but only in this case and it is all the same by a method without any commands!? Could it be a problem while executing the method in a transaction?
Sounds strange, so you are saying that if you have a method (even an empty one) attached to onRecordSelection event your search method is stopped?
Take a look at the servoy log, if there are problems with the transaction it should be written there.
You could also try to reproduce your problem in a small sample solution, and see if it works properly there; in the worst case you can file a bug report attaching the sample solution.