GWT Entry point Configuration - gwt

HiI have to create one login module using GWT with RPC with the functionality of login, registration and forgotPassword. Login is working fine. Now i have to proceed for registration and forgot password but i have in trouble to configure entry point. In my login page i have created hyperlink "REGISTER" and "FORGOT PASSWORD" and when i will click on Register Hyperlink i want to open Registration page (created using GWT) but i have no idea to implement that. please provide me any useful suggestion..
Thanks
Arun

You can create Hyperlink objects that have tokens for example Register and forgotPassword. Then you add a HistoryListener or a ValueChangeHandler (depends on which version of GWT you are using) and then just add the page to the panel or if you want to do a redirect you can do a JSNI redirect.
public static native void redirect(String url)/*-{
$wnd.location = url;
}-*/;
Docs for GWT 2.0

Related

Can we call Lwc or Aura component inside VF Email Template

I have a requirement in which email notification we have to provide a link which will redirect approver immediately to the approval page. I found one relevant solution mentioned in below URL
URL :-
https://www.vandeveldejan.com/create-an-approval-notification-with-visualforce-email-template-containing-quote-and-quotelineitems/
which says to create visualforce component, I wanted to check if we can user LWC instead of visualforce.
As I am new to LWC expecting some help to understand if we can call LWC component inside Visualforce Email Template.
I have followed the same steps but wanted to know If I can use LWC compoenent or Aura instead of VF page compoenent
https://www.vandeveldejan.com/create-an-approval-notification-with-visualforce-email-template-containing-quote-and-quotelineitems/
No.
Think about it. You want to create an email that on opening would immediately start a browser (hope the user is logged in to salesforce) and navigate to some page? without user clicking anything? That'd be a security nightmare. Can I send you an email which will use your Amazon account to order some stuff for me ;)
You can't run javascript inside emails (and even if you could - email clients should block it) so no LWC runtime... How would it even login to SF to pull data?
You need to learn Visualforce for this email template or send the email straight from apex (write the email's plaintext/html body with apex)
You can create public community, create public page and add your custom AURA or LWC component. Then copy link to this public community with your new page and add recordId in URL. I did this in Lightning AURA.

How to access root panel from widget in Google Web Toolkit (GWT)

I have an entry point which handles
My main layout including menu, header and etc.Also it
has rootpanel.get().add (login)
at the end to show the login page (uibinder)
Login.java uses uibinder and it works perfectly using RPC with server side class and I have got a reponse from database for user authentication which has been living on Google cloud sql.
I am trying to redirect user after
Login to the home page but my problem is I can not access Root panel from Login.java.
Basically I want to change the root panel from widget and redirect the user to the appropriate page based on log in result.
Any help would be highly appreciated.
Thanks
You should be able to use RootPanel.get().clear() followed by RootPanel.get().add() from anywhere in your code (including from your Login class). Note that it is generally better to use RootLayoutPanel instead of RootPanel, and I would take Andrei's advice and take a look at activities and places.

asp.net webforms - facebook server side authentication on a page tab

I'm struggling for about 2 days with authenticating a user from the server side.
Using asp.net 4, c# web forms and starting to use the C# SDK, building an app for page tab.
I need to authenticate a user with the Oauth diag.
If I use Response.Redirect, I get a blank screen on the tab.
according to http://developers.facebook.com/docs/authentication/pagetab/
I need to send a JS command in order to change window.top.location but how do I do this?
my login url:
https://www.facebook.com/dialog/oauth?client_id=482264391791260&redirect_uri=http://www.facebook.com/pages/null/153715871344670/?sk=app_482264391791260&response_type=code&display=popup&scope=email
Thanks!
I need to send a JS command in order to change window.top.location but how do I do this?
The section entitled 2a. Redirect to OAuth Dialog upon page load on the very same page you mentioned has an example of doing exactly that …
So what exactly is your problem in getting it done?

smart gwt image upload

Is there a way to upload an image to the server using smart gwt? I noticed there isn't an image upload widget. Does anyone know of some open source code I could use to do this. Right now I'm using a regular upload form, that forces the page to reload.
I believe Smart does provide this functionality Upload.
The key is to use a hidden iframe page as the target so your app does not get reloaded.
This blog post seems to cover it.
For the JSNI on you hidden page in your app want something like:
public static native void uploadComplete() /*-{
$wnd.alert('Upload Complete');
}-*/;
Then on the hidden page specify in the body onLoad
window.parent.UploadComplete();

How to open GWT page from another GWT page?

I created a login page in GWT using widgets and RPC. After succesful login, i want to display another page that also uses GWT widgets (i will use Google Chart Tools Library 1.1). I'm using GWT plugin for Eclipse that creates some folders when starting new projects(server,client....).
How to display second GWT page from the first one?
I have seen this (GWT multi modules for separate HTML pages?), is this the right way?
One way to do that can be that upon login succes, the server send you back an url and you open this url on your client side (onSucess) by changing the location of the current window :
Window.open(YOUR_URL_TO_OTHER_GWT_PAGE, "_self", "");
or (better) :
public static native void changeWindowLocation(YOUR_URL_TO_OTHER_GWT_PAGE)/*-{
$wnd.location.href = url;
}-*/;