The easiest way is just to have the html in the host html page in a div with
display:none
Inside that div, have all the elements you need for the page, add widgets to
these elements with RootPanel.get("id").add(something); and set the
enclosing div to visible = true when you want it to be displayed.The other pages for a small app like this can also be shown and hidden as required in their own divs in the same way. As Alex said, you can keep the (GWT) 'pages' in their own html file, fetch them, extract the part you need and put it in an HTMLPanel as required. It doesn't seem worth it to me in this scenario. Ian http://examples.roughian.com 2009/7/30 Maarten Decat <[email protected]> > > I'm trying to make a small app to log darts games. Basically, it > should be possible to login with a user, register a new user, choose > all the options for a new game and play that game. Playing the game > means you just click the darts board on screen where you hit the board > and the program calculates scores etc. > > The game page exists of a darts board and all the statistics. This is > where I came up with my question because it is really hard to lay out > these things in Java code. So I started searching for a possibility to > load HTML (where the elements are layed out correctly) and work on the > elements by getting them with RootPanel.get("...") instead of building > the lay-out with panels in Java. Does this make it more clear what I'm > trying to do? > > Also, how do I actually load HTML from the server into my app through > Java? > > Maarten > > On 30 jul, 01:14, Ian Bambury <[email protected]> wrote: > > Yes, like I said. Do the layout in the HTML and the functionality in the > > java code. > > Why don't you give a simple example of what you are wanting to do. There > are > > many ways to do this and many levels of control you can give to the > people > > who do the layout. It's not really possible to give a one-size-fits-all > > solution. > > > > Ian > > > > http://examples.roughian.com > > > > 2009/7/29 Maarten Decat <[email protected]> > > > > > > > > > Okay, I think I'm starting to see the different options. > > > > > I can ask the same question more specific now. Formerly, I was used to > > > working like this: I wrote PHP and added all the elements I needed > > > (forms for example) in HTML. Someone else could take control of laying > > > out these elements in any way he liked. He could alter the HTML of the > > > page apart from my PHP and as long as the elements kept their names, > > > everything kept working. This way, I could fix my attention on the > > > program and others could fix their attention at the lay-out. > > > > > In GWT it's possible to create a lay-out by positioning different > > > widgets in Java code. It's also possible to give these widgets style > > > names which let CSS take control of their layout. But is it also > > > possible of laying out the elements without entering the Java code? I > > > can see how to seperate lay-out with program code but the lay-out > > > would still be specified in Java, no? > > > > > Maarten > > > > > On 29 jul, 20:21, Ian Bambury <[email protected]> wrote: > > > > You have html in your index file. You have code in your java files. > How > > > you > > > > split everything up is your decision. > > > > > > In your html host page, you could have 2 divs, defining the layout > for > > > page1 > > > > and page 2. In your GWT code, yo make one or other visible as you > need > > > them. > > > > > > It might get a little unmanageable for 100 pages, so you could have > html > > > > files on the server and go and pick them up as required. > > > > > > You can do both at the same time: have a basic menuing framework and > pick > > > up > > > > html from server-side pages and slot them into part of your app's > display > > > > area. That's what my examples site does, mostly to keep all the text > out > > > of > > > > the initial download. It also means you can easily arrange to get > > > spidered > > > > by search engines. > > > > > > Ian > > > > > >http://examples.roughian.com > > > > > > 2009/7/29 [email protected] <[email protected]> > > > > > > > Hi, > > > > > > > I've been trying out GWT for a couple of weeks now and stumbled > upon a > > > > > beginner's question relating multiple pages. > > > > > > > For example, let's suppose an application with users where you have > an > > > > > application page, a login page and a register page. Using GWT for > the > > > > > application page speaks for itself, but what about the other pages? > > > > > > > I've read the other topics about this problem in the group. It > seems > > > > > the proper GWT solution is to clear window and load another GUI > there. > > > > > This would actually wrap all the pages within the application. I > can > > > > > see how this solution would work, but then you lack a lot of > usefull > > > > > HTML pages that lay out the login and register forms. This way, > making > > > > > the lay-out of the page cannot be seperated from coding the > > > > > application, at least not in HTML vs GWT/Java. > > > > > > > Is there another way of working for this? One that does permit to > > > > > seperate page lay-out and coding? > > > > > > > Greets, > > > > > > > Maarten Decat > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
