placing widget in listbox/dropdown in gwt - gwt

i am using gwt to build my web site.
i would like to create a dropdown/listbox that contains no just text but also images, meaning that in the drop down there will be a what ever widget that ill create.
please advise
jaimon

You won't be able to do this with a ListBox, because it just creates an HTML < select> element.
You can use a MenuBar that has one menu with MenuItems in it to simulate a dropdown with complex widgets inside it. You will also be able to style the dropdown rather than rely on browser-styled form elements.

Take a look at the Combobox or Suggestion box in Advanced GWT Components.

Another widget is the DropDownListBox in the GWT incubator. I have not used it, but the stated intent is to provide a rich, stylable ListBox. You can pass raw HTML to the addItem() method.
DropDownListBox

it is possible to use Tree inside ScrollPanel, without using nested items
Tree allows TreeItem to be a Widget

Related

GWT combobox with custom items

I am trying to define a combobox that shows as items, custom controls instead of standard text only items. The control used is com.google.gwt.user.client.ui.ListBox (standard GWT control) as combobox.
Looking at the Showcase http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwCellList for example, there is a custom list with custom items. To do this, the example uses the CellList class. Is it possible to use the same technique for a combobox?
More in general, is it possible to use a combobox with custom, complex items (e.g. multi column items, custom complex items of any sort, in general a widget of my own or similar)?
I ask this using standard gwt ui controls, no Ext-GWT, no Smart GWT or others.
Thanks.
You cannot style GWT ListBox as it translates to HTML <select> element. If you still insist on feature rich combo-box like GXT then you can go with
GwtChosen - http://dev.arcbees.com/gwtchosen/
CellList with reduced height, selection mode - single and CustomCell.
GWT SuggestBox - http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwSuggestBox

GWT Checkbox Selectable Tree

I'm using GWT 2.5 and am looking for a Tree widget which will allow me to have a multi-selection model controlled by checkboxes adjacent to each TreeNode. Something similar to the JQuery plugin described here with the following results:
As you might expect, I'd hope that checking a box would select all children of the checked node, and if any children are unchecked, you'd get the "half-checked" icon (shown by the "Solutions" node) -- so I'll need a three-state checkbox.
Does this widget exist in GWT already, or would I need to code it myself?
There is no default widget in GWT 2.5 that supports this.
Your options:
Use third-party library
Implement you own widget
I used to implement my own based on CellTree and although it's feasible - it requires lots of work (custom tree model, cell widgets with renderers and value updater-s). If you flexible on choosing libraries - have a look at Smart GWT's checkbox tree.

Place a button in JFace tableviewer column

I'm working on Eclipse RCP Viewer framework, i have a requirement to place a button widget in column of TableViewer.
I have been following the tutorials to develop my application
I don't find any widget inside the tableviewer, as in the example it was just an image, is it possible to place a widget, any idea please suggest me.
I've searched API to find any predefined method like getWidget() similar to getImage() ,that can be placed in col.setLabelProvider(), but there was none actually,How can i do this
you may want to use editing support or for instance DialogCellEditor
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjface%2Fviewers%2FDialogCellEditor.html

Custom component for Label with Text box and image in GWT

I need to create a custom component which can have Label then Textfield and Image, by clicking the image i should select date, that selected date should be populated in TextField,
Is there way i can develop a custom component.
Thanks in Advance!!!
Absolutely!
You need to create a custom widget, and the way to do that is to extend the Composite class.
From the documentation:
A composite is a specialized widget that can contain another component (typically, a Panel) but behaves as if it were its contained widget. You can easily combine groups of existing widgets into a composite that is itself a reusable widget. Some of the UI components provided in GWT are composites: for example, the TabPanel (a composite of a TabBar and a DeckPanel) and the SuggestBox.
Rather than create complex widgets by subclassing Panel or another Widget type, it's better to create a composite because a composite usually wants to control which methods are publicly accessible without exposing those methods that it would inherit from its Panel superclass.
There is a good example to get you started here:
http://code.google.com/webtoolkit/doc/latest/DevGuideUiCustomWidgets.html
The GWT showcase give an example of somthing similar to what you are looking for along with the source code:
"Date Picker" - GWT Showcase
If you want to develop a custom component, look at #Jon Vaughan's answer!
You may also use third party libraries with widgets, like Ext GWT or SmartGWT. Date picker is one of the base widgets that everyone provides.

How can I embed a webpage in a GWT/GXT webapp?

I am working to recreate (conceptually) a prototype I've written in Cappuccino in GWT/GXT. Cappuccino made it trivial to display an external webpage as part of the application by using a WebView.
However, I cannot find any way to do this with GWT/GXT. There is a HtmlContainer widget, but this seems to be intended for something else. Any suggestions on how to do this?
If you have the html-code and just want to render it use the "HTML"-widget. Form the docs
A widget that can contain arbitrary HTML. This widget uses a element, causing it to be displayed with block layout.
If you want to display a different page e.g. stackoverflow.com in your webapp use the "frame" widget. From the docs:
A widget that wraps an IFRAME element, which can contain an arbitrary web site.
You can set the url of a ContentPanel
e.g.
ContentPanel panel = new ContentPanel();
panel.setUrl("http://www.url.com/page");
panel.setHeaderVisible(false);
panel.setBorders(false);
panel.setBodyBorder(false);
You can also do this for the GXT Window class too.