Does anyone know if there is a slider bar in gwt? I only found the one from GWT Incubator, which is unfortunately deprecated.
Try this:
http://code.google.com/p/gwt-slider-bar/
With help of this project it is possible create different slider bars.
There is no slide bar in the standard GWT library. But an alternative to the GWT incubator is in the sample project listwidget by David Chandler (he's on the Google GWT team). For this sample project he also needed a Slide bar. He took the sources from the GWT incubator and updated them.
What you can do is take these sources and put them in your own project (it has an apache licence). It's maybe not optimal but it worked for me. Here is a link to the sources http://code.google.com/p/listwidget/source/browse/#svn%2Ftrunk%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgwt%2Fgen2%2Fclient (and for convenience here a link to the project: http://code.google.com/p/listwidget/)
You can now just use an HTML5 slider, like this:
<input ui:field="sliderInput" type="range" />
#UiField InputElement sliderInput;
sliderInput.setAttribute("min", "1");
sliderInput.setAttribute("max", "100");
sliderInput.setAttribute("step", "10");
Event.sinkEvents(sliderInput, Event.ONCHANGE);
Event.setEventListener(sliderInput, new EventListener() {
#Override
public void onBrowserEvent(Event event) {
// sliderInput.getValue();
}
});
You can use the slider from smartgwt. You only have to pay attention to the css definition. For the firefox it have to look like this:
#isc_4 td{
font-size:0px;
}
The slider is not a html5 slider and not touchable, but it works.
It is being solved by writing a new lib which uses the jquery slider. The author will release the code when it's stable :)
Related
I'm beginner to GWT and MGWT. In my project I've a requirement that I have to enable
and disable the MGWT Botton. direct method is not given in current version of MGWT.
I've seen it in GWT button.
com.google.gwt.user.client.ui.Button b = new com.google.gwt.user.client.ui.Button();
b.setEnable(boolean);
But it is not given in MGWT.
Please help me,How can we achieve above functionality using CSS/something else
I am not a MGWT guy. And there must be some better solution. You can try low level element manipulation:
Button mgwtButton;
mgwtButton.getElement().setAttribute("disabled", "disabled");
If you take this solution it will be better to prepare later your CustomButton that extends MGWT Button with additional setEnabled(boolean enabled) method to have better API.
There's a way to show a notification message in smartgwt similar to the ones provided by Vaadin
PD: Solution given in another stackoverflow question for GWT doesn't seems to work correctly in smartgwt.
The problem with PD suggested solution link is the zindex.
SmartGWT uses high zindex values to display it's components.
The solution is to manually increment zindex of the popup in show:
public void show(int delayMilliseconds) {
show();
DOM.setIntStyleAttribute(getElement(), "zIndex", 1000000);
startDelayedHide(delayMilliseconds);
}
I want to build a flowCover in GWT. But I don't know how to do it.
Have anyone an idea? Or a sample?
Greetz.
I would start with examples implementing it using CSS and see how you can copy their Javascript logic and make a similar widget: http://paulbakaus.com/2008/05/31/coverflow-anyone/ and http://scottgale.com/blog/coverflow-css-3d-transforms/2011/05/24/
we've used a combination of GWT and smart gwt to add some features to an app we've built.
The problem I have is that we decided to make use of the accordion functionality (SectionStack's) that SmartGWT offers and we are nesting our stock gwt widget inside a canvas and then nesting that inside the section stack. E.G
SectionStack(SmartGWT)->Section(SmartGWT)->Canvas (SmartGWT)->VerticalPanel(GWT) -> Other GWT Widgets (HTML, labels etc)
Before we mixed GWT and SmartGWT it was possible to select text in the standard GWT widgets and then copy and paste etc. Nesting the GWT widgets in the SmartGWT canvas means this is now not possible. Can anyone offer an explanation why this is the case and/or a solution on how to fix it.
I've tried canvas.setCanSelectText(true); but this doesn't seem to do anything either.
We're using GWT 2.1 with SmartGWT 2.2. The demo app using SmartGWT2.2 seems to exhibit the same problem over at http://www.smartclient.com/smartgwt/showcase/#featured_gwt_integration . I've also tried GWT 2.0.x with SmartGWT 2.2
Any help appreciated.
For those interested I've managed to find a bug registered for this at : code.google.com/p/smartgwt/issues/…
Actually it is not an issue. You have to call the setCanSelectText method on the WidgetCanvas wich is wrapping your GWT widget. The WidgetCanvas is created in the addItem(Widget) method. One way to go is to override the addItem method like this:
#Override
public void addItem(Widget widget) {
if (widget instanceof Canvas) {
addItem((Canvas) widget);
} else {
WidgetCanvas wg = new WidgetCanvas(widget);
wg.setCanSelectText(true);
addItem(wg);
}
}
I've ported my GWT app to 1.7.0 from 1.5.2 and widgets that are used as a control on a GoogleMap no longer get ClickEvents. I've checked that the DOM insertion of the control is the same and there are no differences there. Since GWT 1.6 introduced a significant change in the way events are handled I'm thinking something has gone amis there.
I use a GWT image as a a GoogleMaps control:
Image control = new Image("/oeg/images/info_32.png");
Which I place on the map using the Mapitz GMaps lib (yes I know its old, but I have kept supporting a working version that is updated - if anyone is interested just ask)
GControlPosition infoPosition =
new GControlPosition(GControlAnchor.G_ANCHOR_TOP_RIGHT(),
new GSize(7, 30));
getGmap().addControl(new GControl(control, infoPosition));
I've checked the compiled code and it literally just puts the html element on the map as a GControl just the way you'd expect and as I said I've checked the DOM to make sure nothing looks funny.
to get ClickEvents I used to do this...
control.addClickListener(new ClickListener() {
public void onClick(Widget sender)
{
doTipOfTheDay();
}
});
which I changed to this in the 1.6.0 world,
control.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent ce)
{
doTipOfTheDay();
}
});
I've also tried explicitly sinking the click event with
control.sinkEvents(Event.ONCLICK);
but none of this works in GWT-1.6.0/1.7.0 and it all worked fabulously in 1.5.2
Can anyone shed some light on this? Has anyone else run into event issues w/ controls on GMaps with GWT 1.6 and above?
FYI with other Gmaps objects I have no problems. I'm getting mouse clicks on the map surface, on markers etc.
but controls, not so much