# Parameters in applet project

**URL:** <https://forum.inductiveautomation.com/t/parameters-in-applet-project/8275>\
**Category:** Ignition\
**Created:** [April 8, 2014, 4:25pm UTC](https://forum.inductiveautomation.com/t/parameters-in-applet-project/8275 "2014-04-08T16:25:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![NestorRodriguez](https://avatars.discourse-cdn.com/v4/letter/n/779978/32.png) [@NestorRodriguez](https://forum.inductiveautomation.com/u/NestorRodriguez)\
**Post date:** [April 8, 2014, 4:25pm UTC](https://forum.inductiveautomation.com/t/parameters-in-applet-project/8275/1 "2014-04-08T16:25:53Z")

</div>

I’m trying to pass parameters a project in applet mode, I’m using the code of a previuos posts:

from javax.swing import JApplet  
from javax.swing import SwingUtilities  
applet = SwingUtilities.getAncestorOfClass(JApplet, event.source)  
value=applet.getParameter(“paramName”)

and I get the instance of the applet without problems but when I try to get the parameter I have None.

I try to use the function applet.getParameterInfo() to check that I have parameters and I’m getting None too.

I’m using Ignition version 7.6.4.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![adamaustin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adamaustin](https://forum.inductiveautomation.com/u/adamaustin)\
**Post date:** [April 8, 2014, 4:50pm UTC](https://forum.inductiveautomation.com/t/parameters-in-applet-project/8275/2 "2014-04-08T16:50:13Z")

</div>

Try using the parent window instead of the event source:

```auto
from javax.swing import JApplet
from javax.swing import SwingUtilities
applet = SwingUtilities.getAncestorOfClass(JApplet, system.gui.getParentWindow(event))
value=applet.getParameter("javaws.sr.project")
system.gui.messageBox(value)
```

---

<div class="post-metadata">

**Author:** ![NestorRodriguez](https://avatars.discourse-cdn.com/v4/letter/n/779978/32.png) [@NestorRodriguez](https://forum.inductiveautomation.com/u/NestorRodriguez)\
**Post date:** [April 8, 2014, 5:05pm UTC](https://forum.inductiveautomation.com/t/parameters-in-applet-project/8275/3 "2014-04-08T17:05:52Z")

</div>

I try using the parent window but get the same result.

I pass in the URL the parameter named ‘User’ and I try to get this value like this:

from javax.swing import JApplet  
from javax.swing import SwingUtilities  
applet = SwingUtilities.getAncestorOfClass(JApplet, system.gui.getParentWindow(event))  
user=applet.getParameter(“User”)

Is this correct? or I have to use another name for the parameter? I ask this because when I use “javaws.sr.project” as the parameter I get the correct name of my project.

Thanks

---

<div class="post-metadata">

**Author:** ![adamaustin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adamaustin](https://forum.inductiveautomation.com/u/adamaustin)\
**Post date:** [April 8, 2014, 5:15pm UTC](https://forum.inductiveautomation.com/t/parameters-in-applet-project/8275/4 "2014-04-08T17:15:27Z")

</div>

You need to post the HTML or fix it there.

---

<div class="post-metadata">

**Author:** ![NestorRodriguez](https://avatars.discourse-cdn.com/v4/letter/n/779978/32.png) [@NestorRodriguez](https://forum.inductiveautomation.com/u/NestorRodriguez)\
**Post date:** [April 8, 2014, 5:31pm UTC](https://forum.inductiveautomation.com/t/parameters-in-applet-project/8275/5 "2014-04-08T17:31:47Z")

</div>

I try using the parent window but get the same result.

I pass in the URL the parameter named ‘User’ and I try to get this value like this:

```auto
from javax.swing import JApplet
from javax.swing import SwingUtilities
applet = SwingUtilities.getAncestorOfClass(JApplet, system.gui.getParentWindow(event))
user=applet.getParameter("User")
```

Is this correct? or I have to use another name for the parameter? I ask this because when I use “javaws.sr.project” as the parameter I get the correct name of my project.

Thanks

---

<div class="post-metadata">

**Author:** ![adamaustin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adamaustin](https://forum.inductiveautomation.com/u/adamaustin)\
**Post date:** [April 8, 2014, 5:41pm UTC](https://forum.inductiveautomation.com/t/parameters-in-applet-project/8275/6 "2014-04-08T17:41:30Z")

</div>

Applet parameters come from the HTML:

```auto
<div class="applet">
	
	<script>
	var attributes = {
		"codebase":"http://localhost:8088/main/system/launchbin/",
		"archive":"launchclient.jar",
		"code":"com.inductiveautomation.ignition.client.launch.BootstrapApplet",
		"width":"800",
		"height":"600"};
	var parameters = { "classloader_cache":"false",
		"javaws.sr.gateway.addr.0":"localhost:8088:8043/main",
		"javaws.sr.scope":"C",
		"javaws.sr.project":"TestProject",
		"javaws.sr.launchts":"1396974861926",
		"javaws.sr.main":"com.inductiveautomation.factorypmi.application.runtime.ClientLaunchHook"};
	deployJava.runApplet(attributes,parameters,'1.6');
</script>
	
</div>	
```

---

<div class="post-metadata">

**Author:** ![NestorRodriguez](https://avatars.discourse-cdn.com/v4/letter/n/779978/32.png) [@NestorRodriguez](https://forum.inductiveautomation.com/u/NestorRodriguez)\
**Post date:** [April 8, 2014, 5:50pm UTC](https://forum.inductiveautomation.com/t/parameters-in-applet-project/8275/7 "2014-04-08T17:50:41Z")

</div>

I have this HTML:

[code]

```
<script>
var attributes = {
	"codebase":"http://192.168.111.165:8088/main/system/launchbin/",
	"archive":"launchclient.jar",
	"code":"com.inductiveautomation.ignition.client.launch.BootstrapApplet",
	"width":"800",
	"height":"600"};
var parameters = { "classloader_cache":"false",
	"javaws.sr.gateway.addr.0":"192.168.111.165:8088:8043/main",
	"javaws.sr.scope":"C",
	"javaws.sr.project":"SentinelIPG",
	"javaws.sr.launchts":"1396979112158",
	"javaws.sr.main":"com.inductiveautomation.factorypmi.application.runtime.ClientLaunchHook"};
deployJava.runApplet(attributes,parameters,'1.6');

```

 [/code]

I don’t see my parameter anywhere. How can I set a parameter in the HTML?
