good day, we're having this problem wherein we have an html form and what we want to do is to change the values in the form and be able to reflect it in the DOM of that html. we also want to access this particular DOM in the
java side. as of now, we have this mini sample where we are doing this:
---------------------------------------------------------------------
File file = new File("htmlFile.htm");
DocumentBuilder builder;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
builder = factory.newDocumentBuilder();
Document document = builder.parse( file );
NodeList nodelist = document.getElementsByTagName("INPUT");
final Element element = (Element)nodelist.item(0);
EventTarget RecEvent = (EventTarget)element;
RecEvent.addEventListener("click", new EventHandler(), false);
Button EXTRAbutton = new Button(shell, SWT.PUSH);
EXTRAbutton.addSelectionListener( new SelectionAdapter()
{ public void widgetSelected( SelectionEvent e ) {
System.out.println(element.getAttribute("VALUE")) ;
} } );
-------------------------------------------------------------------------
and the html file is:
<head>
script type = "text/javascript"
function changeOnKlick () {
document.getElementById("10").setAttribute("value", "hello");
}
/script
/head
body
form
INPUT id = "10" TYPE="button" NAME="5" VALUE="click" onKlick="changeOnKlick()" /
/form/body
--------------------------------------------------------------------------
what we want to do is to change the value attribute of the button (id = 10) and at the same time, be able to access that change from our java code (that is the purpose of the EXTRAbutton in the java code) however we only succeed in changing the value of the button in the javascript part but pparently in the java code, we're still accessing the original DOM and the tree was not changed. we need help to do that. thank you very much. any help would be greatly appreciated. thanks.