Hi…
I have one textfield in one component. i want to get the value of the textfield in another component… is it possible??..i would be grateful for help … thanks…
below my code is :
My First file ::
/*
- MyApplication.java
- Created on 20 September, 2010, 4:40 PM
*/
package com.example.vaadin;
import com.vaadin.Application;
import com.vaadin.ui.;
import com.vaadin.data.;
/**
*
- @author applied
- @version
*/
public class MyApplication extends Application {
buttonclick bc=new buttonclick();
textclick tc=new textclick();
@Override
public void init() {
Window m = new Window("MyApplication");
m.addComponent(tc);
m.addComponent(bc);
setMainWindow(m);
}
}
1st component ::
/*
- To change this template, choose Tools | Templates
- and open the template in the editor.
*/
package com.example.vaadin;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Panel;
import com.vaadin.ui.TextField;
/**
*
- @author applied
*/
public class textclick extends CustomComponent{
TextField txts;
Panel p;
public textclick()
{
p=new Panel();
txts = new TextField();
p.addComponent(txts);
setCompositionRoot(p);
}
}
2nd Component ::
/*
- To change this template, choose Tools | Templates
- and open the template in the editor.
*/
package com.example.vaadin;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomComponent;
import com.example.vaadin.textclick;
/**
*
- @author applied
*/
public class buttonclick extends CustomComponent{
textclick tc=new textclick();
Button b;
public buttonclick(){
b=new Button(“Click me”,new Button.ClickListener()
{
public void buttonClick(Button.ClickEvent event)
{
getWindow().showNotification(tc.txts.getValue().toString());
}
});
setCompositionRoot(b);
}
}
…
I added these 2 component into MyApplication . Now i Need to get value of textfield (txts)…