Con
14 May 2009, 11:35 PM
Hi guys
I have recently migrated to GXT 2 and now I am having issues with StatusButtonBar and ButtonBarEvent.
StatusButtonBar seems to be deprecated and so is the ButtonBarEvent.
I have the below code snippet in the earlier version, which basically has three buttons - next, prev and cancel.
Can somebody point out how to alter this code in order to make it working in GXT 2.
Or at least what is the alternate for StatusButtonBar and ButtonBarEvent
StatusButtonBar statusbuttonbar = new StatusButtonBar();
statusbuttonbar.add(prevBtn);
statusbuttonbar.add(nextBtn);
statusbuttonbar.add(okBtn);
statusbuttonbar.add(cancelBtn);
statusbuttonbar.addListener(Events.Select, new Listener<ButtonBarEvent>()
{
public void handleEvent(ButtonBarEvent bbe)
{
onButtonPressed(bbe.item);
}
});
private void onButtonPressed(Button button)
{
if (button == cancelBtn)
{
this.hide();
return;
}
if (button == prevBtn)
{
Window.alert("Prev");
}
if (button == nextBtn)
{
Window.alert("Next");
}
}
Thanks in advance
Con
I have recently migrated to GXT 2 and now I am having issues with StatusButtonBar and ButtonBarEvent.
StatusButtonBar seems to be deprecated and so is the ButtonBarEvent.
I have the below code snippet in the earlier version, which basically has three buttons - next, prev and cancel.
Can somebody point out how to alter this code in order to make it working in GXT 2.
Or at least what is the alternate for StatusButtonBar and ButtonBarEvent
StatusButtonBar statusbuttonbar = new StatusButtonBar();
statusbuttonbar.add(prevBtn);
statusbuttonbar.add(nextBtn);
statusbuttonbar.add(okBtn);
statusbuttonbar.add(cancelBtn);
statusbuttonbar.addListener(Events.Select, new Listener<ButtonBarEvent>()
{
public void handleEvent(ButtonBarEvent bbe)
{
onButtonPressed(bbe.item);
}
});
private void onButtonPressed(Button button)
{
if (button == cancelBtn)
{
this.hide();
return;
}
if (button == prevBtn)
{
Window.alert("Prev");
}
if (button == nextBtn)
{
Window.alert("Next");
}
}
Thanks in advance
Con