Friday, April 29, 2016

Re: MaterialModal in gwt-material-1.5.0.jar

Oops! Sorry I missed the attachment. It's available from my Google Drive.

On Friday, April 29, 2016 at 4:58:04 PM UTC-4, Velusamy Velu wrote:
Hello -

I wanted to move my project to gwt-material-1.5.0 from 1.4.  The move could have been painless but for the MaterialModal.  Changing from static to instance model seems like the right thing to do.  As a precaution I created a simple pilot project with gwt-material-1.5.0.jar and followed the steps as in (http://gwtmaterialdesign.github.io/gwt-material-demo/#!gettingstarted).  This project is not a Maven project so I downloaded the gwt-material-1.5.0.jar file.

It brings up simple button as show above.  The idea is to show a modal when the button is clicked.


The problem is it just doesn't work right.  A gray screen appears without the content, like this.



Here are the snippets of code (I also have attached the Eclipse project file as a zip) -


in the entry point class's job is to show a button defined in an UiBinder called ModalLauncher -

        ModalLauncher launcher = new ModalLauncher();
       
RootPanel.get("sendButtonContainer").add(launcher);

the module launcher's UI is
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui"
 
xmlns:m="urn:import:gwt.material.design.client.ui">
 
<g:HTMLPanel>
 
<m:MaterialButton text="Show Modal" ui:field="button" margin="15" />
 
</g:HTMLPanel>
</ui:UiBinder>

its java counterpart is

    @UiHandler("button")

   
void handleClick(ClickEvent event) {
       
AboutUs aboutUs = new AboutUs();
        aboutUs
.show();
   
}


the AboutUs is
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui"
 
xmlns:m="urn:import:gwt.material.design.client.ui">
 <g:HTMLPanel>
   
<m:MaterialModal type="DEFAULT" inDuration="500" outDuration="500"
     
ui:field="aboutUsModal" backgroundColor="blue" dismissable="true">
     
<m:MaterialModalContent>
       
<m:MaterialTitle title="Default Modal" description="Howdy world!" />
     
</m:MaterialModalContent>
     
<m:MaterialModalFooter>
       
<m:MaterialButton text="Close Modal" type="FLAT" />
     
</m:MaterialModalFooter>
   
</m:MaterialModal>
 
</g:HTMLPanel>

</ui:UiBinder>


and its java counterpart is - 
    interface AboutUsUiBinder extends UiBinder<Widget, AboutUs> {
   
}

   
private static AboutUsUiBinder uiBinder = GWT.create(AboutUsUiBinder.class);

   
@UiField
   
MaterialModal aboutUsModal;

   
public AboutUs() {
        initWidget
(uiBinder.createAndBindUi(this));
   
}

   
void show() {
        aboutUsModal
.openModal();
   
}

Any help would be highly appreciated.

Thanks
Sam Velu

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment