Ticket #732 (closed defect: fixed)

Opened 20 months ago

Last modified 17 months ago

Embedded not rendering Applet correctly

Reported by: Marc Englund Owned by: Jani Laakso
Priority: minor Milestone: 4.0.3
Component: TK4 base theme Version: 4.0.1
Keywords: embedded,applet Cc:
Known Issue description: Embedded component not rendering Applet correctly.
Hours estimate: Deadline (dd.mm.yyyy):
Known Issue version (since): 4.0.0 Known Issue title: Embedded does not work with Java Applets
Hours done: Depends to:
Affects documentation: no
Known Issue workaround:
Affects release notes: yes Contract:

Description

Tends to lock up Firefox, pain to debug. Also see http://forum.itmill.com/posts/list/0/140.page and especially http://java.sun.com/j2se/1.5.0/docs/guide/plugin/developer_guide/using_tags.html

Render functions needs something like:

else if (uidl.getAttribute("mimetype") == "application/x-java-vm") {
		var html = "<applet ";
		
		var val = uidl.getAttribute("src");
		var isThemeSource = (typeof val != 'undefined' && val != null && val.indexOf("theme://") == 0);
		if (isThemeSource)
    		val = val.substring(8);
		if (val) html += "code=\""+val+"\" ";

		if (isThemeSource) {
			html += " codebase=\""+theme.root+"\" ";
		} else {
			val = uidl.getAttribute("codebase");
			if (val) html += " codebase=\""+val+"\" ";
		}
		
		val = uidl.getAttribute("width");
		if (val) html += " width=\""+val+"\" ";
		
		val = uidl.getAttribute("height");
		if (val) html += " height=\""+val+"\" ";
		
		
		val = uidl.getAttribute("standby");
		if (val) html += " standby=\""+val+"\" ";
		
		val = uidl.getAttribute("mimetype");
		if (val) html += " type=\""+val+"\" ";
		
		html += ">";		
		
		// Add all parameters
		var params = theme.getChildElements(uidl,"embeddedparams");
		if (params != null) {
			var len = params.length;
			for (var i=0;i<len;i++) {
				html += "<param name=\""+params[i].getAttribute("name")+"\" value=\""+params[i].getAttribute("name")+"\" />"
			}
		}
		html += "</applet>"
		div.innerHTML = html;
	}

But this is only tested with

   ThemeResource res = new ThemeResource("Clock.class");
   Embedded emb = new Embedded("",res);
   emb.setMimeType("application/x-java-vm");
   main.addComponent(emb);

Needs to support more cases (jar etc) + testing.

Change History

Changed 19 months ago by Marc Englund

  • status changed from new to closed
  • resolution set to fixed

Changed 17 months ago by Jani Laakso

  • hours_left deleted
  • milestone set to 4.0.3

Changed 17 months ago by Jani Laakso

  • known_issue_desc modified (diff)

Changed 17 months ago by Jani Laakso

  • known_issue_since set to 4.0.0

Changed 17 months ago by Jani Laakso

  • known_issue_title set to Embedded does not work with Java Applets
Note: See TracTickets for help on using tickets.