This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 255831 - boot-fx presenter cannot be used multiple times
Summary: boot-fx presenter cannot be used multiple times
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Html4j (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-09 11:30 UTC by Jaroslav Tulach
Modified: 2015-10-11 05:26 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2015-10-09 11:30:04 UTC
Following should work with boot-fx's presenter:

@Model(className = "MainCntrl", targetId = "", properties = {
    @Property(name = "value", type = String.class)
})
public class Main {
    public static void main(String... args) throws IOException {
        BrowserBuilder bb = BrowserBuilder.newBrowser().loadPage("page1.html").loadFinished(new Runnable() {
            @Override
            public void run() {
                new MainCntrl("first page").applyBindings();
            }
        });
        showAsync(bb);

        BrowserBuilder b2 = BrowserBuilder.newBrowser().loadPage("page2.html").loadFinished(new Runnable() {
            @Override
            public void run() {
                new MainCntrl("2nd page").applyBindings();
            }
        });
        showAsync(b2);
    }

    private static void showAsync(BrowserBuilder bb) {
        new Thread("Show async") {
            @Override
            public void run() {
                bb.showAndWait();
            }

        }.start();
    }
}


currently it does not work.
Comment 1 Jaroslav Tulach 2015-10-11 05:26:09 UTC
http://hg.netbeans.org/html4j/rev/c535c36881af