Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » swt browser class, how to get the value of the html controls
swt browser class, how to get the value of the html controls [message #853702] Mon, 23 April 2012 04:59 Go to next message
Eclipse UserFriend
swt browser class, how to get the value of the html controls
Re: swt browser class, how to get the value of the html controls [message #853748 is a reply to message #853702] Mon, 23 April 2012 05:47 Go to previous messageGo to next message
Eclipse UserFriend
You can use the following function to run JavaScript Code and then return the desired value in the JavaScript code.

help.eclipse.org/galileo/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/browser/Browser.html#evaluate(java.lang.String)

Object value = browser.evaluate("return document.getElementById('YOUR_CONTROLS_ID').value");


You are able to access everything via JavaScript and DOM.

You can also execute JavaScript methods/functions like

Object value = browser.evaluate("getACertainValue()");


As you can see in the JavaDoc of the evaluate method, the following types of objects can be mapped from JavaScript to an Java object:

javascript null or undefined -> null
javascript number -> java.lang.Double
javascript string -> java.lang.String
javascript boolean -> java.lang.Boolean
javascript array whose elements are all of supported types -> java.lang.Object[]

Best regards,

Simon

[Updated on: Mon, 23 April 2012 08:08] by Moderator

Re: swt browser class, how to get the value of the html controls [message #854443 is a reply to message #853748] Mon, 23 April 2012 20:45 Go to previous message
Eclipse UserFriend
thank you

[Updated on: Mon, 23 April 2012 21:13] by Moderator

Previous Topic:How can I select an item in a tree programmatically?
Next Topic:Importing WTP xml editor functionality in to an RCP
Goto Forum:
  


Current Time: Tue Jul 22 12:43:24 EDT 2025

Powered by FUDForum. Page generated in 0.17103 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top