I would like to know if there is a built in way in GWT to read and
inject HTML content. At least 50% of the site I am planning has static
HTML content that would not benefit from GWT one page model. I am
thinking in building a application that reads the static content using
java.io.File and injects into GWT using the HTML widget.
I would like to know if there are any alternatives.
I would suggest writing your page in the traditional way and then only
filling in GWT for the sections you need. You typically do with
placeholders as divs and tds. For example:
<body>
Here is some HTML ...
<div id="gwt"></div>
Here is more HTML ...
</body>
...
EntryPoint {
RootPanel.get("gwt").add(new Label("Here is GWT HTML ..."));
...
}
On Nov 2, 7:17 pm, compuroad <wilson.ferreira...@gmail.com> wrote:
> I would like to know if there is a built in way in GWT to read and
> inject HTML content. At least 50% of the site I am planning has static
> HTML content that would not benefit from GWT one page model. I am
> thinking in building a application that reads the static content using
> java.io.File and injects into GWT using the HTML widget.
> I would like to know if there are any alternatives.
Thanks for the sugestion. But what do I do with "navigation". GWT is a
"one page" show. When the user needs to create an account on the site
I need to clear the "Home" content and replace with a GWT generated
"Create Account" page/content. But since my home is static HTML, how
am I going to do it?
On Nov 3, 3:53 am, rjcarr <rjc...@gmail.com> wrote:
> I would suggest writing your page in the traditional way and then only
> filling in GWT for the sections you need. You typically do with
> placeholders as divs and tds. For example:
> <body>
> Here is some HTML ...
> <div id="gwt"></div>
> Here is more HTML ...
> </body>
> ...
> EntryPoint {
> RootPanel.get("gwt").add(new Label("Here is GWT HTML ..."));
> ...
> }
> On Nov 2, 7:17 pm, compuroad <wilson.ferreira...@gmail.com> wrote:
> > I would like to know if there is a built in way in GWT to read and
> > inject HTML content. At least 50% of the site I am planning has static
> > HTML content that would not benefit from GWT one page model. I am
> > thinking in building a application that reads the static content using
> > java.io.File and injects into GWT using the HTML widget.
> > I would like to know if there are any alternatives.
Is absolutely true. Given that, you'll have to come up with the
solution that suits you best. Some options are:
1) Don't use GWT for the login and have it redirect you to your GWT
page when you've authenticated.
2) Integrate your login into GWT and have it replace the login with
content when you've authenticated.
3) Create 2 GWT apps, one for login and one for content.
On Tue, Nov 3, 2009 at 8:42 PM, compuroad <wilson.ferreira...@gmail.com> wrote:
> Thanks for the sugestion. But what do I do with "navigation". GWT is a
> "one page" show. When the user needs to create an account on the site
> I need to clear the "Home" content and replace with a GWT generated
> "Create Account" page/content. But since my home is static HTML, how
> am I going to do it?
> On Nov 3, 3:53 am, rjcarr <rjc...@gmail.com> wrote:
>> I would suggest writing your page in the traditional way and then only
>> filling in GWT for the sections you need. You typically do with
>> placeholders as divs and tds. For example:
>> <body>
>> Here is some HTML ...
>> <div id="gwt"></div>
>> Here is more HTML ...
>> </body>
>> ...
>> EntryPoint {
>> RootPanel.get("gwt").add(new Label("Here is GWT HTML ..."));
>> ...
>> }
>> On Nov 2, 7:17 pm, compuroad <wilson.ferreira...@gmail.com> wrote:
>> > I would like to know if there is a built in way in GWT to read and
>> > inject HTML content. At least 50% of the site I am planning has static
>> > HTML content that would not benefit from GWT one page model. I am
>> > thinking in building a application that reads the static content using
>> > java.io.File and injects into GWT using the HTML widget.
>> > I would like to know if there are any alternatives.
I would recommend to integrate the login into the GWT page. This works
very great
for me (collected good experience with it) and is easy to implement.
So everything
looks smooth.
On 4 Nov., 06:35, "Robert J. Carr" <rjc...@gmail.com> wrote:
> Is absolutely true. Given that, you'll have to come up with the
> solution that suits you best. Some options are:
> 1) Don't use GWT for the login and have it redirect you to your GWT
> page when you've authenticated.
> 2) Integrate your login into GWT and have it replace the login with
> content when you've authenticated.
> 3) Create 2 GWT apps, one for login and one for content.
> There are probably other options I'm missing ...
> On Tue, Nov 3, 2009 at 8:42 PM, compuroad <wilson.ferreira...@gmail.com> wrote:
> > Thanks for the sugestion. But what do I do with "navigation". GWT is a
> > "one page" show. When the user needs to create an account on the site
> > I need to clear the "Home" content and replace with a GWT generated
> > "Create Account" page/content. But since my home is static HTML, how
> > am I going to do it?
> > On Nov 3, 3:53 am, rjcarr <rjc...@gmail.com> wrote:
> >> I would suggest writing your page in the traditional way and then only
> >> filling in GWT for the sections you need. You typically do with
> >> placeholders as divs and tds. For example:
> >> <body>
> >> Here is some HTML ...
> >> <div id="gwt"></div>
> >> Here is more HTML ...
> >> </body>
> >> ...
> >> EntryPoint {
> >> RootPanel.get("gwt").add(new Label("Here is GWT HTML ..."));
> >> ...
> >> }
> >> On Nov 2, 7:17 pm, compuroad <wilson.ferreira...@gmail.com> wrote:
> >> > I would like to know if there is a built in way in GWT to read and
> >> > inject HTML content. At least 50% of the site I am planning has static
> >> > HTML content that would not benefit from GWT one page model. I am
> >> > thinking in building a application that reads the static content using
> >> > java.io.File and injects into GWT using the HTML widget.
> >> > I would like to know if there are any alternatives.
What I do is create a complete html file for each page. This allows my site
to get spidered, allows updates without recompiles, easier to write than
Java strings, etc. In the GWT app, I just use requestbuilder to get the page
directly, strip out the content, and put it in an HTMLPanel (so I can get at
the elements by id)
There's no need for any server-side code to get and return the html.
> I would like to know if there is a built in way in GWT to read and
> inject HTML content. At least 50% of the site I am planning has static
> HTML content that would not benefit from GWT one page model. I am
> thinking in building a application that reads the static content using
> java.io.File and injects into GWT using the HTML widget.
> I would like to know if there are any alternatives.
On Wed, Nov 4, 2009 at 2:04 AM, gwtfanb0y <siegfried.b...@googlemail.com>wrote:
> I would recommend to integrate the login into the GWT page. This works > very great > for me (collected good experience with it) and is easy to implement. > So everything looks smooth.
Siegfried, what is the mechanism to start with a login page view, then switch to the application view once authenticated, but still using the same base HTML page?
How do you swap out the login page layout and put in the new one? And presumably if your RPC shows they are no longer logged in, it can then revert back and display the login page view again.
Is there a way to create these as separate modules (new to all of this) and then have them swap in/out? And it seems like there would be more issues for memory leaks and such doing this as you'd certainly need to be sure to clear out all objects in the other views as they change.
I know it's possible as I've seen in in gmail, switching from inbox to contacts, etc., but not clear how to make it work. Any code examples we can study?
Now follow to the method "go", you can see that the "container" is
currently null. The method "checkIsUserInSession()"
decides what to show. I am using Spring Security in the backend to
check user permissions and return a UserModel
with a simple boolean inside it (for this example i have modified it
to make it simple). The methods "showMain()" and
"showLogin()" are adding only components to the container. That's it.
> On Wed, Nov 4, 2009 at 2:04 AM, gwtfanb0y <siegfried.b...@googlemail.com>wrote:
> > I would recommend to integrate the login into the GWT page. This works
> > very great
> > for me (collected good experience with it) and is easy to implement.
> > So everything looks smooth.
> Siegfried, what is the mechanism to start with a login page view, then
> switch to the application view once authenticated, but still using the same
> base HTML page?
> How do you swap out the login page layout and put in the new one? And
> presumably if your RPC shows they are no longer logged in, it can then
> revert back and display the login page view again.
> Is there a way to create these as separate modules (new to all of this) and
> then have them swap in/out? And it seems like there would be more issues
> for memory leaks and such doing this as you'd certainly need to be sure to
> clear out all objects in the other views as they change.
> I know it's possible as I've seen in in gmail, switching from inbox to
> contacts, etc., but not clear how to make it work. Any code examples we can
> study?
Decided to send this directly to your email in case you missed it in the google groups. I think your framework makes sense to me, except I'm not sure what super type (implemenst/extends) the components that you swap in and out are. They seem to have a getDisplay() method that itself has an asWidget() method, so not sure what I'd do with my current separate pages.
Of course, my current login page and my current main app page are all objects that implement EntryPoint. So I see I'll have a much smaller EntryPoint class in the new model, and its job will be to swap in the other two (and possible a few others as we grow, like a distinct logoff view, reset passwords, etc.) based on whether its logged in or not. But when I move most of the code in my existing classes that implement EntryPoint, presumably they should subclass/implement something in common so that the new EntryPoint class can do the swaps (and use getDisplay().asWidget()...).
Thanks for any insights...
On Thu, Nov 5, 2009 at 5:00 PM, Yozons Support on Gmail <yoz...@gmail.com>wrote:
Thanks for the answer. I don't know what getDisplay() does or where it's defined, but I figured I didn't really need it. I think I am now doing more or less the same as you, but my "page view objects" just return their topmost panel which is set into the app presenter's RootPanel, which in my case also does the EntryPoint. It seems to work great.
I suppose there's no time benefit to downloading of the application page views (I think there's some code splitting that may help in the now or in the future with 2.0), but it does snap nicely between views.
You are right, "getDisplay" is only an Interface and was not useful
for this example.
So you have moved from many to only one EntryPoint?
With code splitting in GWT 2.0 i think it is possible to show the user
a "loading in progress"-view,
like the same when your browser opens a big flash page.
On 10 Nov., 02:06, Yozons Support on Gmail <yoz...@gmail.com> wrote:
> Thanks for the answer. I don't know what getDisplay() does or where it's
> defined, but I figured I didn't really need it. I think I am now doing more
> or less the same as you, but my "page view objects" just return their
> topmost panel which is set into the app presenter's RootPanel, which in my
> case also does the EntryPoint. It seems to work great.
> I suppose there's no time benefit to downloading of the application page
> views (I think there's some code splitting that may help in the now or in
> the future with 2.0), but it does snap nicely between views.
Yes, I only have one EntryPoint now and it does look nicer and is snappier. I'll worry about code splitting later, I suppose. Right now, it's fine that everything is downloaded together. Hopefully it won't be too big a deal to partition it once that feature is available.