PDA

View Full Version : Please, put as a hyperlink (to open an address of a page) when the button is clicked.



cdrsanto
3 Jun 2009, 12:20 PM
Please, put as a hyperlink (to open an address of a page) when the button is clicked, for example open the http://www.google.com.

My code is:


package demo.app.client;

import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.google.gwt.user.client.ui.RootPanel;


/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class App extends LayoutContainer {

/**
* This is the entry point method.
*/
public void onModuleLoad() {
ButtonBar bar = new ButtonBar();


/* BOTÃO 1*/
Button button1 = new Button("PRINCIPAL", new SelectionListener<ButtonEvent>(){

@Override
public void componentSelected(ButtonEvent ce) {
MessageBox.confirm("A.P.P.S", "TRABALHO SOBRE EXT-GWT - 1º BIMESTRE PROF. DANIEL LAMOSA", null);
// TODO Auto-generated method stub

}

} );
button1.setBorders(true);
button1.setToolTip("IR PARA PRINCIPAL");

bar.setShadow(true);
bar.setBorders(true);
bar.add(button1);


/* BOTÃO 2*/
Button button2 = new Button("ADD CLIENTE", new SelectionListener<ButtonEvent>(){

@Override
public void componentSelected(ButtonEvent ce) {
MessageBox.confirm("A.P.P.S", "TRABALHO SOBRE EXT-GWT - 1º BIMESTRE PROF. DANIEL LAMOSA", null);
// TODO Auto-generated method stub

}

} );
button2.setBorders(true);
button2.setToolTip("IR PARA ADD CLIENTE");

bar.setShadow(true);
bar.add(button2);


/* BOTÃO 3*/

Button button3 = new Button("LISTAR CLIENTES", new SelectionListener<ButtonEvent>(){

@Override
public void componentSelected(ButtonEvent ce) {
MessageBox.confirm("A.P.P.S", "TRABALHO SOBRE EXT-GWT - 1º BIMESTRE PROF. DANIEL LAMOSA", null);
// TODO Auto-generated method stub

}

} );
button3.setBorders(true);
button3.setToolTip("IR PARA LISTAR CLIENTE");

bar.setShadow(true);
bar.add(button3);





RootPanel.get().add(bar);
}
}


I am waiting for response ... thanks...

Claudio dos Reis

Animal
3 Jun 2009, 12:45 PM
Java? Wrong forum matey!

cdrsanto
3 Jun 2009, 1:50 PM
Java? Wrong forum matey!

I am using EXT GWT ... this forum is indicated by the web site to get help.

stan229
5 Jun 2009, 12:09 PM
http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/user/client/Window.html

Window.open()

cdrsanto
8 Jun 2009, 5:19 PM
http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/user/client/Window.html

Window.open()



Thanks Dude ...:))