Simple WD java applet project for use in WB

Startbeitrag von M. Beaven am 16.12.2011 21:42

Hello all-

Jeff Graham started a thread here,118464 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

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.




Zur Information: hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.