PDA

View Full Version : StatusButtonBar issue after migrating to GXT 2



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

edumrf
25 May 2009, 10:28 AM
Same thing here...

sven
25 May 2009, 11:04 AM
ButtonBar is now a ToolBar. So it fires a ToolBarEvent (ComponentEvent)

Also there is now a Statuscomponent that you can use to display a status.

edumrf
25 May 2009, 11:36 AM
I didin't find anything on Statuscomponent on GXT 2.0m2
I'm gonna have to implement the "showBusy()" method all over?

Thanks.


ButtonBar is now a ToolBar. So it fires a ToolBarEvent (ComponentEvent)

Also there is now a Statuscomponent that you can use to display a status.

sven
25 May 2009, 12:11 PM
It is called Status and it is also shown in the examples