This post i am not asking a problem but suggesting a feature request
for GWT.
========================================================

Now history stuff is working well, except few things(Basic GWT issue/
feature, because of its nature of converting java into javascript at
the time of compilation and the classes it supports in .client
packages).

I have declared the ValueChangeHandler but then in that code i need to
check one or more particular param, lets say page and then i write
5-10 if then else statement to call my proper handlers.

say if page=main, then call com.my.MainPanel.loadFromHistory(params)
say if page=editData1, then call
com.my.EditData1Panel.loadFromHistory(params)
say if page=editData2, then call
com.my.EditData2Panel.loadFromHistory(params)
say if page=showData1, then call
com.my.ShowData1Panel.loadFromHistory(params)
say if page=showData2, then call
com.my.ShowData2Panel.loadFromHistory(params)
etc etc


In Spring/MVC architect we have seen that we don't need to write such
ifs as DispatchServlet can read our xml and call our handlers
depending on xml content(url-handler mappings). In Spring it was
implemented using Reflection which cant be used in GWT as there are no
JAVA classes at run time, its all javascript. Understandable.No
argument over it but its still solvable.

We should not forget the javascript is loosely coupled language and
implementing such things(Reflection) should not be a big
hassle.Reflection makes Java loosely coupled at compile time(ofcourse
wrong types will create problem at runtime)

Solution :

We already have UIBinders where GWT compiler reads the xml and
generate proper java script. Why cant we have something like for
History(say HistoryBinder.xml) and i should be able to define some xml
like
<HistoryMapping>
  <HandlerMapping>
    <param name="page" value="main">
    <handler value="com.my.MainPanel" />
 </HandlerMapping>
</HistoryMapping>

And all handlers can implement a Interface like
public interface HistoryHandler{
public handleHsitory(Map<String,String> params, any other param which
is required)
}

and at compile time, compiler will check each class mentioned in this
xml and generate error if anything wrong with class else generate the
proper code behind the scene as lots of If then else(Compiler writers
cant use Reflection for generated scriptts too :) )

and then GWT can call our proper handler whenever history event occurs
and we will never have to implement ValueChangeHandler.And GWT will
also take care of converting our history tokens into proper hashmap
like structure or any other key-value pair structure.

 This will make code writing much easier, more understandable, makes
Developer's life bit easier. And i am sure it will add value to GWT.

Thanks,
Ravi




On Jun 2, 8:13 pm, Frederic Conrotte <[email protected]>
wrote:
> Hello
>
> You should check this book:http://apress.com/book/view/9781590599853
>
> And the associated website:http://code.google.com/p/tocollege-net/
>
> It mix both HTML/Freemarker templates with GWT modules.
>
> Fred
>
> On 1 juin, 18:02, ping2ravi <[email protected]> wrote:
>
>
>
> > Hi All,
> > I am trying to create a website and stuck with confusion over whether
> > to use GWT for presentation or JSP based framework like Spring MVC. I
> > want UI to be very user friendly,faster etc and this is possible with
> > GWT. But following problem comes with GWT
>
> > 1) Book marking of any page. As GWT is suppose to be one url
> > application and everything should come under it. But how i will solve
> > the problem if i have a site like Facebook, where url can be for User
> > profile(/profile/1), My Home(/home), community(/cpmm),video(/video)
> > etc. I can solve it by using one html and keeping everything as
> > params(i.e. /myapp.htm?type=profile&id=1) but then i feel its not how
> > GWT should be used or is this the only way i will be able to use it.
>
> > 2) Not searchable by Search Engines. Search engine can not see what
> > the content is as it always comes through RPC calls.
>
> > 3) Implementing History is Overhead, if i fix the issue 1
>
> > 4) Its not possibkle to mix jsps and GWT. I tried but GWT css start
> > interfaring with my CSS, first starting with changing background
> > color.
>
> > But i still like GWT but not sure how i will solve these problems.
>
> > Any suggestions/comments most welcome.
>
> > Thanks,
> > Ravi

-- 
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