Entry point

73 views
Skip to first unread message

Ronit

unread,
May 14, 2023, 6:57:20 PM5/14/23
to GWT Users
Hello Team,

I am new to GWT and working on an existing system.

My application has already got an entry point. Can I have one more implementation of the Entrypoint ?

Thanks in advance 
Ronit

Colin Alworth

unread,
May 14, 2023, 7:10:28 PM5/14/23
to GWT Users
While it is technically possible to have more than one EntryPoint declared in your .gwt.xml files(s), order might be hard to control precisely. I believe the order is deterministic, but not strictly defined by the compiler (likely the order in which entry-point> tags are encountered when parsing .gwt.xml files, but since they are permitted to have cyclical dependencies, this is not always obvious).

With that said, this can be a good way to compile multiple independent applications into a single output JS (so that they avoid sending the same  classes to the browser multiple times. I've seen this done with a conditional at the top of each entrypoint, to that way one or more entrypoint can run at page load automatically, and each enhance the part of the page that matters specifically to them. Ideally in this case, order of execution will not matter, so the above concern won't apply.

Ronit

unread,
May 15, 2023, 12:44:47 AM5/15/23
to GWT Users
Thank you Colin for responding , 

Can we use the entry point for some specific page or widget in the application?
e.g. There is a dialog in the application on which if clicked on edit button , we see another dialog on which there is a button to add files. 
Can we use the entry point to drag and drop files over the area of that add file button ?

Regards
Ronit

Colin Alworth

unread,
May 17, 2023, 8:29:10 AM5/17/23
to GWT Users
The entrypoint is supposed to function as the start of the application - how do you "enter" into it. You likely don't encounter the same entrypoint more than once as the app is being used, and any/all entrypoints will run right at page load. Technically each of what you describe is probably possible, but it seems very likely that you wouldn't want to use an entrypoint to manage a dialog that is opened by clicking a button.

Typically, the entrypoint is used like a java public static void main method - just one, only do enough in it to start the application.
Reply all
Reply to author
Forward
0 new messages