How to link multiple pages in GWT - gwt

I am new to GWT and so my knowledge is restricted.
Right now I have created a simple Login page which will take my user to another page and then based on the choices that the user makes, it will direct it to the next page. I have created 3 individual pages but I have no clue how to link them. Can someone please help.

In GWT typically you do not create separate pages - you create separate "views". They may look like pages to an end user, but in reality the entire app works in a single HTML "host" page.
You may want to look at the Activities and Places design pattern. It takes care of navigation between different "places" within your app.

very simple example with a DeckPanel. It shows only the selected 'page' and hides the other ones
DeckPanel deckPanel = new DeckPanel();
deckPanel.add(page1);
deckPanel.add(page2);
deckPanel.add(page3);
deckPanel.showWidget(0);
//deckPanel.showWidget(1);
//deckPanel.showWidget(2);

Related

Adsense with dynamic content

I know that this topic has been discussed before in varying extent but I have some specific queries. I will use an example for this case and would like to request you for your views.
Example:- A home finance management website. There are two pages. The basic page after login is an empty page with a text box. Type in "Rent" and rent details and trends pop up. Type in "Bills" and bill details and history pop up. The data shown to user is different of course.
Now -
1. If I place an Adsense script in the basic home page where I just have a text box, will it be disqualified for not having enough content ?
2. Even if the content changes (AJAX), does the ad change to suit the content ? Does the crawler keep a constant check of index the pages after defined intervals and whatever it finds there is kept and searched for keywords ? The same page may show different content to different users and hence have different keywords. (Also, since login would be cookie based, how does crawler see this page ?)
Edit -
I know from HERE that Google does take AJAX calls into account but since the results would be dynamically populated by accessing a database and while populating unique data, the bot looking at the form action page doesn't help much, does it?
3. Google prefers GET method. So if I go like this - xyz.com?show=rent / xyz.com?show=bills, the page is regenerated and the script reloaded but each time the crawler sniffs any one of the two pages, it might see different content for different users. What does it do ?
4. If I do not reload the page by form submission and the page is not regenerated every time, can I call a function to document.write the div I am putting the ad in ? Would that make it re-sniff the page ?
Any help is much appreciated.

Want to share a particular block or div from my entire page into facebook

I have a requirement that in a webpage I have multiple block of content which is wrapped inside individual DIV. Each block needs to have a share to facebook button.
Did many researches but couldn't find a solution. Please can anyone give me a suitable code or idea how I can share particular blocks/content wrapped inside a div into facebook.
For e.g.
I have three DIV in my page and each DIV has share button, when user clicks on any of the share button the respective DIV is shared.
Is there any solution to this requirement or whether is it possible to do. Any kind of suggestions are widely accepted.
Check out this HyperArts tutorial on adding a Share Button to an iFrame tab - you use the exact same code for your webpage. You will be using the Facebook JavaScript SDK.
At the end of the tutorial it explains how to modify it to allow for multiple Share buttons on one page. You just need to add a unique identifier for each one.

Facebook Dev: What is this?

Okay so for this page:
http://www.facebook.com/ESPN?sk=app_224097940938597
Which appears on the left hand bar between ESPN Fanwhich and ESPN Live Chat.
That isn't a canvas but it isn't a static page that I can gather. I found this tutorial: http://www.kimwoodbridge.com/how-to-add-a-custom-tab-to-a-facebook-fan-page/
But that is creating static content.
What I'm wondering is how I can create a dynamic page within a tab?
To create a "dynamic" page within a tab is pretty easy. Install the Developer's App and create a new application. There are tons of posts all over google about creating new Facebook apps, so you should be able to find those pretty easily.
After you create a new application, you set up the Tab information for it under "Facebook Integration."
The way tabs work is they create an iFrame in the Facebook canvas that loads a page from your webserver. You can do whatever you want within that iframe to make a dynamic page. Also, since it's an iframe, you can have links that go all over the place and build a whole mini-site which works inside the Facebook canvas.
Basically, you do the same thing you would normally do to create a dynamic page/site, and set up a Facebook application that points to it. There are a few caveats to building Facebook applications, but they're hard to enumerate without specific scenarios. The biggest one (and it's well documented) is that the size of a tab is 520px wide, so whatever you build has to fit within that width. The length can be whatever you want, Facebook has APIs in place that let you automatically resize the iframe as needed.
Good luck, and welcome to Facebook programming. Prepare to rip your hair out, because everything changes every 4-6 weeks :x

MVC Facebook application - dual template

Maybe this is a stupid question and I did not understand exactly how Facebook applications work but here it goes
I want to implement a small e-shop as a Facebook application and for the products to have like button. The application will be instaled on a business page.
The problem is that the link for the like post on the wall will be to the actual eshop not to the facebook application on the business page.(or is it possible to make it to the application (eg. when you click the browser goes to the business page, selects the eshop tab, opens the product)?)
So actually I need to make a eshop site with 2 templates one for outside view and one for IFrame facebook view.
Is it possible to detect (from code-behind not in javascript) If the request is from the iframe or directly from outside?
Or the solution is more simple.. create a small version of the shop for browsing products only to be viewed in facebook and a full shop for outside view and the only relation between them is that when you click the like post from the first one you go to the second one?
I think I have found a solution...
I have created 2 domains that point to the eshop
shop.domainname & facebook.shop.domainname.
And in code behind I can check the Request.Url.Host if it starts with facebook.
For the facebook app the canvas url will be with facebook.shop.domainname and the links from the like button will be for the shop.domainname.
In this way I should be able to use 2 templates for the site and detect witch one I shoul use....

Facebook App Setup

I created FB application that use iframes, and it's working okay, as it should, BUT I need to check from what page is calling it.
I want different pages to pass different variables to that iframe location.
I already know how to set up it to three levels ( original page, application page, and on tab page, with different display content ), but I need to check from what page it's called.
I am thinking that it can be done in 2 ways:
1 way: Find way to pass specific variable based on page that is using this application as tab, and then redirect it to right location
2 way: Find way to create new application outside facebook ( maybe API or something ) and then enter all those values including: App name, app link that have this variable included, app tab link, using iframe and not FBML...
I will love to use 2. way...
I'm not asking you to show me code, I know that I need to do my job, I'm not asking you to do it for me, I'm just asking for help, for directions from someone who already create something like this, to point me to right direction where can I find way...
Also, please don't tell me to read bunch of stuffs, like FB Documentation or whole book that have all other "not-used-here" stuffs, I need specific part where there is a word about this...
If someone know anything about this, write it here...
Thank you!
The "page" parameter is passed along within the "new" signed_request parameter on (iframe) tabs. You get what you need for "free" ;)
page: A JSON object containing the page
id string, the liked boolean if the
user has liked the page, the admin
boolean if the user is an admin. Only
available if your app is an iframe
loaded in a Page tab.
http://developers.facebook.com/docs/authentication/signed_request/