victor.martinez
13 Oct 2008, 2:04 AM
Hi all ,
I want to know if is posible to acces to html DOM within a ext Window.
First i set the windows with html content page :
Window window = new Window();
window.setUrl("FacebookCrawl");
Button saveFbkFoaf = new Button("Save temp Foaf",new SelectionListener<ComponentEvent>() {
public void componentSelected(ComponentEvent ce) {
//This is a test ...
NodeList<Element> elements1 = window.getBody().dom.getElementsByTagName("div");
System.out.println(elements1.getItem(0).getNodeValue());
}
});
window.addButton(saveFbkFoaf);
window.show();
FacebookCrawl is a Servlet witch return a html reponse :
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
"Transitional//EN\">\n" +
"<HTML>\n" +
"<HEAD><TITLE>Facebook Importation</TITLE></HEAD>\n" +
"<BODY>\n" +
"<H1>Importation have done successfull! For Complete your" +
"imporation save temporally (in memory) your foaf </H1>\n" +
"<div id=\"content\" style=\"visibility:hidden\">"+
res+
"</div>"+
"</BODY></HTML>");
Finally i try to get the result of the window content, thorught DOM, by i don't know how..
NodeList<Element> elements1 = window.getBody().dom.getElementsByTagName("div");
System.out.println(elements1.getItem(0).getNodeValue());
I want to know if is posible to acces to html DOM within a ext Window.
First i set the windows with html content page :
Window window = new Window();
window.setUrl("FacebookCrawl");
Button saveFbkFoaf = new Button("Save temp Foaf",new SelectionListener<ComponentEvent>() {
public void componentSelected(ComponentEvent ce) {
//This is a test ...
NodeList<Element> elements1 = window.getBody().dom.getElementsByTagName("div");
System.out.println(elements1.getItem(0).getNodeValue());
}
});
window.addButton(saveFbkFoaf);
window.show();
FacebookCrawl is a Servlet witch return a html reponse :
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
"Transitional//EN\">\n" +
"<HTML>\n" +
"<HEAD><TITLE>Facebook Importation</TITLE></HEAD>\n" +
"<BODY>\n" +
"<H1>Importation have done successfull! For Complete your" +
"imporation save temporally (in memory) your foaf </H1>\n" +
"<div id=\"content\" style=\"visibility:hidden\">"+
res+
"</div>"+
"</BODY></HTML>");
Finally i try to get the result of the window content, thorught DOM, by i don't know how..
NodeList<Element> elements1 = window.getBody().dom.getElementsByTagName("div");
System.out.println(elements1.getItem(0).getNodeValue());