All you really need is a panel, any basic type would do. And
dynamically add contacts to this pannel as hyper text or buttons.
Not sure you really need a stack panel for this.
Example:
private VerticalPanel myVerticalPanel = new VerticalPanel();
protected ArrayList<Button> myButtons = new ArrayList<Button>();
ClickHandler myButtonHandler = new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if (button != null && button instanceof Button) {
String mytitle = button.getTitle();
// Use the title that has the name in it to do what you
need to do
} else {
//TODO: Some error
}
}
};
// Load the buttons into the panel
public void load();
myVerticalPanel.clear();
for (ButtonBase button : myButtons) {
myVerticalPanel.add(button);
}
}
// Add a button to the list
public void add(String name) {
Button myButton = new Button(name, myButtonHandler);
myButton.setTitle(name);
myButtons.add(myButton);
load();
}
The above simple example is an example. You can add and remove items
from the veritical panel, thus you would not have
to reload the complete panel everytime.
Hope this helps
private VerticalPanel myVerticalPanel = new VerticalPanel();
On May 31, 1:54 am, Tharindu Madushanka <[email protected]> wrote:
> Hi All,
>
> I am new to GWT and just started to study about it. I am reading 'GWT
> in Practice' book as a start. What I am planning to do while learning
> GWT is to implement a web chat client and server. I need to add this
> to a web site, some thing similar to what FB does. But I don't need it
> to be much advanced like that. Only displaying a list of contacts as a
> popup menu or even in a stack panel or something. Still I have no idea
> on how to implement, but I know GWT is the tool I should learn.
>
> I would be really thankful, if any of you kindly point me some
> instructions on how to continue with my work, it would be helpful if
> some one just point me some steps to work on.
>
> Kind Regards,
> -Tharindu
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---