Re: GWT MVP architecture redirect link page with URL parameters passing

2010-04-25 Thread branflake2267
Hi Mahmoud,

Yes, this is very possible to do. Have any widget add a history
handler, and watch for any history change event, and then fire the
widget state accordingly as you see fit. I like doing it this way. You
can pass any number of parameters in to change the widgets/app state.

domain.tld#historyToken?[?params1=aparams2=b]
I do this in my core project I am building.
http://code.google.com/p/gwt-examples/source/browse/trunk/Core/src/org/gonevertical/core/client/global/QueryString.java

Here is how I manage the default History Observations:
http://code.google.com/p/gwt-examples/source/browse/trunk/DemoCoreEngine/src/com/gawkat/demo/client/DemoCoreEngine.java
private void initHistory() {
String historyToken = History.getToken();

if (historyToken.length() == 0) {
  History.newItem(account_Things);
}
  }

This will watch/observe the the querystring events (url):
History.addValueChangeHandler(this);

Hope that helps,
Brandon Donnelson
http://gwt-examples.googlecode.com


On Apr 23, 8:38 pm, Mahmoud mahmoud.abounas...@gmail.com wrote:
 Hello,
 I have followed the MVP structure while developing my project.
 Once I hit the site URL, the History Manager loads the module by
 inserting the default token to the history stack and then from there
 the user can redirect himself to any part of the application by
 changing the History token, which is basically the bit that comes
 after the pound symbol (#) in the URL

 My problem is: I'm unable to redirect a user to a specific token
 without having to go through the default token and from there to
 anywhere I want.

 In other words, the URLs history usual follows this:http://domain#defaultToken
 and from there I can go tohttp://domain#page1orhttp://domain#page2
 without any problem.

 But if i want to go directly tohttp://domain#page1i will be
 redirected to the default token which ishttp://domain#defaultToken...
 mainly due to this snippet of code:

                 this.container = container;

                 if (.equals(History.getToken())) {
                         History.newItem(defaultToken);
                 } else {
                         History.fireCurrentHistoryState();
                 }

 So my question is: Is it possible to redirect a user to any part of
 the application without having to start from the defaultToken page?
 And can we pass in parameters using the URL only (i.e: how can the
 user hit the following link without 
 errors?:http://domain#page3?param1=aparam2=b)
 ? How those it work?

 To concertize the problem, I'm trying to implement an activation
 link that if once the user clicks on it he will activate his account
 given the userID and a encrypted code 
 (i.e:http://domain#activate?userID=12code=ht2oj34j2k5j6pk3
 )

 Any advice will do,
 Cheers,
 Mahmoud

 --
 You received this message because you are subscribed to the Google Groups 
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/google-web-toolkit?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT MVP architecture redirect link page with URL parameters passing

2010-04-24 Thread Paul Stockley
Use something like History.newItem(page3?param1=aparam2=b);

This will rewrite the current URL and store it in the browsers
history. The onChange history event will then be fired.

On Apr 23, 11:38 pm, Mahmoud mahmoud.abounas...@gmail.com wrote:
 Hello,
 I have followed the MVP structure while developing my project.
 Once I hit the site URL, the History Manager loads the module by
 inserting the default token to the history stack and then from there
 the user can redirect himself to any part of the application by
 changing the History token, which is basically the bit that comes
 after the pound symbol (#) in the URL

 My problem is: I'm unable to redirect a user to a specific token
 without having to go through the default token and from there to
 anywhere I want.

 In other words, the URLs history usual follows this:http://domain#defaultToken
 and from there I can go tohttp://domain#page1orhttp://domain#page2
 without any problem.

 But if i want to go directly tohttp://domain#page1i will be
 redirected to the default token which ishttp://domain#defaultToken...
 mainly due to this snippet of code:

                 this.container = container;

                 if (.equals(History.getToken())) {
                         History.newItem(defaultToken);
                 } else {
                         History.fireCurrentHistoryState();
                 }

 So my question is: Is it possible to redirect a user to any part of
 the application without having to start from the defaultToken page?
 And can we pass in parameters using the URL only (i.e: how can the
 user hit the following link without 
 errors?:http://domain#page3?param1=aparam2=b)
 ? How those it work?

 To concertize the problem, I'm trying to implement an activation
 link that if once the user clicks on it he will activate his account
 given the userID and a encrypted code 
 (i.e:http://domain#activate?userID=12code=ht2oj34j2k5j6pk3
 )

 Any advice will do,
 Cheers,
 Mahmoud

 --
 You received this message because you are subscribed to the Google Groups 
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/google-web-toolkit?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT MVP architecture redirect link page with URL parameters passing

2010-04-24 Thread Mahmoud
That's parameter passing within the web application, what about the
first part of my question? the most important one to me

On Apr 24, 7:46 am, Paul Stockley pstockl...@gmail.com wrote:
 Use something like History.newItem(page3?param1=aparam2=b);

 This will rewrite the currentURLand store it in the browsers
 history. The onChange history event will then be fired.

 On Apr 23, 11:38 pm, Mahmoud mahmoud.abounas...@gmail.com wrote:





  Hello,
  I have followed the MVP structure while developing my project.
  Once I hit the siteURL, the History Manager loads the module by
  inserting the default token to the history stack and then from there
  the user can redirect himself to any part of the application by
  changing the History token, which is basically the bit that comes
  after the pound symbol (#) in theURL

  My problem is: I'm unable to redirect a user to a specific token
  without having to go through the default token and from there to
  anywhere I want.

  In other words, the URLs history usual follows 
  this:http://domain#defaultToken
  and from there I can go tohttp://domain#page1orhttp://domain#page2
  without any problem.

  But if i want to go directly tohttp://domain#page1iwill be
  redirected to the default token which ishttp://domain#defaultToken...
  mainly due to this snippet of code:

                  this.container = container;

                  if (.equals(History.getToken())) {
                          History.newItem(defaultToken);
                  } else {
                          History.fireCurrentHistoryState();
                  }

  So my question is: Is it possible to redirect a user to any part of
  the application without having to start from the defaultToken page?
  And can we pass in parameters using theURLonly (i.e: how can the
  user hit the following link without 
  errors?:http://domain#page3?param1=aparam2=b)
  ? How those it work?

  To concertize the problem, I'm trying to implement an activation
  link that if once the user clicks on it he will activate his account
  given the userID and a encrypted code 
  (i.e:http://domain#activate?userID=12code=ht2oj34j2k5j6pk3
  )

  Any advice will do,
  Cheers,
  Mahmoud

  --
  You received this message because you are subscribed to the Google Groups 
  Google Web Toolkit group.
  To post to this group, send email to google-web-tool...@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/google-web-toolkit?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/google-web-toolkit?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



GWT MVP architecture redirect link page with URL parameters passing

2010-04-23 Thread Mahmoud
Hello,
I have followed the MVP structure while developing my project.
Once I hit the site URL, the History Manager loads the module by
inserting the default token to the history stack and then from there
the user can redirect himself to any part of the application by
changing the History token, which is basically the bit that comes
after the pound symbol (#) in the URL

My problem is: I'm unable to redirect a user to a specific token
without having to go through the default token and from there to
anywhere I want.

In other words, the URLs history usual follows this: http://domain#defaultToken
and from there I can go to http://domain#page1 or http://domain#page2
without any problem.

But if i want to go directly to http://domain#page1 i will be
redirected to the default token which is http://domain#defaultToken...
mainly due to this snippet of code:

this.container = container;

if (.equals(History.getToken())) {
History.newItem(defaultToken);
} else {
History.fireCurrentHistoryState();
}

So my question is: Is it possible to redirect a user to any part of
the application without having to start from the defaultToken page?
And can we pass in parameters using the URL only (i.e: how can the
user hit the following link without errors?: 
http://domain#page3?param1=aparam2=b)
? How those it work?

To concertize the problem, I'm trying to implement an activation
link that if once the user clicks on it he will activate his account
given the userID and a encrypted code (i.e: 
http://domain#activate?userID=12code=ht2oj34j2k5j6pk3
)

Any advice will do,
Cheers,
Mahmoud

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.