It does not work, it produces an error:
ZEN EXCEPTION
http://127.0.0.1:8972/csp/ips/IPSockets.ZEN.SocketAssignment.cls
A JavaScript exception was caught in function function
zenInvokeCallbackMethod
TypeError: Object doesn’t support this property or method
------------------------------------------
Error invoking callback code.
Code: “zenPage.getNextSocket();”
Source: <button id=””>
------------------------------------------
Stack trace:
js:function zenExceptionHandler([object Error],[object Object],Error
invoking callback code.
C…)
js:function zenInvokeCallbackMethod(zenPage.getNextSocket();,[object
Object],onclick)
js:function zenFireEvent(10,zenPage.getNextSocket();,onclick,?)
js:function anonymous()
On Sep 30, 8:52 am, CmdrSpock <
david.j.saund...@questdiagnostics.com>
wrote:
> I have a user input form and I have a command button that the user
> would push to locate the next available opening. I have a classmethod
> which runs an SQL query to locate the next available opening and
> returns it. However, I am calling ajavascriptfunction with the
> command button, because I need to re-enable (disable=false) certain
> controls on the page also. Or would it be easier tocallthejavascript, to re-enable the controls, from the object script
> function.
>
> Here is my code;
> <button caption=" New " onclick="getNextSocket();" />
>
> MethodgetNextSocket() [ Language =javascript]
> {
> //callto an ObjectScript routine that
> // will return the next available socket number.
> // If there are no more sockets available, popup a message.
> var newSocket=zenPage.NextSocket()
> // add code to popup a message if there are no more sockets
> var tb=this.getComponentById('txtSocket');
> tb.setProperty('value',x);
> // only enable the radioset until the user makes a choice.
> var comp=this.getComponentById('rsAppType');
> comp.setProperty('disabled',false);
>
> return;
>
> }
>
> /// Thismethodwill return the next available socket for assignment
> ClassMethod NextSocket() [ Private ]
> {
> ;Generate a random number for now, between 13000 and 18000
> Quit nextSocket=$R(5000)+13000
> //callclassmethodto get an available socket
> ;##class(IPSockets.Sockets).GetNextSocket()
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -