Saturday, January 2, 2010

Popup is not closed when it dragged

In my i tried to drag a popup window. Here the popup is not closed
after it dragged. I have used a button to hide the popup. Initially
when clicks on button it will close, but once the popup dragged it
will not closed.
Please help me to resolve this issue


Code:

import com.allen_sauer.gwt.dnd.client.PickupDragController;
public void CreatePopUp(){
try{
final PopupPanel popup=new PopupPanel();

{
FlowPanel panel=new FlowPanel();
{
FlexTable table=new FlexTable();
table.setStyleName("PopupBack");
table.setWidth("300px");
table.setHeight("200px");
{
FlexCellFormatter cellFormatter = table.getFlexCellFormatter();
cellFormatter.setColSpan(0, 0, 2);
cellFormatter.setHorizontalAlignment(0, 0,
HasHorizontalAlignment.ALIGN_CENTER);
cellFormatter.setHorizontalAlignment(2, 0,
HasHorizontalAlignment.ALIGN_CENTER);
table.setHTML(0, 0, "<b>Dragable popup</b>");

cellFormatter.setWidth(1, 0, "100px");
Image image=new Image();
image.setWidth("100px");
image.setHeight("150px");
image.setUrl("images/USB-Xmas-Tree.gif");

table.setWidget(1, 0, image);
table.setHTML(1, 1, "This is a sample dragable popup");

final Button btnCancel = new Button();
{
btnCancel.setText("close");
btnCancel.setStyleName("");
btnCancel.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
// TODO Auto-generated method stub
popup.hide();
}
});
table.setWidget(2, 1, btnCancel);
}
}
panel.add(table);
}

popup.setWidget(panel);
popup.setAnimationEnabled(true);
popup.setPopupPosition(Window.getClientWidth()-315,
Window.getClientHeight()-233);
}
popup.show();
PickupDragController dragController=new PickupDragController
(RootPanel.get(),true);
dragController.makeDraggable(popup);
}
catch (Exception e) {
Window.alert(e.toString());
}
}

--

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate