Welcome! Log In Create A New Profile


Simple WD java applet project for use in WB

Posted by M. Beaven 
M. Beaven
Simple WD java applet project for use in WB
December 16, 2011 10:42PM
Hello all-

Jeff Graham started a thread here [forum.mysnip.de] discussing the relative merits of Activex as compared to java and/or .NET. In that thread I mentioned a simple WB project I have that utiilzes a java applet that was written in WD to retrieve workstation information for the system accessing the WB app, such as windows username and/or workstation name.

This was a basic project that Fabrice worked on to utilize the cross-platform functionality of WD/WB. The WD project can be downloaded here [www.windev-us.com]

On the WB side, all that was necessary was to define a java applet control on the page that accessed the .jar archive. You can then reference the global variable from the WD applet through the following browser javascript procedure:

function GetAppletVariable(sAppletFieldName,sVariableName)
// Javascript function (browser) in charge of geting the value of a global variable declared in awindev generated java aplet
//- sAppletFieldNale is the name of the Java applet field in the page
//- sVariableName is the name fo the variable we want to retrieve
// Example:
// Info(GetAppletVariable("JAVA_Get_User_Info","gsWindowsUserName"))

//Get the pllat in a vailable
var AppletField = document.applets[sAppletFieldName];

//Applet OK ?
if (AppletField != null)
return eval("AppletField.get"+sVariableName+"()");
//Returns an empty string
return "";

This is a fairly simple example but it does show how the two products can work together to complement each other.

Hopefully this may help someone.



Your Email:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.