Hi Muhannad,

> You will find that I have two divs on the home page (RPCServics.html):
> (1) menu div and (2) content div.
> In onModuleLoad() method I create two links <a href='home'>Home</a>
> and <a href='about'>About Us</a>. What I need exactly is when the user
> clicks "Home" link, then the "content" div will hold the HomePanel
> (it's a class you could find in com.ePediaSy.client.panels package),
> and when he clicks "About Us" link the content panel should hold the
> AboutPanel.
>

Why are you doing this? I think you are maybe making life necessarily
difficult for yourself. As Litty has commented a GWT application is
normally built around a single HTML page that has little or no content
apart from a single div to house the GWT javascript application that
is normally automatically generated for you by the project creator or
your IDE.

A more typical approach to your scenario would be to use, for
example,  a DockPanel. You might construct a navigation widget and
place it in DockPanel.NORTH. This might include a MenuBar,  Buttons,
Hyperlinks, whatever, but they are all GWT widgets.

You could implement your "content" using a Composite based around, for
example, DeckPanel or TabPanel and place this in DockPanel.CENTER.
That is a more "GWT" way to do things.

regards
gregor


> On Nov 6, 11:57 am, "Litty Preeth" <[EMAIL PROTECTED]> wrote:
>
> > Hi Muhannad,
>
> > Usually in GWT applications, you have one HTML page and the UI rendering is
> > done dynamically using javascript. You can create different panels for
> > different pages and add these panels to the RootPanel when a user clicks on
> > hyperlinks (in ur case). And while rendering these panels when you require
> > some data from the server, you can make RPC calls.
>
> > May be first you should go through some simple GWT tutorial before begining
> > your project.
>
> > Regards,
> > Litty Preeth
>
> > On Thu, Nov 6, 2008 at 1:05 PM, Muhannad <[EMAIL PROTECTED]> wrote:
>
> > > Hi Walden,
>
> > > I'm not sure that I got your idea, but I always had a concern about
> > > that so I'll share it with you:
> > > 1. Does the GWT application have just one html page (module-name.html)
> > > that all the content should be rendered there?
> > >    What I mean is that Litty wrote "if the URL ends with /about then
> > > the AboutService will be called". Well but what if that AboutService
> > > does not extends or consists of any UI element? What is gonna to be
> > > displayed on the browser?
>
> > > 2. What I've received from your idea above is, each service should
> > > have its own (index.html)??!! If that was the case, each time I click
> > > on a menu item then a whole new page is going to be rendered and the
> > > browser will send an HTTP request and page will be rebuilt and
> > > displayed, which is not the case here:http://extjs.com/Pleasetry to
> > > click any menu item and notice that only a portion of the page is
> > > rendered (the section under the menu) and not the whole page.
> > > Actually, this is exactly what I need to do but I think I was not
> > > clear enough.
>
> > > 3. Suppose that I want to pass parameters in the URL in some
> > > customized format; not using the regular way
> > >http://domain/service?param1=value1&param2=value2.
> > > For example, something like that:
> > >http://domain/service/param1/value1/param2/value2.
> > > Where should I write my own code that should take care of this
> > > customized URL "encoding"?? I mean, is there any place in GWT
> > > application where I could capture the URL and manipulate it before
> > > redirect it to some place depending on some parameters passed?? I
> > > guess there is something in .NET called HTTP Handler or Generic
> > > Handler to deal with that. I think this is an issue that the Web
> > > Server should deal with it not the GWT application???!!!
>
> > > Thank you very much.
>
> > > On Nov 5, 5:56 pm, walden <[EMAIL PROTECTED]> wrote:
> > > > Muhannad,
>
> > > > There's a problem with your assumptions.  When a user clicks on your
> > > > "about" menu link, she's not going to get a Panel, she's going to get
> > > > a whole new page fromhttp://domain/about/index.html.  That page can
> > > > be a GWT host file if you like, but this is regular HTML pages, not a
> > > > rich GWT client showing and hiding content based on menu navigation.
> > > > I think you'd better get your head around that first, and then tackle
> > > > the RPC URL binding question next, if it's even an issue at all.
>
> > > > Walden
>
> > > > On Nov 5, 5:12 am,Muhannad<[EMAIL PROTECTED]> wrote:
>
> > > > > Hi,
>
> > > > > I want to build a website with (Home, about, products, ...) menu. I
> > > > > need to build multiple forms (panels), each panel corresponds to one
> > > > > menu item, e.g. aboutPanel for "about" menu item, productsPanel for
> > > > > "products"...
>
> > > > > Moreover, I would like to implement that panel in terms of RPC
> > > > > services; I need to correspond each panel to a single RPC service that
> > > > > communicates with the server to get its data, build the whole form,
> > > > > and return the result as a panel to be displayed somewhere in the home
> > > > > page (for example).
>
> > > > > Of course, GWT allows us to define multiple services and add multiple
> > > > > <servlet path="/service" ...> to the module XML file.
>
> > > > > My problem is how to know which service should I instantiate depending
> > > > > on the URL mapping, i.e. suppose that the menu is defined as follow:
>
> > > > > <div id="menu">
> > > > >     <a href="index.html">Home</a>
> > > > >     <a href="/about">About us</a>
> > > > >     <a href="/products">Products</a>
> > > > >     ...
> > > > > </div>
>
> > > > > So when someone clicks the "About us" link, the URL would be "http://
> > > > > domain/about". So I should instantiate the "about" service and create
> > > > > an aboutPanel to display it. The same thing when s/he clicks the
> > > > > "Products" link, then the URL is "http://domain/products"; and, in this
> > > > > case, I should build the product panel...
>
> > > > > So, is there somewhere in GWT application that I could parse the URL
> > > > > and depending on the mapping portion of it "/about" or "/products"
> > > > > could I decide which service to instantiate? Or is there another
> > > > > better way to do that?
>
> > > > > Thank you very much in advance.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to