Hello,
I am new to GWT and currently have it running in Eclipse 3.4 with the
GWT plugin:http://code.google.com/appengine/docs/java/tools/
eclipse.html
I seem to have everything running fine in the Hosted Browser (and even
IE for that matter) but I cannot figure out what is wrong when I try
to run the same app in Firefox. Here are a few snippets of my code:
The program has a login page that authenticates a user and returns the
user ID if successful.
Here is the EventHandler class that is in use for the textfield and
also button on the login form.
// Create a handler for the sendButton and nameField
class MyHandler implements ClickHandler, KeyUpHandler {
public void onClick(ClickEvent event) {
sendNameToServer();
}
public void onKeyUp(KeyUpEvent event) {
if (event.getNativeKeyCode() ==
KeyCodes.KEY_ENTER) {
sendNameToServer();
}
}
private void sendNameToServer() {
sendButton.setEnabled(false);
String textToServer = nameField.getText();
textToServerLabel.setText(textToServer);
serverResponseLabel.setText("");
authService.adminLogin(textToServer,new
AsyncCallback<Integer>() {
public void onFailure(Throwable caught) {
// Show the RPC
error message to the user
dialogBox.setText("Admin Login - Failure");
serverResponseLabel.addStyleName("serverResponseLabelError");
serverResponseLabel.setHTML(SERVER_ERROR);
dialogBox.center();
closeButton.setFocus(true);
}
public void onSuccess(Integer result) {
loginUpdate(result);
}
});
}
}
Login Update does the following:
private void loginUpdate(Integer result) {
//need to authenticate
dialogBox.setText("Admin Login");
serverResponseLabel.removeStyleName("serverResponseLabelError");
serverResponseLabel.setHTML("results - "+result);
dialogBox.center();
closeButton.setFocus(true);
try{
if(result!=null&&result==1){
//successful login
RootPanel.get("loginForm").setVisible(false);
// Create table for stock data.
twebFlexTable.setText(0, 0, "Title");
twebFlexTable.setText(0, 1, "Date");
twebFlexTable.setText(0, 2, "Host(s)");
twebFlexTable.setText(0, 3, "Options");
// Add styles to elements in the stock list table.
twebFlexTable.setCellPadding(6);
twebFlexTable.getRowFormatter().addStyleName(0,
"twebListHeader");
twebFlexTable.addStyleName("twebList");
twebFlexTable.getCellFormatter().setWidth(0, 0,
"35%");
twebFlexTable.getCellFormatter().setWidth(0, 1,
"15%");
twebFlexTable.getCellFormatter().setWidth(0, 2,
"35%");
twebFlexTable.getCellFormatter().setWidth(0, 3,
"15%");
twebFlexTable.getCellFormatter().setHorizontalAlignment(0, 3,
VerticalPanel.ALIGN_CENTER);
mainPanel = new VerticalPanel();
mainPanel.add(twebFlexTable);
// Associate the Main panel with the HTML host page.
RootPanel.get("twebList").add(mainPanel);
RootPanel.get("twebList").setVisible(true);
refreshTwebList("upcoming");
}
else if(result!=null&&result==2){
//need to authenticate
dialogBox.setText("Admin Login - Failed");
serverResponseLabel.removeStyleName("serverResponseLabelError");
serverResponseLabel.setHTML("You need to
authenticate your Twitter
account to carry on.");
dialogBox.center();
closeButton.setFocus(true);
// TODO hide login and show authenticate button
with external link
to page
}
else if(result!=null&&result==-1){
//failed
dialogBox.setText("Admin Login - Failed");
serverResponseLabel.removeStyleName("serverResponseLabelError");
serverResponseLabel.setHTML("Failed login,
please close this box
and try again.");
dialogBox.center();
closeButton.setFocus(true);
}
}
catch(Exception ex){
System.out.println("ex:"+ex);
}
}
The javascript error that appears in Firefox when the loginUpdate
method is called (after the Dialog pops up) is:
Error: a is null
Source File:
http://localhost:8080/twebinaradminapp/BCBCE299998ADB375DCDDA5F63B9DE2D.cache.html
Line: 548
I've been trying to figure this out for a few days now and cannot
continue on without figuring out this issue. Does anyone have any idea
on where I should look or how to approach fixing this error and why
it's only happening in Firefox & Chrome?
If I can't get this setup soon I'll have to move away from GWT and
look for another solution. Any help would be greatly appreciated.
Thank you.
-- Adrian
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---