Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Update TextField value with javascript
Hi
Can the Window.executeJavaScript(String script) used to update a textfield value. Something like this
username = new TextField();
password = new TextField();
getApplication().getMainWindow().executeJavaScript(
"username.value = readCookie('uname');"
);
Not sure how to get the dom id for username field. Can someone help?
Why would you like to update a textfield with javascript? Why not just read the cookie on the server-side and say username.setValue(theNameOfTheUserReadFromCookie)?
Also you might want to consider using LoginForm that allows the browser to use remember passwords and usernames for your application.
Hi,
Can we run the Java Script and get the array from it and assign it to any variable using Vaadin?
Br,
Sankar