Brand new to Servoy, 10 days of work with it.
So far so good, but got stuck today:
I want to build up a command like that:
forms.[field content].controller.show();
to switch to a form of which the name is in a field of a specific table.
I am able to build the string, display it in a showDialog, but no way to execute, keeps saying 'not a function"; how to convert a string to a function then?
That java script thing is new to me, I don’t really like it, and it seems to be mutual!
Anyone got a clue?
try this:
var a = ‘layout1’ //can be a var, or you can choose a value of a field!
forms[a].controller.show(); //don’t use the dot after: forms
hope this helps
It does run OK!
I now have my dynamic table driven menu running fine.
Thanks a lot.
BTW, is that documented somewhere “servoywise”? or do you know this from another javascript experience?
Thanks again, I won’t kill myself tonight then.
Hello Serge,
You will be able to find documentation on this in the Servoy docs, for sure in this forum and probably also on Servoy Magazine http://www.servoymagazine.com.
And yes, this is also plain and common javascripting.
Cheers,
Hi Serge,
If you used the following syntax:
forms.[field content].controller.show();
Try this instead:
forms[field content].controller.show();
This one caused me a bit of trouble when learning as well. When using a field reference as a parameter in this statement drop the “.” after the word “forms”.
Best,
Rich Coulombre
Similar concepts are used in other environments. For example in Micrsoft’s VBScript and JScript. Brackets can represent an array of multiple objects of the same kind. In Microsoft’s Document Object Model (DOM) for Internet Explorer such objects are referred to as a “collection”. The general concepts are similar between environments, but the syntax may vary slightly.
I found it helpful to study the Solutions Object Model (SOM) for Servoy solutions. It is described in the Servoy Advanced Programming Guide which can be downloaded at:
http://developer.servoy.com/generic.jsp?taxonomy_id=352
Stop answering, pb is over!
Just a remark about the last post, I had that pdf, but it does not mention the syntax to use when you replace the form name by a field content, the famous period to remove.
And now, off to bed!