I'm using a PopupPanel but by default it cannot be dragged on the screen. Is the way to make id draggable or I should use whole another component?
The DialogBox class is draggable, by its title bar (which a PopupPanel doesn't have; also note that DialogBox extends DecoratedPopupPanel, not just PopupPanel, and sizing works differently than for PopupPanel).
Related
When I use DialogBox to implement Dragable PopupPanel I encounter a problem that when the DialogBox pop up cause The text on the bottom page cannot be copied. How to solve this problem ?
By default DialogBox is modal, which means that:
keyboard and mouse events for widgets not contained by the dialog should be ignored
and thus you can not select nor copy text outside dialog box.
You can change it by calling dialogBox.setModal(false); or by passing modal value to one of the following constructors:
DialogBox(boolean autoHide, boolean modal)
DialogBox(boolean autoHide, boolean modal, DialogBox.Caption captionWidget)
I'm trying to implement a scrollPanel within a Horizontal Panel.
I read this post
GWT Horizontal panel with horizontal scrolling
The answer seems great, however I'm wondering if ravi wrapped his simple panel with a scroll Panel or vice versa.
Basically I wanted to know how the panels were nested within each other?
A scroll panel is nothing special - it's just a DIV element with some CSS set on it. That's what the answer to the other question means, as a SimplePanel is simply a Widget that appears as a DIV.
So what the other answer did was create a scrolling widget by:
Creating a SimplePanel as the content container
Set some CSS with the overflow-x attribute to the SimplePanel
Setting the content will now have a horizontal scroll bar (due to the CSS attribute).
If you prefer a more direct way of doing this check out UiBinder. Using it you can combine widgets/CSS/HTML elements in a form closer to how the browser renders your UI. So for example you can create a DIV with the required CSS to achive a scrolling container.
I need to have a DisclosurePanel with a FlexTable widget as the header and include the arrow icon with animation.
When adding a Widget to a DisclosurePanel, the arrow icon is disabled/replaced by the widget.
I've decided I need to either create a new class that extends FlexTable and has a cell with the arrow icon & the appropriate click handler to animate the icon, or create a wrapper class for DisclosurePanel (as it is a final class). Do either of these seem like a viable solution?
I would create a more generic Composite widget called HeaderWidgetWithArrow that contains
The down arrow image
Any arbitrary widget (such as a FlexTable)
The way if you want to include the arrow for a disclosure panel and say, a HorizontalPanel, you could just re-use the HeaderWidgetWithArrow for that.
Either way, I would not recommend extending FlexTable or DisclosurePanel. You should favor composition over inheritance.
I am working with layout panels and datagrid. When I set the datagrid height to 100%, Grid is not rendering. My panel hierarchy looks like the following image
Am I doing it properly or I messed up the panel hierarchy???
Parent panel is the simple layout panel, inside that I have split layout panel -> scrollpanel -> datagrid
DataGrid requires to be put in a LayoutPanel or Panel that implements the ProvidesResize interface to be visible. ScrollPanel implements that interface.
Furthermore this chain of LayoutPanels from your DataGrid up to your root element/panel has to be unbroken. That seems to be the case in your panel hierarchy.
Finally you have to use the RootLayoutPanel instead of the RootPanel to add your LayoutPanels.
So did you make sure that you add your SimpleLayoutPanel to the RootLayoutPanel ?
In my case it was caused by this:
DataGrid rows not visible in second tab of TabLayoutPanel
I have got a DisclourePanel with a button on it. But when I call button.getParent()
I always get a SimplePanel. With other Panel like VerticalPanel it works.
Does Anyone know why?
DisclosurePanel extends type Composite meaning it is a widget that can be composed of many widgets. It consists of a header and a SimplePanel both stacked in a VerticalPanel. Any content you give it, is placed in this SimplePanel, in your case a button, thus SimplePanel is returned by getParent()