First of all thanks for taking the time to respond to my comment.
For your comments, I interpret the existing application must rebuild from scratch in my new Vaadin application. But it is precisely that, I do not want to do. What I need is to reuse the existing web application interface and some javascript code that has some built-in functionality, ie, do not understand why I have to rebuild the application, for that I make from scratch in vaadin. What I want is to make a Vaadin component from a web application that has only HTML and JavaScript, can not be that Vaadin not let me do that. I have not built a Vaadin component to the interface, but I guess the building is Vaadin UI components from the use of HTML and JavaScript code basically. HTML and JavaScript is interpreted by browsers, so why should rebuild the application, there are pieces that do not fit here.
I appreciate your response, but I’ll keep looking for an alternative to avoid having to rebuild the application in Vaadin.
Granted, it may seem contradictory but it is not, he explained:
I need to reuse, from Vaadin, the existing application so that later be part of a large development project. I’m working on a very ambitious project for which I decided to use the Vaadin framework. The application that want to reuse is only one component of the great project I’m developing for Vaadin. Logically I add some features, after the component encapsulates on a Vaadin.
You should be able to integrate your html/Javascript component easily. For communication with the Vaadin Server side use ServerRPC, ClientRPC and Shared states.
When your “component” is an entire page and not just a small js component that doesn’t exist in Vaadin (yet) i’d also recommend recreating the page with Vaadin components even if it’s a bit more work at first.
I think I understand your comments, that in order to run a website which already has JavaScript code calls, I have to develop a Vaadin component as explained in: https://vaadin.com/book/-/page/gwt.html , is my understanding correct?
With “CustomLayout” (https://vaadin.com/book/-/page/layout.customlayout.html) I managed to display the web page, but only shows me the html, vaadin not execute JavaScript code calls that already appear in the Web page. If browsers running
Why, Vaadin not running? That call javascript code is already in my html page I put in the “CustomLayout” at the end of all, are the browsers that display it.
The only explanation I can think of is that as the javascript code is not explicitly in the html page, it is implied, that is, in the html page only appear events associated with html code, but does not appear javascript. I guess that’s why Vaddin not run, because it also depends on the used javascript framework. All these assumptions are mine.
It has nothing to do with you html code. CustomLayout has special code in it that scans the html and removes all Javascript code from it except from event handlers like onclick=“alert(‘adsf’)” .
This has been done to prevent JS injection (i think)
Then, making me explain, I must assume that Vaadin does not allow reuse html pages with embedded javascript code … very bad news you just gave me, but thank you anyway, jajaj …
I consider this decision a conceptual error in Vaadin team. This enormously limits the possibilities of incorporating Vaadin components already built in pure HTML and JavaScript.
CustomLayouts are made for basic Html layouts, not for actual Html/Js components with logic in them. Integrating a html/Js page/component with the “Integrating a Javascript component” method i linked to above is actually really easy to do.
You should read the tutorial on the wiki page and have a go. Your Javascript Connector in that case would just be your slightly (and i really mean slightly) modified Html/JS page. The Server side of the “new” component can be really basic if you don’t need client<–>server communication.
I insist that all I need is my html page (with embedded javascript code) to run. As same does it in the browser, but this time, from a Vaadin application.
mpuebla, I don’t see your point here. Marius is telling you what to do to integrate Javascript with Vaadin and you always answer in a poor manner. You have to do your work here…
You should read the
book of vaadin diffinitely, first, and when you get used to it read
chapter 16 .
Let me ask you something… If you started a project using raw html and javascript code and you have reached a point in which you want to continue its development using vaadin, it’s a bad idea to turn to vaadin (it’s my humble opinion).
You’ll need to choose continueing with native html+js or, unfortunately, rewrite your code with Vaadin.
The latter option would be the best way. I can’t see a scenario in which you mix an application developed using two different “frameworks”. As I told you several post upwards, you can reuse your server calls if you make it through an API.
My apologies if I offended by my answers, it was not my intention. was just trying explain why the answers did not solve my problem. Apparently, there is no choice to rewrite the HTML code with Vaadin components and that will not, violate the principle of code reuse.
About his view on using Vaadin or not, I commented:
My intention was to continue to expand the application you think reuse, since Vaadin, building a Vaadin component so others could use it without knowing the javascript. I thought it was possible from Vaadin, I disagree with you when you say “using two different frameworks.” I’m by not mixing “two different” frameworks ", only I use Vaadin and pure html + javascript, which can be programmed from a plain text editor. Anyway think of that option.
In the “Integrating a Javascript Component” you can write Javscript code on the client. From there it should not be difficult to integrate an html file.
If you don’t want any communication to the serverside. You might even just use a BrowserFrame.