Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5964143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:22:42+00:00 2026-05-22T19:22:42+00:00

in my GWT application I use a Javascript library to provide users with a

  • 0

in my GWT application I use a Javascript library to provide users with a SQL Where string builder capability – used to support ‘advanced search’.

The javascript sources currently just provide a plain html text field for the date. If I was in pure JS I’d incorporate one of the many 3rd party date selector libraries.

But, I’ve already got the GWT date-editor there in the client (to support other UI capabilities).

Can anyone recommend a strategy for incorporating the GWT popup editor in my legacy javascript? Because of GWT compiler obfuscation I don’t think I can reliably predict the name of the GWT date editor component classes.

I suppose it’s a balance between pushing the config from GWT, or pulling from the javascript sources.

cheers,
Ian

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:22:43+00:00Added an answer on May 22, 2026 at 7:22 pm

    First, create in your html the place where you want the date picker to go, like so:

    <span id="dateBox"/>
    

    Create a new entry point, called something like Integration

    package com.example.integration.client;
    
    import java.util.Date;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.i18n.client.DateTimeFormat;
    import com.google.gwt.user.client.ui.RootPanel;
    import com.google.gwt.user.datepicker.client.DateBox;
    
    /**
     * Entry point classes define <code>onModuleLoad()</code>.
     */
    
    public class Integration implements EntryPoint {
    
       @Override
       public void onModuleLoad() {
    
        //create date box
        DateBox dateBox = new DateBox();
    
        //set the value for the form submit
        dateBox.getTextBox().getElement().setId("dateValueField");
    
        //we need to override the default format
        dateBox.setFormat(new DateBox.DefaultFormat() {
    
            private DateTimeFormat dtf = DateTimeFormat.getFormat("MM/dd/yyyy");
    
            @Override
            public void reset(DateBox dateBox, boolean abandon) {
                super.reset(dateBox, abandon);
            }
    
            @Override
            public Date parse(DateBox dateBox, String text, boolean reportError) {
                return super.parse(dateBox, text, reportError); 
            }
    
            @Override
            public String format(DateBox dateBox, Date date) {
                if(date == null) return "";
                return this.dtf.format(date);
            }
        });
    
        //add to the span
        RootPanel.get("dateBox").add(dateBox);
       }
    }
    

    You should probably put this in a new module, something like com.example.integration.Integration.gwt.xml.

      <module rename-to='integration'>
        <!-- Inherit the core Web Toolkit stuff.                        -->
        <inherits name='com.google.gwt.user.User'/>
    
        <inherits name='com.google.gwt.user.theme.clean.Clean'/>
    
        <!-- Specify the app entry point class.                         -->
        <entry-point class='com.example.integration.client.Integration'/>
    
        <!-- Specify the paths for translatable code                    -->
        <source path='client'/>
        <source path='shared'/>
      </module>
    

    Now that you’ve done this you’ll need to do the standard GWT dance to add the compiled code to your HTML. Your final HTML should look something like:

    <html>
      <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
        <link type="text/css" rel="stylesheet" href="Integration.css">
       <title>Web Application Starter Project</title>
    
        <script type="text/javascript" language="javascript" src="integration/integration.nocache.js"></script>
      </head>
    
       <body>
    
        <!-- OPTIONAL: include this if you want history support -->
        <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
    
        <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
        <noscript>
          <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
            Your web browser must have JavaScript enabled
            in order for this application to display correctly.
          </div>
        </noscript>
    
        <form id="form">
            <!-- old style date including formatting javascript and all the old cruft -->
            Old Style Date:<input type="text" id="sometext" value="MM/DD/YYYY"/><br/>
    
            <!-- new style.  substitute your own styles and whatnot to make it not strange -->
            New Hotness:<span id="dateBox"/>
    
            <!-- you can submit this form as it is and it will just work (tm) -->
        </form>
      </body>
    </html>
    

    There will be a form item (text input box) in your form now with the id of ‘dateValueField’. This will submit just like a regular form element.

    So, some of this advice should be able to get you on your way. Good luck.

    Note, there are some smaller and easier javascript libraries (including some jQuery stuff) that can do this much easier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use my own existing model in GWT application. From what I've
I'm trying to use a ClientBundle in my GWT application to make multiple images
I'm attempting to use Panda with my GWT application. I can upload videos directly
I am using GWT for google map application. I use Google's gwt-maps.jar for mapping
Currently I use the JavaScript code to send XML data in GWT. Is there
I would like to have my GWT application use different constants when debugging or
I have gwt web project, which must use application.properties (on client side) loaded as
I have a use case where my GWT application is running on a client
I want to use method level security on my GWT application. I'm trying to
I'm currently writing a pure GWT (2.3) application and I require the use of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.