JavaFX 2.0 :: JavaScript Not Working After Reload In WebEngine
Apr 9, 2015
Like the title says: I'm loading a local HTML file in a WebView which contains Javascript. The script works without any problem when the page is first loaded, but when I reload it or load another local page, Javascript simply stops working silently for no apparent reason and with no error or exception of any kind.
View Replies
ADVERTISEMENT
Apr 23, 2014
When the application starts and the index page is initially loaded, dialog is not shown correctly (panel is not shown) and shows that selected==null. But in debugger prepareSelect seems working correctly and selected is initialised (not null). When I reload page, dialog is shown correctly.
Below are facelets for the page composition and backing bean code.
Register.xhtml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
[Code] .....
View Replies
View Related
Nov 11, 2014
I am building an application which needs to be able to get the user's location. In JavaScript I would use navigator.geolocation.getCurrentPosition()
Does WebEngine support this function? Obviously it will only work if the device has GPS. I am targeting windows tablets and phones which will have it.
Can I use the webEngine.executeJavascript() to call the javascript if it is supported.
View Replies
View Related
Jun 2, 2014
I've searched everywhere but found no way to disable loading of images by Java WebEngineHow to do it?
Research done:
I found some ideas, such as using URL.setURLStreamHandlerFactory() to use my own URLStreamHandler, and having that analyze the URL to only return URLConnections for URL's that don't end in .jpg .png etc.
But that has many problems: Sometimes the image url doesn't end in .jpg, if it's a dynamic image, such as a captcha. So how can I disable automatic image loading from WebEngine?
View Replies
View Related
Sep 6, 2014
I have a WebView which displays a site. At a specific page I want to fill in some values into <input> elements. So i use such an event handler (browser is of WebView class)
browser.addEventHandler(MouseEvent.MOUSE_CLICKED,
new EventHandler<MouseEvent>(){
public void handle(MouseEvent e) {
Document doc = webEngine.getDocument();
if (doc == null) {
System.out.println("Doc is null");
[Code] ....
The handler sets the "value" but view doesn't reflect that, field is empty.
View Replies
View Related
Jul 6, 2015
I'm trying to open URL's that the WebView considers Popups (it triggers the PopupHandler installed through onCreatePopupHandler) in an external In the PopupHandler I return a Webengine on which I installed a StateChanged listene and when the State changes to SCHEDULED I run some code top get the location of the WebEngine and open that URL in an external browser and then cancel the loading of the URL by canceling the LoadWorker using the LoadWorker.cancel() method wrapped in a Platform.runLater(..) call (in order to not crash the JVM).
However, then the PopupHandler is invoked because a window.open(url) was called in JavaScript in the main WebEngine, something odd happens: while the canceling of the loadworker was successful (it returns true and the LoadWorker goes to state CANCELLED), all of a sudden the state goes back to scheduled and my StateListener is called again with a newState of SCHEDULED, to if I don't work around it, the URL is opened again in the external browser. I can work around this by keeping track if the URL was already opened in the external browser once, but from what I can tell, this is just a bug.
View Replies
View Related
Apr 27, 2015
I get this error when I load a HTML page with WebEngine. The HTML is getting generated by an own (Java-)ServerSocket. How can I figure out where the problem is? I can load the HTML file successfully when loading the(same) generated HTML file from the local filesystem. Maybe the http headers causing these problems ? On the other hand I can load the page without problems in Firefox. How to get more information ?
View Replies
View Related
Mar 19, 2015
I'm beginner with javaFX and i need to change language of the screen. but how to reload the screen when the language was changed. The application have a button where have the language available. I want just refresh screen when the user change language. Here is the start method to show the stage.
@Override
public void start(Stage stage) throws Exception
{
this.stage = stage;
Locale locale = Locale.getDefault();
ResourceBundle rb = ResourceBundle.getBundle("resources/Label",locale);
[Code] .....
Here is the function to change the language(in the same class with start function),the rb is the new ResourceBundle:
public void refresh(ResourceBundle rb)
{
//change the language here
}
1. I don't want to use the resourceBundle to get value in resource file and set label in scene one by one.like following:
this.btnLabel.setText(rb.getString(key.test));
...
2. I don't want to reload the scene,like following:
public void refresh(ResourceBundle rb)
{
try
{
loader = new FXMLLoader(getClass().getResource("FXMLDocument.fxml"),rb);
root = (Parent)loader.load();
[Code] .....
So do we have a solution to just set the resourceBundle and reload the scene easier?
View Replies
View Related
May 9, 2014
In the below example i'm trying to add a combo box inside a subscene. But it is not working correctly .If I select a value from the combo box ,it's is not set in the combobox and the combobox values are not displaying properly.
package javaFxExamples;
import javafx.application.Application;
import javafx.beans.binding.When;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.DoubleProperty;
[Code] .....
View Replies
View Related
Jul 22, 2014
I have developed JavaFx application with playback option using JavaFx Media player and slider controls. I am updating slider value using javafx mediaplayer.currentTime().addListener() method by adding Change/Invalidate listener.
While playing MP4 video, slider values are not updating (Change/Invalidate listener not getting triggered while playing video) on Mac OS(version : 10.9.1). Below is the sample code snippet.
mediaPlayer.currentTimeProperty().addListener(new InvalidationListener() {
@Override
public void invalidated(javafx.beans.Observable o) {
updateSliderValue();
}
});
View Replies
View Related
Oct 1, 2014
I would like to bind the width of the second column of my TableView with the width of my TableView.
My custom TableView class :
public class CustomTableView<T> extends
TableView<ObservableList<Pair<String, Object>>> implements Cloneable {
private static Logger logger = Logger.getLogger(CustomTableView.class);
private double prefWidth; // optionnel private double minWidth; // optionnel
private double maxWidth; // optionnel private double height; // optionnel
private List<InfoColumnBean> cols; // optionnel
[Code]....
View Replies
View Related
Jul 9, 2014
Can I reload a particular div tag of jsp file from servlet?
View Replies
View Related
Apr 19, 2014
I am working on a project and for one step, I need to load an array (which in this case, students[]), with the records in another file.
So, should I used the try, catch method?? I am just not sure about the array. I know how to read from a file, but, I didn't get the idea of loading an array.
View Replies
View Related
Apr 22, 2014
I've got a similar problem like here: URL...
private void btnAktualisierenActionPerformed(java.awt.event.ActionEvent evt) {
if(sql.conOK) {
tabelle.table.tableChanged(null);
tablePanel.remove(scrollPanel);
// The following fetches the new database data and adds the new jFrame
tableExists = false;
this.getTable();
tabelle.setOptions();
}
else
lblStatusCon.setText("Bitte zur Datenbank verbinden.");
}
this is what I've been doing. It shows only the new jTable when I resize the window.
View Replies
View Related
Aug 23, 2014
Is there a way to reload the page after uploading the files with the command
<p:fileUpload value="#{excursion_type.main_photo}" mode="advanced" allowTypes="/(.|/)(gif|jpe?g|png)$/" auto="false"
fileUploadListener="#{excursion_type.uploadMultiple}" update="msg" />
Cause the user does not see the lattest photos after uploading need to do reload to see them cause ajax request.
View Replies
View Related
Jan 25, 2013
I have to show more than one images on a jsp page which are frequently refreshed. I am getting images in stream from client end and i want to show them on jsp. How can show them on jsp and refresh them after getting new image from client side?
View Replies
View Related
Dec 7, 2014
I have a class with static ArrayLists to hold objects such as Members,Players etc.I want to save the class with the arrays so as to reload them again and hold onto the list of objects within those ArrayLists.
The ArrayClass
import java.io.Serializable;
import java.util.ArrayList;
public class ArrayClass implements Serializable {
[code]....
The arrays within the ArrayClass are empty when i reload the application.I cant tell if the arrays are being properly saved or is it in the reloading from file???
View Replies
View Related
Apr 10, 2014
I am developing an application to share my client screen with server, it is working well on swing. But i want to develop as web application, i am trying to using applet. But i am facing the fallowing problem..,
1) The Applet screen also open and project also running well on server mechine. But unable to see the client screen on the server.
2) The problem may be to display the JDesktopPane or JInternalFrame.
My working Server Code extends withe JFrame..Java Code:
package remoteserver;
import java.awt.BorderLayout;
import java.awt.Container;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import javax.swing.JApplet;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
[code]....
View Replies
View Related
Feb 5, 2014
I have a java application in which when starting it a map is opened and a screen is captured. The capturing is in certain time interval. I want to enable the user to change the interval for the automatic capturing the map. I placed a text box in a JPanel. I want to pass the value which was entered in it to the html page which opens a Google map. Since I am new in java programming, I found that I can do it by using applets. I made an applet, and tried to call it in the html file. But now instead of opening the map file in a browser, it opens very quickly only black window.
Here is my applet:
package cege.ui;
import java.applet.Applet;
import java.io.IOException;
import cege.ui.GuiMain;
public class AppletTInterval extends Applet {
private int TimeInterval=0;
[Code] .....
And the code in the html file where I try to call the applet, i.e. to pass the value which is returned by the applet is:
<script src=
<!--"https://www.java.com/js/deployJava.js"></script>
<script>
var attributes = { id:'AppletTInterval',
code:'cege.ui.AppletTInterval', width:1, height:1} ;
var parameters = { jnlp_href: 'AppletTInterval.jnlp'} ;
[Code] .....
Can I use this way to pass a value from the java class file (from the JTextField into the html file?
View Replies
View Related
Jul 11, 2014
how to program in Javascript, I am wondering what are the advantages and disadvantages OR pros/cons of using JS versus say a language like Java?
View Replies
View Related
Jul 25, 2014
In my JSP file I need to rewrite the content of a <div> using Java script. <div> contains the JSP scriptlet tag.
View Replies
View Related
Mar 16, 2014
I am taking Python this semester. Our teacher wants us to convert Python to JavaScript without really explaining how or/and expecting us to be familiar with it already.Python Program I have is pretty simple - it prompts you to enter your first and last name and end your DNA string, "CAG" repeats are counted by another function and the result is passed to function that identified weather you may have huntington's decease or not.
<body>
<p>Enter First Name: <input type="text" size="25" id="firstname" value="">
<p>Enter Last Name: <input type="text" size="25" id="lastname" value="">
<p>Enter DNA: <input type="text" size="25" id="DNA" value="" >
<p><button onclick="alertt(f,l,d,c,p)" style="background-color:pink"><b>PRESS TO FIND OUT RESULT</b></button></p>
<script>
[code]...
When I run it there is an issue with countCAG and prediction functions :( I would run each one individually in JS console and I get Undefined, or InvalidString I read that I am supposed to use var in front of each variable, unlike in Python where you just assign variable a value without any add-ons in the front. But JS console seems to recognize both ways of assigning, however var smth=0 immediately evaluates to Undefined, and smth=0, gives me 0...
View Replies
View Related
May 1, 2014
I am trying to run a sign up page. The page is working properly and takes me to the login page when completed as it should. But when a field is left blank it is supposed to show an error message and keep them on the signup page, and it is not doing that. Sign Up Action:
<%
String field = "";
String message = "";
if ((request.getParameter("lastname") != null) &&
(request.getParameter("firstname") != null) &&
(request.getParameter("sadress") != null) &&
(request.getParameter("city") != null) &&
(request.getParameter("state") != null) &&
(request.getParameter("zipcode") != null) &&
[code]....
View Replies
View Related
Jun 10, 2014
I have a Javascript COMserver code :
<script language="JScript">
var ComServer;
function CreateSQLAccServer () {
ComServer = new ActiveXObject('SQLAcc.BizApp');
[Code] ....
But, now i would like to move the javascript code into java application base system. I try :
ActiveXComponent Comserver = new ActiveXComponent("SQLAcc.BizApp");
but it having error and continue step how i do the checking see the Comserver is login or not?
View Replies
View Related
Aug 20, 2014
In my jsp, I have a table with some file paths with this I have to get the file and send it to server. I am able to read the file name, size and file as binary using files of javascript. But after that I need to send those files by storing in a byte array to servlet which I am not able to that. Is there any way I can send that. My requirement is I need to upload those files to server side.
View Replies
View Related
Dec 21, 2014
I an using a pop out java script and in the notes it says
if later on you want to open / close a specific item you could do it like so:
ExpandingMenu.openItem(3); // toggles item 3 (zero-based indexing)
*/
How to call the function from a button click. I have some button already on my page like so
<li><a href="#">Menu3</a></li>
And from what I have read I should be able to do this:
<li><a href="#" onclick="ExpandingMenu.openItem(3)">Menu3</a></li>
But I don't get any response ..... no error message NOTHING
View Replies
View Related