java - How to open a sub window with a simple Link -
i want open vaadin sub window simple link. thing link accepts url, not window-object. there way following code work?
verticallayout todolist = new verticallayout(); todolist.setspacing(true); todolist.setmargin(true); todolist.setsizefull(); todolist.setsizeundefined(); // ... window mywindow = new window("my dialog"); mywindow.setpositionx(200); mywindow.setpositiony(100); todolist.addcomponent(todotable); link link = new link("click me!", new externalresource(mywindow)); todolist.addcomponent(link);
do way:
todolist.addcomponent(todotable); button link = new button("click me!"); todolist.addcomponent(link); link.addclicklistener(clicklistener() { onclick() { window mywindow = new window("my dialog"); mywindow.setpositionx(200); mywindow.setpositiony(100); mainwindow.addwindow(mywindow); } });
from here:
https://vaadin.com/book/vaadin7/-/page/layout.sub-window.html
if wish open real browser window (not sub window) here:
https://vaadin.com/book/vaadin7/-/page/advanced.html
it depends if new window should part of vaadin app or other content or independent vaadin app instance.
Comments
Post a Comment