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.
Related
Im new to GWT, this should be a simple question i hope.
Imagine that i made two Uibinders Modules or two independent widgets.(this a simplify example to expose my problem)
one is a set of buttons (ButtonPanel) and the other image to been show when i press a button from the previous panel(ImagePAnel) with a label to be the title of the image.
How can i reach the wiget the imagePanel to actuate when there are a handler click from the buttons in the (ButtonPanel)
Thanks for the help.
I recommend you to use MVP Pattern for Development and add all events in the Presenter.
Or Else you can use the following technique within the UIBinder's Java File
#UiHandler(value={"openButton"})
public void onOpenButtonClick(ClickEvent clickEvent){
//ADD THE BUTTON LOGIC HERE
}
Just Create an Object of the Images & the ImagePanel to be loaded and add it on button click using this.
I can't say I understand exactly what you are trying to accomplish but in general the best way for different components in a GUI application to communicate is to use the eventbus pattern. There's one global Eventbus object in the application that lets components subscribe to a specified type of event that are fired from any place in your application. This way you avoid spaghetti code and your components are loosely coupled.
http://code.google.com/webtoolkit/articles/mvp-architecture.html#events
I typically create a third component that is the container for the Button and Image components you defined. This component sets itself as a callback for the two and contains logic to integrate the two.
I have a web app I'm creating, where I need to allow the user to swipe between pages. From what I've been researching you need to use MGWT (mobile Google web toolkit -- http://code.google.com/p/mgwt/)
Then you have to create a class that extends a Panel class and implements MGWT's "HasTouchHandlers" interface:
(http://code.google.com/p/mgwt/source/browse/mgwt/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchPanel.java?name=v1.0.0-alpha1)
Also your Panel should implement GWT's AnimatedLayout interface (such as LayoutPanel, DockLayoutPanel, and SplitLayoutPane), so you can natively slide the Panel after intercepting the touch event.
My question is can any one point me to a tutorial or example code on how to do this? Or how layout a GWT project in terms of
Panels? For example, if I have multiple pages in my app do I have multiple Panels?
thanks - Mike
mgwt now has support for swipes. There is a swipe recognizer as well as a swipe panel:
See it in action:
http://mobilegwt.appspot.com/showcase/#CarouselPlace:
Here is the code:
http://code.google.com/p/mgwt/source/browse/src/main/java/com/googlecode/mgwt/ui/client/widget/Carousel.java
I prefer that you use iScroll for swipe because it works without any issues on Android as well as iOS Browsers. The Implementation will also work on 3rd party browsers like Diigo or Dolphin. With this you i think you can completely avoid using the mgwt API.
You can also do it yourself by adding implements TouchStartHandler, TouchMoveHandler, TouchEndHandler to you class and handling the events and store what has happened. If you have moved more than X between start and end it's a swipe.
In my wizard page, the Next and Back buttons are not visible. is there any method to be called to make that enable?
Thanks a lot in advance!
Did you add multiple Wizard pages to the wizard? If there is only a single page, it makes sense to remove the mentioned buttons.
Update:
If there are multiple pages, then look at the Wizard implementation, and check the needsNextAndPreviousButton method what it describes. If you have implemented the IWizard interface directly (and not using some convenience abstract class, such as Wizard), it is possible that you generated that method returning constant false.
If that did not help, I suggest looking at the tutorial http://www.eclipse.org/articles/article.php?file=Article-JFaceWizards/index.html
Check the needsNextAndPreviousButton method in the wizard constructor. If you've added pages in your wizard then check canFlipToNextPage, isPageComplete, and validate your page completion in these methods and enable/disable as well.
To me it seems like the new GWT 2.1 table widget (as well as the other ones) is missing a continous scrolling feature (simmilar to smartgwt's "live grid"). Overriding the AbstractPager seems to be a long way to go.
Any ideas how to implement it as easy as possible?
Thanks, Mario.
Take a look at this example and its source code. Hope this somehow helps.
I'm starting with android, and the app I'm developing is gonna need custom widgets look (glossy buttons, animated backgrounds etc.),
I've googled for any external libraries to achieve this and did not find anything.
let me guess, the only way to this is by painly extending base view classes and overriding onDraw etc. ?
You need to explore View Styles. You can customize almost any view element. You might not need any external library that extends and designs custom buttons.
More ref:
http://blog.androgames.net/40/custom-button-style-and-theme/
http://www.androidworks.com/changing-the-android-edittext-ui-widget
I like this library quite a lot: https://github.com/cyrilmottier/GreenDroid
It includes:
Action bar
Quick action
AsyncImageView
and a lot of other things
It's easy to use and nice for quick developments.