showDocument method works only first time

N

novel

Hi,

i am a student on the technical university berlin and deploy a search
machine for learn-modules.
The modules are composed as a graph in a rdf file. To view the graphs
i use the touchgraph api.

On the link: http://squid.cis.cs.tu-berlin.de:8000/NEG/ you can search
for learn-modules and click on the graph image for the touchgraph
applet.

Or go: http://squid.cis.cs.tu-berlin.de:80....tu-berlin.de/module/epk/Output/html/a0c.html

Now my problem:

Clicked on a node the html site is opened in the lower frame. For it I
use the applet.getAppletContext().showDocument(URL, "the name of the
frame") method. That is fine!
But clicked on an other node second time the html site is opened in a
new window.That is the frame is not found.

I assume the reason is that the focus after the showDocument method is
not on the applet. That is the getAppletContext does not know the
frame anymore and open a new window. I have no idea how to resolve it
and hope that somebody have a answer to my problem.

Thanks and greetings

M.K.
 
A

Andrew Thompson

...
| Or go:
http://squid.cis.cs.tu-berlin.de:8000/NEG/Graph.jsp?url=http://sq
uid.cis.cs.tu-berlin.de/module/epk/Output/html/a2f.html&modulUrl=
http://squid.cis.cs.tu-berlin.de/module/epk/Output/html/a0c.html
|
| Now my problem:
|
| Clicked on a node the html site is opened in the lower frame.

I tried several times and did not get anything
in the lower frame. I looked at the Java console
and it was saying there was a NullPointerException
at line 639 of TGWikiBrowser$8.run

(sorry, would have 'copied and pasted' more, but I
cannot seem to copy from the Java console at the
moment)
 
N

novel

Hi,

try: http://squid.cis.cs.tu-berlin.de:8000/NEG/frame.htm

1.the frameset:

<html>
<head>
<title>NE Relations</title>
<meta http-equiv='Content-Type' content='text/html;
charset=iso-8859-1'>
</head>
<frameset rows='67%,33%'>
<frame id='1' src='http://squid.cis.cs.tu-berlin.de:8000/NEG/graph.htm'
name='1'>
<frame id='2 src='http://squid.cis.cs.tu-berlin.de:8000/NEG/komponente.htm'
name='2'>
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>

2.the applet:
<HEAD><META HTTP-EQUIV='CACHE-CONTROL' CONTENT='NO-CACHE'></HEAD>
<HEAD><META HTTP-EQUIV='PRAGMA' CONTENT='NO-CACHE'></HEAD>
<applet name='applet' id='1'
code='com.touchgraph.wikibrowser.AppletLauncher.class'
archive='velo_graph.jar'
width='100%' height='440'>
<param name='radius' value='5'>
<param name='backlinks' value='true'>
<param name='node' value='Analyse der Anforderungen an
Datenbanksysteme >> Datenbanksysteme – konkret'>
<param name='url' value='wdaw'>
<param name='ssss' value='aaaaa'>
<param name='SCRIPTABLE' value='Y'>
<param name='mayscript' value='Y'>
<param name='file'
value='http://squid.cis.cs.tu-berlin.de:8000/NEG/graph.txt'>
</applet>

3. the method were the html should be open in the secind frame:

public void setWikiTextPane(String url) {
URL page;
try {
page = new URL(url);
AppletContext ac = applet.getAppletContext();
ac.showDocument(page, "2");
}
catch (Exception ex) {
ex.printStackTrace();
}
}

I hope you can help me!

Greetings

Martin
 
A

Andrew Thompson

.....
| try: http://squid.cis.cs.tu-berlin.de:8000/NEG/frame.htm

OK. This time I got the behaviour you described..
[1st time in bottom window, thereafter in new frame]

| 1.the frameset:

....
| <frame id='1'
src='http://squid.cis.cs.tu-berlin.de:8000/NEG/graph.htm'
| name='1'>
| <frame id='2
src='http://squid.cis.cs.tu-berlin.de:8000/NEG/komponente.htm'
| name='2'>

I did not have a close look at the html at first,
but I have spotted a problem. You have not
closed the second 'id' tag...

It is a good idea to check your html in the W3C
validator, it is saying there are further problems..
http://validator.w3.org/check?uri=http://squid.cis.cs.tu-be
rlin.de%3A8000%2FNEG%2Fframe.htm&charset=%28detect+automatically%
29&doctype=HTML+4.01+Frameset

I forced a 'doctype' of HTML 4.01 Frameset
but it is still complaining about the unclosed
element and a few other things.

I probed a bit further and found (unsurprisingly)
that the other pages had problems as well..
http://validator.w3.org/check?uri=http://squid.cis.cs.tu-be
rlin.de%3A8000%2FNEG%2Fgraph.htm&doctype=HTML+4.01+Transitional&c
harset=iso-8859-1+%28Western+Europe%29

If you wish to use the 'applet' tag (as opposed to
object/embed) this one will need to hava a doctype
of either html 3.2 or 4.01 transitional, as the applet
tag is deprecated in 4.01 (strict)..

Fix the html and the problem may disappear
(I give about 50/50 odds), otherwise come
back and I will look further..

HTH
 
N

novel

Thanks! I close the tag!


but the problem is the same! I also try it with the javascript focus
method.

the applet: ( the setHTML method is called, when a node is clicked)


package com.touchgraph.wikibrowser;
import java.applet.*;
import java.awt.BorderLayout;
import java.net.URL;
import javax.swing.JApplet;
import netscape.javascript.*;

public class AppletLauncher extends JApplet {
private JSObject win;
public void init() {
getContentPane().setLayout(new BorderLayout());
AppletContext ac = this.getAppletContext();
getContentPane().add(newcom.touchgraph.wikibrowser.TGWikiBrowser(getParameter("file"),getParameter("url"),getParameter("node"),getParameter("radius"),getParameter("backlinks"),
this), BorderLayout.CENTER);

win = JSObject.getWindow(this);
}

public void setHTML(String url) {
URL page;
try {
page = new URL(url);
AppletContext ac = this.getAppletContext();
ac.showDocument(page, "Frame2");

JSObject jsParent = (JSObject) win.getMember("top");
JSObject OutputDoc = (JSObject)
jsParent.getMember("document");
// call the javascript method of the frameset
OutputDoc.call("fun", null);
} catch (Exception ex) { ex.printStackTrace(); }
}
}

(there are noc exceptions! The call("fun", null) method is called.But
i assume that the javascript method fun is not call.

The frameset ( http://squid.cis.cs.tu-berlin.de:8000/NEG2/frame.htm)
now NEG2!!!

<html>
<head>
<script language='JavaScript' type='text/javascript'>
function fun() {
// to check if the javascript method will open
document.write('123456')
document.Frame2.focus();
}
</script>
<title>Unbenanntes Dokument</title>
<meta http-equiv='Content-Type' content='text/html;
charset=iso-8859-1'>
</head>
<frameset rows='67%,33%'>
<frame id='1'
src='http://squid.cis.cs.tu-berlin.de:8000/NEG2/graph.htm'
name='Frame1'>
<frame id='2'
src='http://squid.cis.cs.tu-berlin.de:8000/NEG2/komponente.htm'
name='Frame2'>
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>


This is my second attempt ( with javascript ---> focus)!

But the same problem!

Andrew Thompson said:
....
| try: http://squid.cis.cs.tu-berlin.de:8000/NEG/frame.htm

OK. This time I got the behaviour you described..
[1st time in bottom window, thereafter in new frame]

| 1.the frameset:

...
| <frame id='1'
src='http://squid.cis.cs.tu-berlin.de:8000/NEG/graph.htm'
| name='1'>
| <frame id='2
src='http://squid.cis.cs.tu-berlin.de:8000/NEG/komponente.htm'
| name='2'>

I did not have a close look at the html at first,
but I have spotted a problem. You have not
closed the second 'id' tag...

It is a good idea to check your html in the W3C
validator, it is saying there are further problems..
http://validator.w3.org/check?uri=http://squid.cis.cs.tu-be
rlin.de%3A8000%2FNEG%2Fframe.htm&charset=%28detect+automatically%
29&doctype=HTML+4.01+Frameset

I forced a 'doctype' of HTML 4.01 Frameset
but it is still complaining about the unclosed
element and a few other things.

I probed a bit further and found (unsurprisingly)
that the other pages had problems as well..
http://validator.w3.org/check?uri=http://squid.cis.cs.tu-be
rlin.de%3A8000%2FNEG%2Fgraph.htm&doctype=HTML+4.01+Transitional&c
harset=iso-8859-1+%28Western+Europe%29

If you wish to use the 'applet' tag (as opposed to
object/embed) this one will need to hava a doctype
of either html 3.2 or 4.01 transitional, as the applet
tag is deprecated in 4.01 (strict)..

Fix the html and the problem may disappear
(I give about 50/50 odds), otherwise come
back and I will look further..

HTH
 
A

Andrew Thompson

| Thanks! I close the tag!

Yeh.. OK. You may have closed that tag,
but the frameset does not validate, and neither
does the page with the applet.

I cannot (or rather will not) commit more time
until you can get html valid*.

Go here to check it..
http://validator.w3.org/

Put your URL in and validate it, you still have
6 errors in the applet page alone.
You may need to surf on over to
news:comp.infosystems.www.authoring.html
for further advice on the pages themselves.

* The point I am trying to get across to you
is that without valid html, all bets are off as
to the applet working.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top